Q

Using DBMS_STATS to generate statistics in Oracle 10g

I need to know the best way to generate statistics within an Oracle 10g database. I read that using dbms_stats is better than using compute command.

I need to know the best way to generate statistics within a database (Oracle 10g 10.1.0.5). I read that using DBMS_STATS is better than using compute command. So, I need the exact syntax to do it. Thanks.
If you are using Oracle 9i or 10g, then DBMS_STATS is the only way to go to generate optimizer statistics. You can generate statistics for your entire database with the following in SQL*Plus:
exec dbms_stats.gather_database_stats(estimate_percent=>
DBMS_STATS.AUTO_SAMPLE_SIZE);
There are other gather programs as well. They are all documented here.
This was last published in May 2007

Dig Deeper on Oracle database performance problems and tuning

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close