Db2 – How to i give SECADM to instance owner in DB2

db2permissions

i'm using db2 9.7 on linux and created a user "db2fee1i" to be a instance owner. I restored a database, but even being SYSADM i only can connect to database. I need to give DATAACCESS to another user, and even doing a query appears…

The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it
returned: SQL0551N "DB2FEE1I" does not have the required authorization
or privilege to perform operation "EXECUTE" on object
"NULLID.SQLC2H23". SQLSTATE=42501

I tryed everything but nothing solves my problem, now i found "SECADM" that can give me the "privileges to execute" into database, but i dont know how to do it. Someone can help me?!

Best Answer

Under 9.7, whichever ID creates the database is automatically granted DBADM WITH DATAACCESS WITH ACCESSCTRL and SECADM.

So you should be able to log in to the databases with that ID to perform the grants you need. If this came from another environment, you may have to create the ID locally in order to get into the database. Only an ID with SECADM can grant SECADM to another ID. And also with 9.7, you cannot GRANT to or REVOKE from yourself.

Now...as to your problem.....when you do not have EXECUTE on a NULLID package, then you may either need to perform a BIND of the appropriate bind file, or grant EXECUTE on that package. If it is a system package that pretty much everyone can use, you can always GRANT EXECUTE ON PACKAGE NULLID.SQLC2H23 TO PUBLIC.