oracle 批量生成建同義詞語句和付權語句

--批量建立同義詞

--建立表同義詞
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 = '源用戶';

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章