Suggested schedule for gather statistics on sysadm
We have recently upgraded to 11.1.0.7 with psoft version 9.0 and tools 8.49 on sun solaris version 10. Currently we are running stats every night on all non work sysadm tables. I'm wondering if this is too much. We are seeing sql statements use different explain plans. For ex: one sql takes plan A and finishes in expected time. At some other point during the week that same sql will take plan B and will either never finish or take way too long.
So I'm curious to see how other folks are handling their statistics.
Other items of note:
we disabled the nightly oracle statistics job
our database is about 200 GB of used space
In any feedback is much appreciated.
Welcome to the forum!
Whenever you post provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION)
>
For example there is a table T1 with 25GB size (3 crores rows) and partitioned when i try generating statistics for a T1 table with below command it takes lots of time and i dont know what is the progress.
>
Your command will generate statistics for the entire table; that is, ALL partitions. Is that what you intended?
Sometimes partitioned tables have historical data in older partitions and a small number of ACTIVE partitions where the amount of data changes substantially. You could collect stats only on the partitions that have large data changes. The older, static partitions may not need frequent stat collections since the amount of data that changes is small.
If you are using 11g you could collect incremental statistics instead of global stats. Here is an article by Maria Colgan, an Oracle developer on the Optimizer team on stats.
https://blogs.oracle.com/optimizer/entry/how_do_i_compare_statistics
Similar Messages
-
How to reduce time for gather statistics for a table.
I have a table size 520 gb
Its one of the partition size is 38 gb
and total indexes of related table is 412 gb.
Server/instance details.
==========
56 cpu -> Hyper threading enable
280 gb ram
35 gb sga
27 gb buffer cache
4.5 gb shared pool size
25 gb pga
undo size 90gb
temp size 150 gb
Details :
exec dbms_stats.gather_table_stats('OWNER','TAB_NAME',PARTNAME=>'PART_NAME',CASCADE=>FALSE,ESTIMATE_PERCENT=>10,DEGREE=>30,NO_INVALIDATE=>TRUE);
when i am firing this in an ideal time when there is no load that time also is is taking 28 mins to complete.
Can anybody please reply me how can we reduce the stats gather time.
Thanks in advance,
Tapas Karmakar
Oracle DBA.Enable tracing to see where the time is going.
parallel 30 seems optimistic - unless you have a large number of discs to support the I/O ?
you haven't limited histogram collection, and most of the time spent of histograms may be wasted time - what histograms do you really need, and how many does Oracle analyse for and then discard ?
Using a block sample may help slightly
You haven't limited the granularity of the stats collection to the partition - the default is partition plus table, so I think you're also doing a massive sample on the table after completing the partition. Is this what you want to do, or do you have an alternative strategy for generating table-level stats.
Regards
Jonathan Lewis -
Hi folks!
I gathered statistcs in one schema with folowing options:
exec dbms_stats.gather_schema_stats(user,method_opt=>'FOR ALL COLUMNS SIZE 1',estimate_percent=>null,gather_temp=>false,cascade=>true,degree=>dbms_stats.auto_degree);Then:
exec dbms_stats.gather_schema_stats(user,method_opt=>'FOR ALL COLUMNS SIZE SKEWONLY',estimate_percent=>null,gather_temp=>false,cascade=>true,degree=>dbms_stats.auto_degree);Now, I turn on table monitoring and suggest to gather statistics (per day) with that parameters:
dbms_stats.gather_schema_stats(ownname =>user, options=>'GATHER STALE', gather_temp => false, cascade => true, estimate_percent => 100, degree => dbms_stats.auto_degree);Default method_opt is FOR ALL COLUMNS SIZE AUTO.
Now I got better perfomance. How often I need to gather statstics?
Thanks in advance.
Best regards, Pavel.Thanks, I also think so.
Little test-case:
SQL>exec dbms_stats.gather_table_stats(user,'TABLE1',estimate_percent=>null);
Elapsed: 00:00:01.03
SQL> select column_name,num_distinct,sample_size from user_tab_col_statistics where table_name='TABLE1;
COLUMN_NAME NUM_DISTINCT SAMPLE_SIZE
DISGRP 7944 33204
DISMBR 18948 33204
TYPE 4 33204
Elapsed: 00:00:00.03
SQL> exec dbms_stats.gather_table_stats(user,'TABLE1',estimate_percent=>10);
PL/SQL procedure successfully completed.
Elapsed: 00:00:01.78
SQL> select column_name,num_distinct,sample_size from user_tab_col_statistics where table_name='TABLE1';
COLUMN_NAME NUM_DISTINCT SAMPLE_SIZE
DISGRP 3836 3269
DISMBR 13686 3269
TYPE 4 3269
Elapsed: 00:00:00.00
SQL> exec dbms_stats.gather_table_stats(user,'TABLE1',estimate_percent=>100);
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.52
SQL> select column_name,num_distinct,sample_size from user_tab_col_statistics where table_name='TABLE1';
COLUMN_NAME NUM_DISTINCT SAMPLE_SIZE
DISGRP 7944 33204
DISMBR 18948 33204
TYPE 4 33204
Elapsed: 00:00:00.01
SQL> exec dbms_stats.gather_table_stats(user,'TABLE1',estimate_percent=>dbms_stats.auto_sample_size);
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.53
SQL> select column_name,num_distinct,sample_size from user_tab_col_statistics where table_name='TABLE1';
COLUMN_NAME NUM_DISTINCT SAMPLE_SIZE
DISGRP 8448 5568
DISMBR 18948 33204
TYPE 4 5568
Elapsed: 00:00:00.00
SQL> select count(distinct disgrp) from TABLE1;
COUNT(DISTINCTDISGRP)
7944
Elapsed: 00:00:00.02
SQL> select count(distinct dismbr) from TABLE1;
COUNT(DISTINCTDISMBR)
18948
Elapsed: 00:00:00.03
SQL> select count(distinct type) from TABLE1;
COUNT(DISTINCTTYPE)
4
Elapsed: 00:00:00.01
SQL> select column_name,num_distinct,sample_size from user_tab_col_statistics where table_name='TABLE2';
COLUMN_NAME NUM_DISTINCT SAMPLE_SIZE
ID 219120 219120
UNIT 114762 219120
LOC 61 219120
TIS 1230 219120
RTYP 3 219120
Elapsed: 00:00:00.02
SQL> exec dbms_stats.gather_table_stats(user,'TABLE2',estimate_percent=>null);
PL/SQL procedure successfully completed.
Elapsed: 00:00:07.61
SQL> select column_name,num_distinct,sample_size from user_tab_col_statistics where table_name='TABLE2';
COLUMN_NAME NUM_DISTINCT SAMPLE_SIZE
ID 219120 219120
UNIT 114762 219120
LOC 61 219120
TIS 1230 219120
RTYP 3 219120
Elapsed: 00:00:00.00
SQL> exec dbms_stats.gather_table_stats(user,'TABLE2',estimate_percent=>10);
PL/SQL procedure successfully completed.
Elapsed: 00:00:02.90
SQL> select column_name,num_distinct,sample_size from user_tab_col_statistics where table_name='TABLE2';
COLUMN_NAME NUM_DISTINCT SAMPLE_SIZE
ID 219950 21995
UNIT 70812 21995
LOC 43 21995
TIS 496 21995
RTYP 3 21995
Elapsed: 00:00:00.00
SQL> exec dbms_stats.gather_table_stats(user,'TABLE2',estimate_percent=>50);
PL/SQL procedure successfully completed.
Elapsed: 00:00:03.70
SQL> select column_name,num_distinct,sample_size from user_tab_col_statistics where table_name='TABLE2';
COLUMN_NAME NUM_DISTINCT SAMPLE_SIZE
ID 218716 109358
UNIT 92338 109426
LOC 61 109455
TIS 994 109567
RTYP 3 109422
Elapsed: 00:00:00.00
SQL> exec dbms_stats.gather_table_stats(user,'COMPS',estimate_percent=>100);
PL/SQL procedure successfully completed.
Elapsed: 00:00:04.37
SQL> select column_name,num_distinct,sample_size from user_tab_col_statistics where table_name='TABLE2';
COLUMN_NAME NUM_DISTINCT SAMPLE_SIZE
ID 219120 219120
UNIT 114762 219120
LOC 61 219120
TIS 1230 219120
RTYP 3 219120
Elapsed: 00:00:00.00
SQL> exec dbms_stats.gather_table_stats(user,'COMPS',estimate_percent=>dbms_stats.auto_sample_size);
PL/SQL procedure successfully completed.
Elapsed: 00:00:03.81
SQL> select column_name,num_distinct,sample_size from user_tab_col_statistics where table_name='TABLE2';
COLUMN_NAME NUM_DISTINCT SAMPLE_SIZE
ID 217968 54492
UNIT 122237 54492
LOC 31 5495
TIS 240 5495
RTYP 3 5495
Elapsed: 00:00:00.01
SQL> select count(distinct id) from TABLE2;
COUNT(DISTINCTID)
219120
Elapsed: 00:00:00.27
SQL> select count(distinct unit) from TABLE2;
COUNT(DISTINCTUNIT)
114762
Elapsed: 00:00:00.30
SQL> select count(distinct loc) from TABLE2;
COUNT(DISTINCTLOC)
61
Elapsed: 00:00:00.06
SQL> select count(distinct tis) from TABLE2;
COUNT(DISTINCTTIS)
1230
Elapsed: 00:00:00.09In that situation, auto_sample_size not bad? But estimate_percent=>100 - exact.
Best regards, Pavel. -
Needed Script for Gather Schema Stats
Hi
Well i need a script that monitors Gather Schema Schema stats is scheduled for coming week
In EBS this would be a con current request scheduled that i need to get the information ..
that script will run once in week and tell us that a GSS is scheduled on or else if its not scheduled it will give an alert as it is not schedule
please let me know
CheersHi Hussein,Alex
well thanks for your reply ....
but let me be more more clear what i need ...
below query
select ACTUAL_START_DATE, ACTUAL_COMPLETION_DATE,ROUND ( (ACTUAL_COMPLETION_DATE - ACTUAL_START_DATE)*1440) DURATION_MINS, REQUEST_ID, CONCURRENT_PROGRAM_ID from fnd_concurrent_requests where actual_start_date between to_date('4-Jun-12 00:00:00','dd-mon-yy hh24:mi:ss') and to_date('6-July-12 11:00:00','dd-mon-yy hh24:mi:ss')
and CONCURRENT_PROGRAM_ID in (select CONCURRENT_PROGRAM_ID from FND_CONCURRENT_PROGRAMS_TL where USER_CONCURRENT_PROGRAM_NAME LIKE 'Gather Schema Statistics') order by 5,1;
this give me output that between this date 4-june-12 to 6-July-12 is there any con current request ran for Gather Schema Stats...
this query will give me request_id,concurrent_program_id and all details...
like this i want to see that if any con current request is schedule in near future
let us for eg
this script will run on monday and it will pickup up the concurrent request telling for this week on this date GSS is schedule...
likewise i need ...
hope this give explanation what exact i need ..
Cheers........ -
How I gather statistics via OEM db control?
Hi,
According to the documentation,
I may setup a job to automatically
gather statistics for all the segments in my database
via EM database control.
I cant find any documentation on how to do this.
I did find a link in EM which will allow me
to gather statistics ad hoc but I want it automated.
Thanks,
-moiThere should be a stats gathering program scheduled
by default. Check under Database > Administration >
Scheduler > Jobs in Database Control. The job is called
SYS.GATHER_STATS_JOB. You will need to login as SYS to
see the job. The job runs the
DBMS_STATS.GATHER_DATABASE_STATS_JOB_PROC procedure.
You can, of course, schedule any other
DBMS_STATS.GATHER_* procedures if you prefer.
Hope this helps.
Kailash. -
Open Order scheduled for delivery
Hi there ,
Please suggest me the report to spool the Open Order scheduled for delivery for a material ....
Regards
KaushikHi
Check the delivery due list, its shows open orders due for delivery for a particular date
and the list can be printed or sent to spool
Anurag -
Automatic delivery schedule for Scheduling Agreement
Hi all...........
I like to create automatic delivery schedule both JIT & FRC schedules for Schedule agreement, means system has to suggest the schedule lines.
I created SA and creation profile, when Im trying to generate JIT schedule system showing "Error generating release against scheduling agreement (cause 2)".
Pls let me know wht configuration I hve to do and pls let me know all the steps.
I like to know output determination setting for SA releases also.
regards
Durga RamHi
'Propose all Items" is ticked so that MIGO proposes all the items irrespective of the delivery date and quantity. This means that even if the delivery date has not yet been reached or the complete qty has been received, the system will still allow you to do the GR.
Hope this clarifies.
Thanks -
MRP-Delivery Schedule for Sales order is not updating in Production order
Dear Experts,
I have created Sales order and maintained delivery scheduling, Then Run MRP through MD50,
We received Planned order then through this we have converted to Prodcution order.
When we observe the delivery schedule for sales order under assignment Tab in Produciton order which is showing zero instead showing line item of Delivery schedule.
I am able to see Sales order and Line item but i am not abel to get any delivery schedule line item.
Please suggest where settings are missing.
Thanks in advance
Regards
DonDear Experts,
Please provide me solution.
after Running MD50 transaction against Sales order.
If I maintained different Scheduling Line Item for First Line item of Sales order.
The Respective Scheduling Lines should update against Each Production order which has converted from Planned order.
Thanks in advance.
Regards
DON -
Schedule for del stock display even after delivery and goods receipt
Hi, Please suggest me for below scenario...
I have a scenario where we does STO and then delivery against outbound and performs goods receipt. in MMBE the stock is still displaying under schedule for delivery and also in MD04 even the stock is deducted from supplying plant and performed goods receipt at receiving plant..also stock is displaying at receiving plant..why the stock is still displaying in stock for del at sending plant..in general what happens when we does goods receipt against outbound delivery or when we does against STO?ok sir ;
No i don't talke abouat STP i don't have any transit stock it's a simpl sales based on global purchas
-first with me21n i created global purchas order
-the sales will be picked from this purchas .
-delivery is assigned automatically to this purchas order with user exit.
-with vl02n in goods issue steps there is tow operations ( stock mvt 101 in purchas assignement and a normal 601 for delivery ) -
Sending SOAP request from XI and writing a scheduler for this
Dear XI Experts,
My scenario is as follows.
We have two landscapes
1) XI, R/3
2) Client System(Remote, Other than SAP)
Now we have to pull the data from client system using WSDL (There will be one method for pulling the data in the WSDL file). The WSDL is provided by the client. We are importing that WSDL as external definition in Integration Repository and implementing the scenario SOAP to XI to RFC and configuring it Integration Directory.
Remember the client will not send the data to XI. Only we have to pull the data as mentioned above.
Problems:-
(i) How to send SOAP request to the client using XI only?
(ii) How to write a scheduler for this?
please help us.
Thanks...
Praveen GujjetiUr Suggestion
"My proposition looks like that. in R/3 you have scheduled RFC call in some program. This RFC calls XI and XI is calling using SOAP adapter your client. Then response go back to your RFC and you can handle this data."
As you mentioned, I am not scheduling any RFC call in R/3. If you go through my first query u can find two points where I am having some doubts......
How to send SOAP request to the client using XI only? Is it possible to send a SOAP request from XI?
If so,
(ii) How to write a scheduler for this? So that it will invoke the webservice and get the data from client application(system) -
Best practices for gathering statistics in 10g
I would like to get some opinions on what is considered best practice for gathering statistics in 10g. I know that 10g has auto statistics gathering, but that doesn't seem to be very effective as I see some table stats are way out of date.
I have recommended that we have at least a weekly job that generates stats for our schema using DBMS_STATS (DBMS_STATS.gather_schema_stats). Is this the right approach to generate object stats for a schema and keep it up to date? Are index stats included in that using CASCADE?
Is it also necessary to gather system stats? I welcome any thoughts anyone might have. Thanks.Hi,
Is this the right approach to generate object stats for a schema and keep it up to date? The choices of executions plans made by the CBO are only as good as the statistics available to it. The old-fashioned analyze table and dbms_utility methods for generating CBO statistics are obsolete and somewhat dangerous to SQL performance. As we may know, the CBO uses object statistics to choose the best execution plan for all SQL statements.
I spoke with Andrew Holsworth of Oracle Corp SQL Tuning group, and he says that Oracle recommends taking a single, deep sample and keep it, only re-analyzing when there is a chance that would make a difference in execution plans (not the default 20% re-analyze threshold).
I have my detailed notes here:
http://www.dba-oracle.com/art_otn_cbo.htm
As to system stats, oh yes!
By measuring the relative costs of sequential vs. scattered I/O, the CBO can make better decisons. Here are the data items collected by dbms_stats.gather_system_stats:
No Workload (NW) stats:
CPUSPEEDNW - CPU speed
IOSEEKTIM - The I/O seek time in milliseconds
IOTFRSPEED - I/O transfer speed in milliseconds
I have my notes here:
http://www.dba-oracle.com/t_dbms_stats_gather_system_stats.htm
Hope this helps. . . .
Don Burleson
Oracle Press author
Author of “Oracle Tuning: The Definitive Reference”
http://www.dba-oracle.com/bp/s_oracle_tuning_book.htm -
Scheduled for delivery quantity shouldnt be transffered to another plant
dear all,
we have a case in which we need to prevent scheduled for delivery quantity from being transferred to another plant.
the problem is that when creating a sales order and a delivery, and before the PGI,, the system allows moving the quantitity to another plant. and this causes a problem when trying to create a PGI ...
any suggestions pleasein the checking rule ( if stk transfer, you can get it from OLME> purchase order > create stock transport order ) incude reservations, deliveriies and sales order.
in assign del type and checking rule, you can find the checking rule used -
How to Gather Statistics of Tables and Indexes
Hi all,
Plz help me in Gathering Statistics of Tables and Indexes.
Thanksfor tables
exec dbms_stats.gather_table_stats('SCOTT', 'EMPLOYEES');
for indexes
exec dbms_stats.gather_index_stats('SCOTT', 'EMPLOYEES_PK');
check this link for detail
http://nimishgarg.blogspot.com/2010/04/oracle-dbmsstats-gather-statistics-of.html -
Drop down in the Input Schedule for Dimension
Hi Friends
In my input schedule, for the Dimension Entity ( I have 13 entities which i am presently chossing from Current View), i want to put separate Tab for each entity in my input schedule. So that instead of chossing from the current view, they will choose the TAB in the input Schedule.
And also, for another dimension members, i need to have a drop down ( as we do in excel validation). So instead of choosing the current view for that dimension, user will choose from the drop down from the excel sheet.
Looking forward to your suggestion .
Thanks
VivHi Shoba
Thanks for your reply.
See if we can use EVMBR function, which will Pop up the screen same as when we click the CV only thing is that the Current View will not change.
We can also use EVCVW is a particular cell same as the way EVMBR, but when we use this EVCVW, the Currrent View will also change fine
Exactly i am looking for a option where in a particular Input Schedule Cell, there will be a drop down as we do in normal excel validation, .
My Input Schedule is dynamic in Rows, which reflect the Material.
I am trying the EVLST, but efforts are in vain.
Looking forward
Reg
Viv -
Exclude Schema from Gather Statistics Job
I am using 11.1.0,7. I would like to know if we can exclude some schemas While Oracle automatically gathers the statistics.
Reason I want this is that, I have one database that supports multiple applications but as per one application's demand we should not be gathering stats on it's schema. So, in totality I have 20 Schemas but while this jobs run, I want to exclude 2 schemas that this application supports.
Locking the Stats for these schemas is not an option.
Thanks!Have you enquired from the vendor exactly why they do not want you to gather statistics on it's schema?
Is there other options they are willing to consider like baselining the explain plan or perhaps not publishing the statistics to the tables...using the pending statistics feature?
Exec dbms_stats.set_table_prefs('SH', 'CUSTOMERS', 'PUBLISH', 'false');
Regards
Tim Boles
Edited by: Tim Boles on Aug 4, 2010 11:11 AM
Maybe you are looking for
-
Anyone have any idea's on this error message when I run my JAVA Code: Error Below. The thing is if I use a internal E-mail TO: address the mail and attachement is send. This only happens when I try to send a letter outside the firms MS Exchange serve
-
Why does my ipod touch take an hour to restore?
There's nothing I've really added to it (no videos, etc) to fill it up, but every time I try to restore it takes forever. I have several other ipods and have never had this problem before. Kate
-
Creating Debit memo with running sequence
HI , I am creating steel surch debit memo from my report (VA01 Transaction order type zdr1),there is one condition if net value GE selection screen value only that time i should commit the sales order,Now if condition is not matching BAPI_SALESDOCU_
-
DMVPN: HUB's behind a LoadBalancer and Spoke-Spoke communication
Hallo, we are planning a scaling DMVPN network for around 2000 spokes. Is it possible to install the HUB's behind a Load Balancer so that they are reachable only through 1 VIP address and ALSO the possibility of a direkt spoke-spoke communication whe
-
[CS5][JS] Add Glyph for special 'e' characters?
Hello, I've got an InDesign script that adds text to a text frame like so: myTextFrame.insertionPoints[-1].contents = ' The café...'; The problem is that InDesign renders the acute accent 'e' character incorrectly and inserts other special characters