--批量建立同义词

--建立表同义词
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 = '源用户';