Saturday, 27 June 2015

To Gather Stale Stats

sql
set pages 2000
set linesize 200
set heading off
set feedback off
select 'exec fnd_stats.gather_table_stats(ownname =>'''||owner||''',tabname =>'''||table_name||''',percent => 30, cascade => TRUE);'
from dba_tab_statistics where stale_stats='YES'
and owner not in ('SYS','SYSTEM','TRCANLZR','OLAPSYS','XDB')
and table_name not like 'BIN%' order by 1;

No comments:

Post a Comment