0

I want to export the different privileges in a DB2 9.7 database as DDL.

I found the following in the documentation: https://www.ibm.com/support/knowledgecenter/SSEPGG_9.8.0/com.ibm.db2.luw.admin.gui.doc/doc/t0021930.html

Authorization statements: Generates SQL authorization (GRANT) statements for the database objects.

When I try to issue the command

db2look -d DatabaseName -u user

I get the following error:

SQL0552N  "USER1" does not have the privilege to perform operation 
"BIND".  SQLSTATE=42502

When I try to give DBADM to the user1, I get the following error:

db2 "GRANT DBADM ON DATABASE TO USER USER1"

DB21034E  The command was processed as an SQL statement because it was not a valid Command Line Processor command.
During SQL processing it returned:
SQL4707N  Workload "SYSDEFAULTUSERWORKLOAD" cannot service the request
because the workload is not allowed to access the database or is disabled.
Reason code: ""  SQLSTATE=5U020

I face this problem after restoring the database from a backup.

3
  • By "importing the database from a dump" do you actually mean restoring it from a backup? If so, is the instance owner on the server where the backup was taken different from the one where you did a restore?
    – mustaccio
    Mar 29, 2016 at 15:56
  • Yes, I modified the question.
    – Entomo
    Mar 29, 2016 at 16:01
  • No it is the same. I think this is related though: www-01.ibm.com/support/docview.wss?uid=swg21568865 I am trying it at the moment.
    – Entomo
    Mar 29, 2016 at 16:02

1 Answer 1

0

It seems that https://www-01.ibm.com/support/docview.wss?uid=swg21568865 did the trick:

db2set DB2_RESTORE_GRANT_ADMIN_AUTHORITIES=ON

Allows the instance user to execute the command.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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