请问oracle中的同义词是何意思?

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

相当于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.

Published At
Categories with 数据库类
Tagged with
comments powered by Disqus