What is synonym and how do we create synonym?
- Table references can be complicated. So oracle allows you create synonym for a complicated reference.
- It renames a table reference.
- Use the CREATE SYNONYM statement to create a synonym, which is an alternative name for a table, view, sequence, procedure, stored function, package, materialized view, Java class schema object, user-defined object type, or another synonym.
- Synonyms provide both data independence and location transparency.
- Synonyms permit applications to function without modification regardless of which user owns the table or view and regardless of which database holds the table or view.
- However, synonyms are not a substitute for privileges on database objects.
- Appropriate privileges must be granted to a user before the user can use the synonym.
Syntax:CREATE SYNONYM syn_name FOR reference;
- This object can be a table, procedure, sequence or any other database object.
- A synonym is a Data Dictionary object.