Missing Optimizer Statistics

ELECT ‘TABLE’ object_type, owner, table_name object_name, last_analyzed, stattype_locked, stale_stats FROM all_tab_statistics WHERE (last_analyzed IS NULL OR stale_stats = ‘YES’) AND stattype_locked IS NULL AND owner NOT IN (‘ANONYMOUS’, ‘CTXSYS’, ‘DBSNMP’, ‘EXFSYS’, ‘LBACSYS’, ‘MDSYS’, ‘MGMT_VIEW’, ‘OLAPSYS’, ‘OWBSYS’, ‘ORDPLUGINS’, ‘ORDSYS’, ‘OUTLN’, ‘SI_INFORMTN_SCHEMA’, ‘SYS’, ‘SYSMAN’, ‘SYSTEM’, ‘TSMSYS’, ‘WK_TEST’, ‘WKSYS’, ‘WKPROXY’, ‘WMSYS’, ‘XDB’) AND owner NOT LIKE ‘FLOW%’ UNION … Read more

How To Save Database Statistics Before They Are Updated

Step-by-step guide Exporting statistics is a three step process. The result is a single table containing schema statistics (table, index and column) and system statistics (workload and non-workload). The first step creates a physical version of a StatTable. The StatTable is a consolidated table to hold all types of statistics, so the format is very … Read more