Search code examples
oracle-databaseddlsynonym

How to get the created / last DDL time for an Oracle synonym?


SQL Developer shows the creation and last DDL time for a public synonym in a table:

CREATED         15-AUG-09
LAST_DDL_TIME   15-AUG-09
OWNER           PUBLIC
SYNONYM_NAME    ISEMPTY
TABLE_OWNER     MDSYS
TABLE_NAME      OGC_ISEMPTY
DB_LINK     (null)

How can I get the same information via a SQL query?

select *  from all_synonyms where synonym_name = 'ISEMPTY'

does not get the created/last ddl dates.

More generally, is there a good way to see the queries that sql developer uses to display the data it displays (when you do not have access to a profiler)? Thanks


Solution

  • You need the ALL_OBJECTS system view:

    select *
      from all_objects
     where owner = 'OWNER_NAME'
       and object_name = 'ISEMPTY'
       and object_type = 'SYNONYM'