Check Stale Statistics in Oracle

Find the Table and Index for Stale Statistics

Check the Table Stale Statistics

Column table_name for a30
select LAST_ANALYZED,STATTYPE_LOCKED,table_name from dba_tab_statistics where owner='SCOTT' and stale_stats ='YES';

OR 

select owner,table_name,STALE_STATS,STATTYPE_LOCKED
from dba_tab_statistics where owner='&SCHEMA_NAME' and
table_name='&TABLE_NAME';

Find the Index Stale Statistics

select owner,INDEX_NAME,TABLE_NAME,STALE_STATS from DBA_IND_STATISTICS where owner='&SCHEMA_NAME' and
index_name='&INDEX_NAME';

OR

select LAST_ANALYZED,index_name,STALE_STATS from dba_ind_statistics where owner='SCOTT' and stale_stats ='YES';
This entry was posted in Oracle on by .
Unknown's avatar

About SandeepSingh

Hi, I am working in IT industry with having more than 15 year of experience, worked as an Oracle DBA with a Company and handling different databases like Oracle, SQL Server , DB2 etc Worked as a Development and Database Administrator.

Leave a Reply