开发者

Get last DDL time for Oracle table in different Schema

开发者 https://www.devze.com 2023-03-15 19:36 出处:网络
I am trying to find the time of the last DDL statement that has been applied on a table. I found this soluti开发者_运维知识库on:

I am trying to find the time of the last DDL statement that has been applied on a table.

I found this soluti开发者_运维知识库on:

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

The problem is: I want to check this for a table which doesn't belong to my Schema.

Any suggestion please


Assuming you have permissions, you would just need to query the ALL_OBJECTS or DBA_OBJECTS view, 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 has information about all the objects that you have privileges on (i.e. the tables you can at least SELECT from). DBA_OBJECTS has information about all the objects in the database whether you have permission to access them or not. However, access to the DBA_OBJECTS view requires additional privileges.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号