Oracle批量建立同义词
建立表同义词
select 'create or replace synonym 目的地用户.'|| table_name ||' for 源用户.'|| table_name ||';' from all_tables where owner = '源用户';
create or replace synonym WDRC.ACT_GE_BYTEARRAY for WDIM.ACT_GE_BYTEARRAY;
create or replace synonym WDRC.ACT_GE_PROPERTY for WDIM.ACT_GE_PROPERTY;
create or replace synonym WDRC.ACT_RE_DEPLOYMENT for WDIM.ACT_RE_DEPLOYMENT;
给表同义词赋权,操作方式同上
select 'grant select, insert, update, delete on 源用户.'|| table_name ||' to 目的地用户;' from all_tables where owner = '源用户';