I have a DB2 database version 11.1 on Linux - rhel 7.7 in my test environment. I need help on how to change the default db2 admin username to something else, ie. db2inst1 to dbroot. And the new db2 user - dbroot should have the same privileges which old db2 user - db2inst1 had. Please share the steps to do the needful tasks.

Thanks in advance

  • create a new user (os user) and grant dbadm on the database to that user.
    – Lennart
    Oct 5 '19 at 18:45
  • In addition, you may want to transfer ownership on all database objects to that user
    – Lennart
    Oct 5 '19 at 18:47
  • You have to be more precise in what you're asking. Is this about DBADM privileges on a particular database? SYSADM privileges? Instance owner privileges?
    – mustaccio
    Oct 8 '19 at 15:27

It is not possible to directly rename the db2 instance name, But following steps can be used to move the db to new instance

Take the backup of DB's and provide 755 permissions to backup images. Offline backup is recommended db2stop command to stop the instance drop current instance name by using db2idrop command create new instance by using db2icrt command once instance is created, switch to the instance id and please start the instance by db2start command Restore the db to new instance name by using below command incase of auto storage db2 restore db from ON NEWLOGPATH If there are user defined tablespaces, Which will need redirect restore db2 connect to

or Run below command to grant DBADM access to dbroot.

db2 " grant DBADM WITH DATAACCESS on database to user dbroot";


You may want to create a new instance with instance name as dbroot and then move all your database to new instance dbroot (from current instance db2inst1) using db2relocatedb utility.

Please check: https://www.ibm.com/support/knowledgecenter/en/SSEPGG_11.5.0/com.ibm.db2.luw.admin.cmd.doc/doc/r0004500.html

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