V9.7数据库恢复到另一个实例的权限问题

最近在v9.7的db2inst1下面创建了个数据库testdb
然后做了个备份,又创建了个实例db2inst2,在这个实例下对testdb做了个重定向恢复

恢复后一切都好用,db2inst2在用call get_dbsize_info的时候报错,然后准备重新绑定一下st_admin.bnd,但是报没有权限。。。
以前一直用v9.5,实例用户组用户权限大过天啊,这次第一次碰到没有权限

进一步get authorizations,发现比db2inst1少一个权限direct的dbadm权限

想赋给自己dbadm权限,居然说db2inst2没有grant的权限。。。

学习了下v97权限管理,发现多了个secadm,但是需要sysadm组外用户才能被赋予这个用户。觉得很麻烦

所以想问下,现在一般怎么做?特别是一个数据库恢复到另一个实例下时,是否有选项可以让另一个实例像创建数据库的原实例一样拥有各种权限?
参与6

5同行回答

zhangzongjunzhangzongjun数据库管理员IBM
db2set DB2_RESTORE_GRANT_ADMIN_AUTHORITIES=ON可解决显示全部
db2set DB2_RESTORE_GRANT_ADMIN_AUTHORITIES=ON
可解决收起
软件开发 · 2014-03-08
浏览1270
wencycoolwencycool数据库管理员山东
回复 3# ysgift     查询 syscat.dbauth查看以前的权限信息,然后用db2inst1登录将权限付给db2inst2。显示全部
回复 3# ysgift


    查询 syscat.dbauth查看以前的权限信息,然后用db2inst1登录将权限付给db2inst2。收起
互联网服务 · 2014-03-07
浏览1153
wolaos123wolaos123项目经理澳美制药
不能说违反你的习惯就是不好的东西,就是麻烦效率和安全天生一对矛盾体显示全部
不能说违反你的习惯就是不好的东西,就是麻烦
效率和安全天生一对矛盾体收起
医院 · 2014-03-06
浏览1171
ysgiftysgift数据库管理员招商银行
先建个db这种很麻烦啊。。。 感觉db2这里没有考虑好现在已经回不去了,我用之前的实例用户,给现在的实例用户赋予了dbadm和secadm的权限,也勉强能用了显示全部
先建个db这种很麻烦啊。。。 感觉db2这里没有考虑好

现在已经回不去了,我用之前的实例用户,给现在的实例用户赋予了dbadm和secadm的权限,也勉强能用了收起
银行 · 2014-03-06
浏览1234
wencycoolwencycool数据库管理员山东
这个你要先把数据库在db2inst2上创建好,然后在恢复覆盖就可以了。参考如下:When restoring to an existing database, the restore utility performs the following actions:Deletes table, index, and long field data from the existing database and replaces it with d...显示全部
这个你要先把数据库在db2inst2上创建好,然后在恢复覆盖就可以了。
参考如下:
When restoring to an existing database, the restore utility performs the following actions:

Deletes table, index, and long field data from the existing database and replaces it with data from the backup image.
Replaces table entries for each table space that you are restoring.
Retains the recovery history file unless it is damaged or has no entries. If the recovery history file is damaged or contains no entries, the database manager copies the file from the backup image. If you want to replace the recovery history file, you can issue the RESTORE DATABASE command with the REPLACE HISTORY FILE parameter.
Retains the authentication type for the existing database.
Retains the database directories for the existing database. The directories define where the database is located and how it is cataloged.
Compares the database seeds. If the seeds are different, the utility performs the following actions:
Deletes the logs that are associated with the existing database.
Copies the database configuration file from the backup image.
Sets the NEWLOGPATH parameter for the RESTORE DATABASE command to the value of the logpath database configuration parameter if you specified the NEWLOGPATH parameter.
If the database seeds are the same, the utility performs the following actions:
Deletes all log files if the image is for a non-recoverable database.
Deletes empty log files if the image is for a recoverable database. Non-empty log files are not affected.
Retains the current database configuration file.
Sets the NEWLOGPATH parameter for the RESTORE DATABASE command to the value of the logpath database configuration parameter if you specified the NEWLOGPATH parameter. Otherwise, the utility copies the current log path to the database configuration file. Validates the log path. If the database cannot use the path, the utility changes the database configuration to use the default log path收起
互联网服务 · 2014-03-06
浏览1211

提问者

ysgift
数据库管理员招商银行
擅长领域: 系统运维智能化运维

相关问题

相关资料

相关文章

问题状态

  • 发布时间:2014-03-06
  • 关注会员:1 人
  • 问题浏览:6329
  • 最近回答:2014-03-08
  • X社区推广