使用 Oracle,如何从 systables/information_schema 中找到索引名称和创建日期?
如何从 systables/information_schema 重现创建索引的 DDL,例如,create index indexname on tablename(column_name [, column_name....]) [local];
使用 Oracle,如何从 systables/information_schema 中找到索引名称和创建日期?
如何从 systables/information_schema 重现创建索引的 DDL,例如,create index indexname on tablename(column_name [, column_name....]) [local];
查询 DBA_OBJECTS 或 ALL_OBJECTS 的创建日期:
select created from dba_objects where object_type = 'INDEX' and object_name='XXX';
更多关于它的信息:
查询all_objects 或 dba_objects以获取有关索引的信息。
这应该可以获取索引 DDL:
select dbms_metadata.get_ddl('INDEX','DEPT_IDX','SCOTT') from dual;
基于这两个响应(我想将两者都标记为最佳答案),这将获得所有索引的 DDL:
select '/*' || created || '*/' || dbms_metadata.get_ddl('INDEX',object_name)
from dba_objects
where object_type = 'INDEX'
order by created, object_name;