从备份还原数据库后的授权错误

时间:2016-03-29 15:32:10

标签: db2 authorization database-restore db2-luw

我想将DB2 9.7数据库中的不同权限导出为DDL。

我在文档中找到了以下内容: https://www.ibm.com/support/knowledgecenter/SSEPGG_9.8.0/com.ibm.db2.luw.admin.gui.doc/doc/t0021930.html

  

授权语句:为数据库对象生成SQL授权(GRANT)语句。

当我尝试发出命令时

db2look -d DatabaseName -u user

我收到以下错误:

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

当我尝试将DBADM提供给user1时,我收到以下错误:

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

从备份恢复数据库后,我遇到了这个问题。

1 个答案:

答案 0 :(得分:0)

似乎https://www-01.ibm.com/support/docview.wss?uid=swg21568865 做了诀窍:

db2set DB2_RESTORE_GRANT_ADMIN_AUTHORITIES=ON

允许实例用户执行命令。