Friday, August 2, 2019

Tell me something about synonyms?

Synonyms

It is one of the Database object.
Synonyms is the alias name for table, views, sequences & procedures and are created for reasons of Security and Convenience.

Simplify access to objects by creating a synonym (another name for an object).

Refer to a table owned by another user.

Shorten lengthy object names.

Synonyms are 2 types:

Public: any database user can access public synonym.created by DBA & accessible to all the users.
Private: Only its owner can access this synonym.Accessible to creator only.

Syntax:

CREATE [PUBLIC] SYNONYM <synonym_name> FOR <object_name>;

DROP SYNONYM <synonym_name>;

Advantages :

are referencing without specifying the owner and Flexibility to customize a more meaningful naming convention.

It is used to hide original name and owner of the Table.

It provides security by hiding identity of the component.

Desc , DML and Select are allowed.

DML on Table are reflected in synonym and DML on synonym are reflected in Table.

It will not hold data.

It is stored permanently in "user_synonyms"system table.

SELECT * FROM USER_SYNONYMS
SELECT * FROM ALL_SYNONYMS
SELECT * FROM DBA_SYNONYMS
SELECT * FROM ALL_OBJECTS WHERE OBJECT_NAME=<SYNONYM_NAME>;

No comments:

Post a Comment

AME (Approval Management Engine)

AME (Approval Management Engine) : AME Stands for Oracle Approval Management Engine. AME is a self service web application that enables...