Q
Problem solve Get help with specific problems with your technologies, process and projects.

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

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.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close