?
Solved

analyze tables

Posted on 2009-05-07
13
Medium Priority
?
934 Views
Last Modified: 2013-12-19
For analyzing tables analyze table table_name estimate sample 10 percent.WHat is best value for givng sample percent. All my tbales have million records. The reason for this asking this let me explain my case. We will run conversion run job which we will insert 7 million records from staging to targert tables. This will take 1.5 days to complete(as we have many rules to load data into target tables).In between for every 5 hrs i need to stop job and analyze tables and restart again so that job runs faster.we have 40 tables to analyze.I dont want tto waste more time (sat 30-60mmin) for analyzing these tables.Appreciate your help regartding this.
0
Comment
Question by:vamsibat
[X]
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
  • 4
  • 4
  • 2
  • +1
13 Comments
 
LVL 18

Expert Comment

by:sventhan
ID: 24330326
Is it 10g or 9i?
0
 

Author Comment

by:vamsibat
ID: 24330423
its 10G
0
 
LVL 18

Expert Comment

by:sventhan
ID: 24330692
what is your statistics_level set to?
sql> show parameter statistics_level
If its typical or ALL then you're already analyzing those tables.
0
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 

Author Comment

by:vamsibat
ID: 24330817
statistics_level  is typical
0
 
LVL 18

Accepted Solution

by:
sventhan earned 1000 total points
ID: 24330896
> i need to stop job and analyze tables and restart again so that job runs faster
Why do you analyze those tables in between the job runs? Is there anychanges to the schema causing you to do that?
Check with your last analyzed column on those tables in dba_tables view. You'll find the recent dates the table got analyzed.
0
 

Author Comment

by:vamsibat
ID: 24331134
The reason for analyzing tables in between is this job populates those tables i.e. before starting those tables will have 0 records.after job starts say after 4 hrs those tables will be populated with some laks records so statistics changes so proc is running slow.for that reson i am analyzing tables in between.

I posted a differrnt questiona and you are taking me to some other route.my question what sholud be best number for giving sample percent.
0
 
LVL 18

Expert Comment

by:sventhan
ID: 24331238
I know.
I've seen estimates as low as 5% - 10% be effective.  
Its all depends upon your data in that particular table and how much time you want to save. In order to  estimate the table's percentage is how much of the actual table should be looked intto collect the statistics, the common sense is being the larger the sample the more accurate the statistics should be. Overall, the estimate is smaller the statstics generation should be faster so there's a tradeoff between how fast and how through the estimates are. Computed statistics (use 100% of the rows) are probably best but usually take too much time to generate.




0
 
LVL 32

Expert Comment

by:awking00
ID: 24339298
Are you analyzing the staging or target tables?
0
 

Author Comment

by:vamsibat
ID: 24339326
I am analyzing both staging and target
0
 
LVL 74

Assisted Solution

by:sdstuber
sdstuber earned 1000 total points
ID: 24346517
The reason you're having trouble getting the answer you want to hear is there is no single "best" number.  If there was, then Oracle wouldn't have it be a parameter at all, it would simply be a fixed number built into the process.

You can try using the automatic sampling and let Oracle determine how many rows to estimate.
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 24567366
I recommend split 24330896 and 24346517
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows how to recover a database from a user managed backup
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
Suggested Courses

762 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