As a user with DBADM privileges I enter

db2pd -db mydb -locks showdetail

from the DB2 CLP. The command then fails with message

Database mydb not activated on database partition 0.

Option -locks requires -db <database> or -alldbs option and active database.

I verified that the database is active:

C:\Windows\system32>db2 list active databases

                           Active Databases

Database name                              = MYDB
Applications connected currently           = 0
Database path                              = C:\DB2\NODE0000\SQL00002\

I also googled the error message and found an IBM support page for TSM which suggests my environment variable %db2instance% might not be set appropriately. However, everything appears to be in order:

C:\Windows\system32>set %db2instance%

What other reasons could there be, that db2pd is giving me the above error message?

I'm running DB2 v9.7.4 on Windows 7 Embedded.

  • 1
    Does your login ID have the local administrator authority on the DB2 server? – mustaccio Mar 11 '15 at 17:54

db2pd requires Administrator authority on Windows, in the command shell you are executing it. Setting your ID as a member of the Administrators group on the local machine is not sufficient.

IBM adds "DB2 Command Window - Administrator" in your Start Menu to give you a DB2 Command Window that has administrator privileges (which is the recommended method). Alternatively if you are using a normal command window (cmd.exe), you would have to start it by right clicking "Command Prompt" and choosing "Run as Administrator".

It might be possible to use runas to execute db2pd, but it's probably easier to just start the command window directly with administrator privileges.

| improve this answer | |
  • If I am a local admin, does not any shell (or any program, for that matter) run for me with admin authorities? – mustaccio Mar 11 '15 at 18:24
  • No, it's not like logging in to a UNIX box as root. You have to specify to start something with admin authority, at which point Windows pops up the UAC dialog. – Ian Bjorhovde Mar 11 '15 at 21:05
  • That did solve my problem, thank you very much. The user under which I was executing db2pd had DBADM privilege which I believed would suffice, but it was not part of the Administrators group of Windows. Adding the user to the Administrators group and starting db2cmd via right click -> Run as Administrator then worked. – Alexander Tobias Bockstaller Mar 12 '15 at 8:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.