Solved

Oracle Table Analyze

Posted on 2003-11-19
8
3,829 Views
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.
0
Comment
Question by:vishalgoyal123
  • 3
  • 2
8 Comments
 
LVL 47

Accepted Solution

by:
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.
0
 
LVL 13

Expert Comment

by:anand_2000v
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.
0
 
LVL 23

Assisted Solution

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

Use "ANALYZE TABLE <table_name> ESTIMATE STATISTICS SAMPLE n PERCENT"
OR
"ANALYZE TABLE <table_name> ESTIMATE STATISTICS SAMPLE n ROWS"

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
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 13

Expert Comment

by:anand_2000v
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.
0
 
LVL 23

Expert Comment

by:seazodiac
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.

0
 
LVL 13

Expert Comment

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

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need help with Oracle syntax 4 56
Oracle SQL Select within a Where Clause 9 56
Queries 15 34
'G_F01' is not a procedure or is undefined 3 12
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
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.
Via a live example, show how to take different types of Oracle backups using RMAN.

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now