DBA_SYNONYMS
All synonyms in the database
Name | Datatype | Length | Mandatory | Comments |
---|---|---|---|---|
OWNER | VARCHAR2 | (30) | Yes | Username of the owner of the synonym |
SYNONYM_NAME | VARCHAR2 | (30) | Yes | Name of the synonym |
TABLE_OWNER | VARCHAR2 | (30) | Owner of the object referenced by the synonym | |
TABLE_NAME | VARCHAR2 | (30) | Yes | Name of the object referenced by the synonym |
DB_LINK | VARCHAR2 | (128) | Name of the database link referenced in a remote synonym |
Usage:
cursor cur_synonym(c_name in dba_objects.object_name%type
, c_owner in dba_objects.owner%type) is
SELECT TABLE_OWNER
, TABLE_NAME
, DB_LINK
FROM SYS.DBA_SYNONYMS
where OWNER = c_owner
and SYNONYM_NAME = c_name;