# 问题内容:请问oracle中的同义词是何意思?
# 原讨论链接:http://community.csdn.net/expert/topicview1.asp?id=1803303
# 所属论坛:基础和管理     审核组:Oracle
# 提问者:taozabc     解决者:hrb_qiuyb
# 感谢:hrb_qiuyb、yuanscar
# 关键字:
# 答案:

又有什么作用呢?
---------------------------------------------------------------

相当于alias(别名),比如把user1.table1在user2中建一个同义词table1
create synonym table1 for user1.table1;
这样当你在user2中查select * from table1时就相当于查select * from user1.table1;
优点自己总结吧。
---------------------------------------------------------------

A synonym is an alias for a schema object. Synonyms can provide a level of ecurity
by masking the name and owner of an object and by providing location transparency for remote objects of a distributed database. Also, they are convenient to use and reduce the complexity of SQL statements for database users.
Synonyms allow underlying objects to be renamed or moved, where only the synonym needs to be redefined and applications based on the synonym continue to function without modification.
You can create both public and private synonyms. A public synonym is owned by
the special user group named PUBLIC and is accessible to every user in a database.
A private synonym is contained in the schema of a specific user and available only
to the user and the user’s grantees.

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐