Quantcast
Channel: Doyensys Allappsdba Blog..
Viewing all articles
Browse latest Browse all 1640

Script to analyze all table and index partitions individually

$
0
0
set feed off echo off head off trimspool on line 500

spool /tmp/analyze$$.sql

select 'ANALYZE TABLE '||table_owner||'.'||table_name||' partition ('||
partition_name||') estimate statistics;'
from sys.dba_tab_partitions
/

select 'ANALYZE INDEX '||index_owner||'.'||index_name||' partition ('||
partition_name||') estimate statistics;'
from sys.dba_ind_partitions
/

spool off

set feed on
@/tmp/analyze$$.sql
! rm /tmp/analyze$$.sql

Viewing all articles
Browse latest Browse all 1640

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>