获取不同模式中 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
Get last DDL time for Oracle table in different Schema
提问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_OBJECTS
or DBA_OBJECTS
view, i.e.
假设您有权限,您只需要查询ALL_OBJECTS
或DBA_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_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.
ALL_OBJECTS
有关于您拥有特权的所有对象的信息(即您至少可以从中选择的表)。 DBA_OBJECTS
拥有有关数据库中所有对象的信息,无论您是否有权访问它们。但是,访问DBA_OBJECTS
视图需要额外的权限。