获取不同模式中 Oracle 表的最后一次 DDL 时间

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6490027/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 03:22:46  来源:igfitidea点击:

Get last DDL time for Oracle table in different Schema

oracle

提问by Hany

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

我试图找到已应用于表的最后一个 DDL 语句的时间。

I found this solution:

我找到了这个解决方案:

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

任何建议请

回答by Justin Cave

Assuming you have permissions, you would just need to query the ALL_OBJECTSor DBA_OBJECTSview, i.e.

假设您有权限,您只需要查询ALL_OBJECTSDBA_OBJECTS查看,即

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_OBJECTShas information about all the objects that you have privileges on (i.e. the tables you can at least SELECT from). DBA_OBJECTShas information about all the objects in the database whether you have permission to access them or not. However, access to the DBA_OBJECTSview requires additional privileges.

ALL_OBJECTS有关于您拥有特权的所有对象的信息(即您至少可以从中选择的表)。 DBA_OBJECTS拥有有关数据库中所有对象的信息,无论您是否有权访问它们。但是,访问DBA_OBJECTS视图需要额外的权限。