TESTUSERB 仅能对TESTUSERA 用户下的某些表增删改查、有些表仅能对某些列update,查询TESTUSERB 用户权限,获取批量赋予语句。
select 'grant '|| PRIVILEGE ||' to TESTUSERB;' from dba_sys_privs where GRANTEE='TESTUSERB' ;
select 'grant '|| PRIVILEGE ||' on TESTUSERA.'||TABLE_NAME||' to TESTUSERB;' from dba_tab_privs where GRANTEE='TESTUSERB' and PRIVILEGE='SELECT';
select 'grant UPDATE ('||COLUMN_NAME||') ON TESTUSERA.'||TABLE_NAME||' TO TESTUSERB;;' from dba_col_privs where GRANTEE='TESTUSERB' and PRIVILEGE='UPDATE';