1

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

Loay
  • 21
  • 2

2 Answers2

0

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";

Loay
  • 21
  • 2
-1

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