新博客http://www.cnblogs.com/zhjh256 欢迎访问
分类: Oracle
2007-12-27 10:16:12
-- Description : Displays unusable indexes for the specified schema or all schemas.
-- Requirements : Access to the DBA views.
-- Call Syntax : @unusable_indexes (schema-name or all)
SET VERIFY OFF
SELECT owner,
index_name
FROM dba_indexes
WHERE owner = DECODE(UPPER('&1'), 'ALL', owner, UPPER('&1'))
AND status NOT IN ('VALID', 'N/A')
ORDER BY owner, index_name;