Script to Show Analyzed Tables with Un-Analyzed Indexes

SET SERVEROUTPUT ON
SET ECHO OFF
SET FEEDBACK ON
SET PAGES 80
SET LINES 132

REM
REM || Title : show_anal_incons.sql
REM ||
REM || Purpose : List analyzed tables with un-analyzed indexes
REM ||
REM ||
REM || Release No : 1
REM ||
REM || Variables : None
REM ||
REM || Schema : system
REM ||


SELECT 'Index ' || i.index_name || ' not analyzed but table ' || i.table_name || ' is.'
FROM user_tables t,
user_indexes i
WHERE t.table_name = i.table_name
AND t.num_rows IS NOT NULL
AND i.distinct_keys IS NULL

SPOOL show_anal_incons.lis
/
SPOOL off


SET SERVEROUTPUT ON
SET ECHO OFF

This script is provided for educational purposes only. The script has been tested and appears to work as intended. However, you should always test any script before relying on it. No responsibility will be accepted for Lost or damage that may occur from it's use.