Search This Blog

Thursday, December 22, 2011

Create schema statistics using DBMS_STATS

dbms_stats.gather_schema_stats
(
ownname=>'HR',
cascade=>TRUE, ---Indexes are included
method_opt=>'FOR ALL INDEXED COLUMNS',--Create Histograms
estimate_percent => dbms_stats.auto_sample_size, --Takes Sample size for the tables and Indexes
degree => 2 --Parallel degree 2
);