iSelfSchooling.com  Since 1999     References  |  Search more  | Oracle Syntax  | Free Online Oracle Training

    Home      .Services     Login       Start Learning     Certification      .                 .Share your BELIEF(s)...

 

. Online Accounting        .Copyright & User Agreement   |
    .Vision      .Biography     .Acknowledgement

.Contact Us      .Comments/Suggestions       Email2aFriend    |

 

Online Oracle Training for beginners and advanced - The most comprehensive Oracle tutorial

The authors do not guarantee or take any responsibility for the accuracy, or completeness of the information.

 

 

 

 

 

 

 

Lesson 30

"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);