我这边的一般做法是:1、创建一个与 schema 相对应的角色 ROLE12、将该 schema 中的所有表的 select 或 insert 或 update 或 delete等特权赋予到这个角色 ROLE1 3、将角色 ROLE1 赋予需要的普通用户...
hadr备库只读功能目前存在replay only window的情况,即对某些主库上的操作,如DDL,reorg,runstats等,备库上的连接会被中断,当退出replay only window后,备库才允许新的数据库连接。可以考虑在replay only window期间临时将只读数据库连接切换到主库上。可以通过db2dsdriver.cfg...
写个脚本呗,怕麻烦可以这样:db2 -z grant.sql -x "select 'GRANT SELECT ON TABLE '||tabname||'TO USER USERNAME' from syscat.tables where tabschema='SCHEMA'"db2 -tvf grant.sql
db2 -x "select 'grant select on table '||trim(tabschema)||'.'||trim(tabname)||' to user DB2READ;' from syscat.tables where type='T' " > grant_select.sqldb2 -tvf grant_select.sql