Solved

analyze tables

Posted on 2009-05-07
13
932 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
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!

 

Author Comment

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

Accepted Solution

by:
sventhan earned 250 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 250 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

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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
exp/imp 25 101
upgrading Oracle 10g/ 11g / 11g R2 to Oracle 12c 25 89
Oracle - Query link database loop 8 55
Migration from SQL server to oracle (XML input) 4 54
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…
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 explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
Via a live example, show how to take different types of Oracle backups using RMAN.

726 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