--私有同義詞
--私有同義詞權限
grant create synonym to scott;
--建立私有同義詞
create synonym dp for scott.dept;
--將查詢dept的權限授予qjt這個用戶
GRANT SELECT ON dept to QJTtable
--公有同義詞
--公有同義詞權限
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 dptab
--刪除公有同義詞權限
GRANT DROP PUBLIC synonym TO SCOTT
--刪除公有同義詞
drop PUBLIC synonym dppant