Nagash
Nagash

Reputation: 11

db2 database owner

How to get/change db2 database owner?

Upvotes: 1

Views: 3701

Answers (2)

gvphubli.blogspot.com
gvphubli.blogspot.com

Reputation: 110

In DB2 that is one of the strangest things, to take care of that, after restore you have to run following command and recycle the instance which causes outage.

db2set DB2_RESTORE_GRANT_ADMIN_AUTHORITIES=ON

This may not be ideal if the instance where you restore the DB is sort of cannot take outage. So avoid this situation as part of instance setup I set this variable to begin with.

Upvotes: 0

data_henrik
data_henrik

Reputation: 17118

In DB2 there is no direct database owner, but there is the concept of database administrator. Here is an overview of DB2 database authorities. Those are per database and can be granted and revoked. In order to get or change the "database owner" you would revoke the DBADM authority or grant it. You could even have multiple users who have that authority.

All users with DBADM authority can be obtained this way:

SELECT DISTINCT GRANTEE, GRANTEETYPE FROM SYSCAT.DBAUTH
      WHERE DBADMAUTH = 'Y'

In order to create a database, you would need the SYSADM or SYSCTRL authority on the system (instance) level.

Upvotes: 4

Related Questions