Monday 17 October 2011

What is Synonym Different types of synonyms

A synonym is a name assigned to a table or a view may thereafter be used to refer it. Creating a synonym does not grant any privileges on referenced objects it just provides at alternative name for objects.
Synonyms can be either private or public. A public synonym is owned by the special user group PUBLIC; every user of a database can access it. A private synonym is in the schema of a specific user, who has control over its availability to others. Individual users can see only the public synonyms and their private synonyms.
A view is a look on a table's data with restrictions or specific data - a subset of the table's data.
A synonym is a way to share any object from your scheme with other schemes.
A synonym is created to avoid using the user object standard while calling to other scheme objects.
Any privilege you have on the object, will affect the synonym if you grant select only - no insert or update is allowed using synonym (a synonym is a pointer to an object).
A view is just a stored query. So any user with the appropriate privileges can query, insert, update, and delete the data. The synonym is a pointer to the base table itself. So any user with the appropriate privileges can query, insert, update, delete the data, and also perform DDL on the base table, such as adding/dropping columns. Of course, all that can be controlled by properly managing privileges anyway.

No comments:

Post a Comment