Oracle批量建立同义词
2017-08-03 本文已影响0人
sweetMemories
Oracle批量建立同义词
建立表同义词
- 1.查询建立语句
select 'create or replace synonym 目的地用户.'|| table_name ||' for 源用户.'|| table_name ||';' from all_tables where owner = '源用户';
- 2.将sql运行结果复制,然后运行,比如:
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 = '源用户';