Wednesday, February 6, 2008

Gather Table Statistics (8i,9i,10g,11g)

From 10G and up this is far more better: begin dbms_stats.gather_schema_stats( ownname=>; 'MYSCHEMA' , cascade=>; TRUE, estimate_percent=>; 5, block_sample=>; TRUE, degree=>; null, no_invalidate=>; DBMS_STATS.AUTO_INVALIDATE, granularity=>; 'ALL', method_opt=>; 'FOR ALL INDEXED COLUMNS SIZE SKEWONLY', options=>; 'GATHER AUTO'); end; / For 8i and 9i Use begin dbms_stats.gather_table_stats(ownname=>;'OWNER',tabname=>;'TABLE_NAME' ,cascade=>;true,estimate_percent=>;5); end; /

1 comment: