仅提供一个思路
授权user2可以访问user1的所有表
select 'grant select on USER1.' || table_name || ' to user2;' from dba_tables where owner='USER1'
授权user2可以访问user1的所有序列
select 'grant select on USER1.' || sequence_name || ' to user2;' from dba_sequences where sequence_owner='USER1'
user2批量创建user1的所有表名的同义词
select 'create synonym user2.'|| table_name || ' for USER1.' || table_name || ';' from dba_tables where owner='USER1'
授权user2可以访问user1的所有表
select 'grant select on USER1.' || table_name || ' to user2;' from dba_tables where owner='USER1'
授权user2可以访问user1的所有序列
select 'grant select on USER1.' || sequence_name || ' to user2;' from dba_sequences where sequence_owner='USER1'
user2批量创建user1的所有表名的同义词
select 'create synonym user2.'|| table_name || ' for USER1.' || table_name || ';' from dba_tables where owner='USER1'
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30126024/viewspace-2126804/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/30126024/viewspace-2126804/