Oracle Table Analyze

Posted on 2003-11-19
Last Modified: 2008-04-20
I have one big table containing 10,00,000 records.
When i analyze this table the system hangs.
Is there any problem with SGA Size.

The same table if i analyze in other database with double SGA size it takes onle 3-4 minutes but it does not hang.
How i can speed up this tables's analyzing process.
Question by:vishalgoyal123
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 48

Accepted Solution

schwertner earned 125 total points
ID: 9779016
It shouldnot hang. If the SGA is small then it will take longer time to analyze. You should be patient and wait. Try to analyze through OEM - it will show you if it works.
LVL 13

Expert Comment

ID: 9779255
10,00,000 records will take some time if your SGA is not big enough. See if you can increase the SGA. Better still use the stats pack to analyze the table.
LVL 23

Assisted Solution

seazodiac earned 125 total points
ID: 9779312
I think the correct way to get around the SGA problem is that


By doing this, you avoid the analysis of the whole 1 million records, CBO also get an overall estimate of statistics as well.

give it a try , see if this command will speed up your analysis
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 13

Expert Comment

ID: 9779371
Estimate, IMHO, will cause more problems than solve. I have seen situations wherein a *compute* results in avoidance of usage on index and resultant *speeding of access* and
a *estimate* still going for the index access.

Of course every situation is unique.
LVL 23

Expert Comment

ID: 9780157
anand_2000v, what you said about "estimate" is NOT true:

If no sample size is provided when estimating statistics with the ANALYZE command, Oracle will take a default sample size of the first 1064 rows. This may not be effective and most often will result in bad queries. But If the ESTIMATE sample size is greater than 50%, it is as good as the COMPUTE option, but you get shorter analyze time by skipping the rest of records.

LVL 13

Expert Comment

ID: 9780973
oh...I thought that estimate by default uses 20% !!!! 1064 rows....thanx for the info

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question