Friday, 30 September 2011

How to do DB2 Administration when DB2 instance id is locked.


How to do DB2 administration when the instance id is locked or sudo is revoked.
  1. Login to the server with your personal id (id should be a member of db2admin group)
  2. Find the instance home directory using lsuser command or finger command.
  3. Switch to the instance home directory.
  4. Now go to sqllib directory and execute db2profile. This will setup the environment for particular instance.
  5. Now attach to the instance using the following command.
  6. Now we can perform almost all the administration tasks, with out instance id. (Only thing is our id should be part of db2admin group).
  7. Certain specific utility like db2pd, db2top may not work due to restrictions, but still we are good to go with other normal DBA activity.
In this way we can perform all the administration tasks, even instance id is locked or sudo is not working.