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    |

 

What is the best option to used in dbms_stats in order to get the most accurate statistics within a schema?

More Resources by Google:

By: John Kazerooni

 

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

Good Luck!

 

Google
 
Web web site