-1

I'm new to DB2 and have installed the DB2 developer edition. I launched the DB2 command line - admin created an instance and switch to that instance. Then I'm going to create a db under this instance but it gives me the following error message

SQL1092N  The requested command or operation failed because the user ID does
not have the authority to perform the requested command or operation.  User
ID: "USER_NAME".

I'm using Win 10 and tried to add the default user to both DB2USERS and DB2ADMNS group but it does not help. I assume the 'db2admin' user should exist? How can I make sure it exist and how I can switch to that user?

mao
  • 11,321
  • 2
  • 13
  • 29
HHH
  • 6,085
  • 20
  • 92
  • 164

1 Answers1

0

Ensure you login to Windows with local-administrator rights on the device when you are changing Db2 setup details.

If your device has multiple Db2 products installed, use 'Default DB2 and Database Client Interface Selection Wizard' to choose to act on the correct product, so that when you use db2cmd.exe or other database-related tools they will work with the correct product. You don't need to do this when you only have a single Db2 product installed.

If your device is a member of a Windows Server domain and you are logged in as a domain-user, then run db2cwadmin.bat and in the resulting DB2CMD.EXE window :

set the DB2INSTANCE environment variable to the name of your DB2-instance (by default on Windows this is DB2). To do this, use the command (replace your Db2 instance name):

set DB2INSTANCE=your_db2_instance_name

Add your domain-account to the local group DB2ADMNS (if you chose the default groups during Db2 installation). To do this, use either the GUI in Control-Panel, or use command-line (substitute your own Domain name and user name) :

net localgroup db2admins mydomain\myuser /add

and make sure the command succeeds. Then run the following commands:

db2set DB2_GRP_LOOKUP=LOCAL,TOKENLOCAL        

db2 update dbm cfg using sysadm_group DB2ADMNS

db2stop  

db2start

Consider running the Windows Db2 services with a domain-account instead of a local-account. To do this run services.msc, find the Db2 service (by default the name is DB2-0), and adjust the Properties "Log On" attributes to specify the domain-user account , apply the change, and stop & restart the service. Running the service with a domain-account gives the Db2 access to the domain-resources (for example network-drives etc) to which that domain-account has relevant access. You don't need to use your own domain-account, you can use a domain account that has certain characteristics such as non expiring password.

Now try creating your database. If you still get the same symptom, then edit your question to add the command-lines and their output along with the db2level output. It also helps to examine the Db2 diagnostics file db2diag.log which often can show more details that let you resolve simple problems.

mao
  • 11,321
  • 2
  • 13
  • 29