"You
are the people who are shaping a better world. One of the
secrets of inner peace is the practice of compassion."
-Dalai
Lama (1935 -)
|
What is the best option
to used in dbms_stats in order to get the most accurate statistics
within a schema?
To rebuild all statistics
to all the tables and indexes and building up all histograms, you
should do the following:
SQL>
EXECUTE dbms_stats.gather_schema_stats(
ownname
=> 'Username',
method_opt => 'FOR ALL INDEXED COLUMNS SIZE AUTO',
cascade=>TRUE);
But if you want to let Oracle decide which statistices are to be
rebuild, you should the following statment:
SQL>
EXECUTE dbms_stats.gather_schema_stats(
ownname
=> 'Username',
options => 'GATHER AUTO', -- for Oracle8i use GATHER only
cascade=>TRUE);
|