Get recent DDL for Oracle table in different schemas

I am trying to find the time of the last DDL statement that was applied to the table.

I found this solution:

Select OBJECT_NAME, LAST_DDL_TIME From user_objects Where OBJECT_NAME='MY_TABLE' 

The problem is that I want to check this for a table that does not belong to my schema.

Any suggestion please

+6
source share
1 answer

Assuming you have permissions, you just need to request the ALL_OBJECTS or DBA_OBJECTS , i.e.

 SELECT object_name, object_type, last_ddl_time FROM dba_objects (or all_objects) WHERE owner = <<owner of table>> AND object_name = 'MY_TABLE' 

ALL_OBJECTS contains information about all the objects for which you have privileges (i.e., tables for which you can at least select SELECT). DBA_OBJECTS contains information about all objects in the database, whether you have permission to access them or not. However, access to the DBA_OBJECTS requires additional privileges.

+12
source

Source: https://habr.com/ru/post/891427/


All Articles