Here’s a message you can use to post on Stack Overflow:
Title: Authorization Errors After Restoring DB2 Database to V9.7 or Higher
Body:
Hi everyone,
I’m experiencing authorization errors after restoring a DB2 database to version 9.7 or higher. Despite being a SYSADM
, I encounter errors such as SQL0551N, SQL0552N, and SQL3020N.
Here’s what I’ve tried so far:
-
I set the
DB2_RESTORE_GRANT_ADMIN_AUTHORITIES
registry variable toON
before performing the restore:db2stop db2set DB2_RESTORE_GRANT_ADMIN_AUTHORITIES=ON db2start
-
I verified that the variable was set correctly:
db2set -all | grep -i db2_restore_grant
-
After the restore, I tried to grant
DBADM
authority to the userdb2inst1
:GRANT DBADM ON DATABASE TO USER db2inst1
However, I encountered the following error:
DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0552N "DB2INST1" does not have the privilege to perform operation "GRANT". SQLSTATE=42502
-
I checked the users with
DBADM
andSECADM
privileges:SELECT GRANTEE FROM SYSCAT.DBAUTH WHERE DBADMAUTH = 'Y';
SELECT GRANTEE FROM SYSCAT.DBAUTH WHERE SECURITYADMAUTH = 'Y';
Users with
DBADM
authority:DB2
,MARWEN
,AYMEN
.
Users withSECADM
authority:DB2
,ANYFRAME
.
Even though I am using a SECADM
user (DB2
or ANYFRAME
), I still encounter issues with granting DBADM
authority.
Any advice or suggestions on how to resolve this issue would be greatly appreciated!
Thanks in advance!
nada elouedi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.