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 first published in May 2007

Dig deeper on Oracle database performance problems and tuning

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

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.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close