Get names of all synonyms from Oracle database

Get names of all synonyms from Oracle database

To get names of all synonyms from Oracle database or from an specific table you can use: USER_SYNONYMS, ALL_SYNONYMS, DBA_SYNONYMS, USER_OBJECTS.

Examples

  
SELECT * FROM USER_SYNONYMS;

SELECT * FROM USER_SYNONYMS 
WHERE TABLE_OWNER='SYSTEM' AND TABLE_NAME='TEST';

SELECT * FROM ALL_SYNONYMS;

SELECT * FROM ALL_SYNONYMS 
WHERE TABLE_OWNER='SYSTEM' AND TABLE_NAME='TEST';

SELECT * FROM DBA_SYNONYMS;

SELECT * FROM DBA_SYNONYMS 
WHERE TABLE_OWNER='SYSTEM' AND TABLE_NAME='TEST';

SELECT * FROM USER_OBJECTS WHERE OBJECT_TYPE='SYNONYM';

SELECT * FROM USER_OBJECTS 
WHERE OBJECT_TYPE='SYNONYM' AND ORACLE_MAINTAINED='N';