--批量建立同義詞
--建立表同義詞
select 'create or replace synonym 目的地用戶.'|| table_name ||' for 源用戶.'|| table_name ||';'
from all_tables where owner = '源用戶';
--給表同義詞賦權
select 'grant select, insert, update, delete on 源用戶.'|| table_name ||' to 目的地用戶;'
from all_tables where owner = '源用戶';