REM list of the unusable index,index partition,index subpartition in Database Select owner, index_name, status From dba_indexes where status = 'UNUSABLE' and owner not in ('SYS','SYSTEM', 'SYSMAN', 'EXFSYS', 'WMSYS', 'OLAPSYS', 'OUTLN', 'DBSNMP', 'ORDSYS', 'ORDPLUGINS', 'MDSYS', 'CTXSYS', 'AURORA$ORB$UNAUTHENTICATED', 'XDB', 'FLOWS_030000', 'FLOWS_FILES') order by 1, 2 / select index_owner, index_name, partition_name from dba_ind_partitions where status ='UNUSABLE' and index_owner not in ('SYS', 'SYSTEM', 'SYSMAN', 'EXFSYS', 'WMSYS', 'OLAPSYS', 'OUTLN', 'DBSNMP', 'ORDSYS', 'ORDPLUGINS', 'MDSYS', 'CTXSYS', 'AURORA$ORB$UNAUTHENTICATED', 'XDB', 'FLOWS_030000', 'FLOWS_FILES') order by 1,2 / Select Index_Owner , Index_Name , partition_name , SUBPARTITION_NAME From DBA_IND_SUBPARTITIONS Where status = 'UNUSABLE' and index_owner not in ('SYS', 'SYSTEM', 'SYSMAN', 'EXFSYS', 'WMSYS', 'OLAPSYS', 'OUTLN', 'DBSNMP', 'ORDSYS', 'ORDPLUGINS', 'MDSYS', 'CTXSYS', 'AURORA$ORB$UNAUTHENTICATED', 'XDB', 'FLOWS_030000', 'FLOWS_FILES') order by 1, 2 /
Script:列出失效索引或索引分区
原创maclean_007 ©著作权
文章标签 Oracle 数据库 partition Oracle索引index Oracle脚本script 文章分类 Oracle 数据库
-
Script:列出没有主键或唯一索引的表
以下脚本可以用于列出数据库中没有主键的表,已排除了系统schema:REM List tables with no primary keySELECT owner, table_name FROM dba_tables WHERE 1 = 1 AND owner NOT IN ('SYS', 'SYSTEM',
key index primary unique constraint Oracle脚本script