1. 程式人生 > >oracle同義詞

oracle同義詞

table sco all for acl grant synonyms rop p s

--私有同義詞
--私有同義詞權限
grant create synonym to scott;
--創建私有同義詞
create synonym dp for scott.dept;
--將查詢dept的權限授予qjt這個用戶
GRANT SELECT ON dept to QJT


--公有同義詞
--公有同義詞權限
grant create PUBLIC synonym to scott;
--創建公有同義詞
create PUBLIC synonym dpp for scott.dept;
--將查詢dept的權限授予public角色。
GRANT SELECT ON dept TO PUBLIC;
--在qjt模式下訪問公有同義詞
SELECT * from dpp

--查看同義詞
SELECT * FROM SYS.ALL_SYNONYMS WHERE table_NAME=‘DEPT‘

--刪除私有同義詞
drop synonym dp

--刪除公有同義詞權限
GRANT DROP PUBLIC synonym TO SCOTT
--刪除公有同義詞
drop PUBLIC synonym dpp

oracle同義詞