Oracle:从systables/information_schema中查找索引创建日期?

7

使用Oracle,我如何从systables/information_schema中查找索引名称和创建日期?

我应该如何从systables/information_schema中复制DDL来创建索引,例如:create index indexname on tablename(column_name [, column_name....]) [local];

3个回答

13

从DBA_OBJECTS或ALL_OBJECTS查询创建日期:

select created from dba_objects where object_type = 'INDEX' and object_name='XXX';

更多信息请点击这里查看:


如果对象位于您自己的模式中,则可以使用USER_OBJECTS解决权限问题。 - Mat M

6

1

结合两个回答(我想将它们都标记为最佳答案),这将获取所有索引的DDL:

select '/*' || created || '*/' || dbms_metadata.get_ddl('INDEX',object_name) 
from dba_objects 
where object_type = 'INDEX' 
order by created, object_name;

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接