Auto stats collection in 11g
In 11g, automatic optimizer statistics collection is one of the automated maintenance tasks which is enabled by default. On the other hand, gather_stats_job shows 'disabled' in dba_scheduler_jobs. Does it mean that we do not need to enable the gather_stats_job as we did in 10g?
In 11g, automatic optimizer statistics collection is one of the automated maintenance tasks which is enabled by default. On the other hand, gather_stats_job shows 'disabled' in dba_scheduler_jobs. Does it mean that we do not need to enable the gather_stats_job as we did in 10g?
Similar Messages
-
Is 11g auto stats collection automatic on? where can I find this job?
Is 11g auto stats collection automatic on?
I manually created a 11g database, but I did not see auto stats collection job. where can I find this job? or how could I verify this is on?
Thank you.Found in Automated Maintenance Tasks.
-
Auto Stats Collection on function based indexes
In 10g does AUTO Stats Collection job in the default weeknight / weekend window collect stats on "function based indexes".
Thank You
Message was edited by:
user449511
I got the reply in another similar post posted by me some time earlier.
Thank You
Message was edited by:
user449511SELECT job_name, comments
FROM dba_scheduler_jobs;Then refine your search using the columns in the view. -
Comments on "Auto" Stats collection practice in 10g
We going to implement auto stat collection practice in our production env. Can someone on this forum comment on the results / experiences ? As per Tom Kytes he is sceptical on going with this practice because it uses AUTO method_opt option which actually can result in different stats being collected based on column usage and data distribution.
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:52288431326913.
Thank YouHi
Can someone on this forum comment on the results / experiences ?As for any "automatic feature" it works fine in many situations but not always. You have to test it to know if in your situation it is usable or not. IMHO it makes sense to give it a try...
can result in different stats being collected based on column usage
and data distribution.This is the purpose of AUTO. So, no news here.
HTH
Chris -
10g Automatic Stats Collection -- AUTO ( METHOD_OPT)
I have implememted Oracle 10g Auto Stats collection feature. To generate new stats on 10g optimizer I deleted the schema stats and then scheduled the DBMS_SCHEDULER to collect stats in AUTO method_opt.
I see that the new 10g optimizer is collecting stats differently in different databases eben through they have the same data.
For exampl I see that it collected Histograms on 10 columns in one table in one environment but it generatd histograms only on 9 columns in another env.
I am concerned that the stats difference will result in the execution plan getting changed across different instances.
Can someone please clarify the cause of the same. How can I make sure tha the 10g optimizer is collecting stats uniformly across different envs.
Thank YouYou wrote:
"I am concerned that the stats difference will result in the execution plan getting changed across different instances."
and you should be concerned.
I would recommend not collecting stats the way you are but rather to use a nuanced approach where you collect only when they are stale or only when you know that changes have rendered old statistics invalid. -
Auto optimizer stats collection enabled, but not running and not showing up
I enabled auto optimizer stats collection days ago, but it never ran. DB version is 11gr2, OS is redhat 5. It shows enabled in dba_autotask_client, but not in autotask_task. Please help on this issue.
SQL> select client_name, status from dba_autotask_client;
CLIENT_NAME STATUS
auto optimizer stats collection ENABLED
auto space advisor DISABLED
sql tuning advisor ENABLED
SQL> select task_name, status, to_char(last_good_date, 'YYYY-MM-DD HH24:MI:SS') last_good_date, last_good_duration
from dba_autotask_task
where client_name = 'auto optimizer stats collection'; 2 3
no rows selected
SQL> select program_action, number_of_arguments, enabled
from dba_scheduler_programs
where owner = 'SYS'
and program_name = 'GATHER_STATS_PROG'; 2 3 4
PROGRAM_ACTION NUMBER_OF_ARGUMENTS ENABL
dbms_stats.gather_database_stats_job_proc 0 TRUE
SQL> select w.window_name, c.autotask_status, c.optimizer_stats, w.repeat_interval, w.enabled
-- , w.duration, w.last_start_date, w.next_start_date
2 from dba_autotask_window_clients c , dba_scheduler_windows w
3 4 where c.window_name = w.window_name
5 order by last_start_date desc;
WINDOW_NAME AUTOTASK OPTIMIZE REPEAT_INTERVAL ENABL
MONDAY_WINDOW ENABLED ENABLED freq=daily;byday=MON;byhour=22;byminute=0; bysecond=0 TRUE
SUNDAY_WINDOW ENABLED ENABLED freq=daily;byday=SUN;byhour=6;byminute=0; bysecond=0 TRUE
SATURDAY_WINDOW ENABLED ENABLED freq=daily;byday=SAT;byhour=6;byminute=0; bysecond=0 TRUE
FRIDAY_WINDOW ENABLED ENABLED freq=daily;byday=FRI;byhour=22;byminute=0; bysecond=0 TRUE
THURSDAY_WINDOW ENABLED ENABLED freq=daily;byday=THU;byhour=22;byminute=0; bysecond=0 TRUE
WEDNESDAY_WINDOW ENABLED ENABLED freq=daily;byday=WED;byhour=22;byminute=0; bysecond=0 TRUE
TUESDAY_WINDOW ENABLED ENABLED freq=daily;byday=TUE;byhour=22;byminute=0; bysecond=0 TRUE
7 rows selected.
SQL>SQL> select max(last_analyzed) from all_tables where owner='ARAD';
MAX(LAST_
26-SEP-12 -
Stats collection running long in 11g
Oracle11.2.0.1
Sun Solaris.
Stats collection running long for almost 12 hours from 6PM to 6AM daily and stats collection autotask is getting STOPPED after the window duration.
DBA_TABLES.last_analyzed is not getting updated after 2AM in the morning. I believe it is scanning some big tables, but not able to pin point the table/index.
And we've some a bunch of 100GB tables in the DB. Is there a way to find out which table it's gathering stats between 2AM and 6AM and not getting completed?
Thanks for your time!moreajays wrote:
Hi,
I would suggest to find out those tables with huge Table & last_analyzed is Null , these tables would be possible tables responsible for long run.
Only AWR ot other SQL Hist stats tables can help you to get details.
To fix this issue you should run stats gathering manually in day time (not in maintenance window) either with auto stats or with little estimate_percent (10 or 5)
After getting first successful analyze (manually) , maintenance stats will pick up new incremental stats thereafter
Ajay,
I don't think that your statement that after the gathering the statistics manually, it would be next done incrmentally is correct. The incremental statistics are introduced only for partitioned tables AFAIK. Can you post a link from the documentation that your mentioned behavior exists?
Aman.... -
'auto optimizer stats collection' in em12cr3
During installation of EM 12cR3 the OUI noted to 'disable stats gathering job', and indicated it would disable for me.
After installation I look at dba_auto_task and see that 'auto optimizer stats collection' is enabled.
The install docs Overview of the EM Prerequisite Kit also say to disable this for the install and upgrade.
What is not clear to me is: "is this only for the install/upgrade? should the collection be enabled after the install is complete?"Hi Sherrie,
auto optimizer stats needs to be disable only during install and upgrade of 12c cloud control
Once its done you can enable the auto optimizer stats collection at Repos DB level
Regards,
Rahul -
Auto optimizer stats collection interval
Hi,
I have a question about "auto optimizer stats collection" in 11gR2.
I see on the history, 1 execution of "auto optimizer stats collection" on Monday, Tuesday, Wenesday, Thursday and Friday and 5 executions on Saturday and Sunday.
I find the duration of each window (4 hours on Mon, Tue, Wen, Thu and Friday, 20 hours on Sat and Sun) and start date (22 hour Mon, Tue, Wen, Thur and Friday and 6h on Sat and Sun), but i don't find the interval between executions or frenquency of execution for each window.
Someone can tell me, if is it possible to change this and where ?
Regards,Thank's for all reply, but it's not the answer of my question.
I know how disable/enable automatic task, i know to add/delete window, etc ... but where can i configure the frequency or interval of the "auto optimizer stats collection" task.
I try to explain what i want to know.
By defaut, on window Mon, Tue, Wen, Thu and Fri, the task start at 22:00 and run once, the window duration is 4 hours. Why one run ?
On window Sat and Sun, the task start à 6:00 and run 5 times ( 6:00, 10:00, 14:00, 18:00 and 22:00), the window duration is 20 hours. Why 5 runs ? or why 4 hours between 2 runs ?
Regards -
Regarding stats collection in oracle 11g.
Just a general question, while doing stats collection weather system takes the backup of current statistics. i think we can specify stattab. but weather it takes stats backup before over writing?
I got this requirement as a part of upgrade, i have already gone through export_schema_stats and import_schema stats already. Just trying all other possible options only...
Regards
DBA.DBA wrote:
Just a general question, while doing stats collection weather system takes the backup of current statistics. i think we can specify stattab. but weather it takes stats backup before over writing?
backup to where exactly? -
Hi All,
In 10g, Oracle automatically collects the statistics between 10 to 6 night window. I am just curious about what estimate_percent it takes for this. I mean when we do manual stats gathering by following command, it takes 20 percent for estimation:
exec dbms_stats.gather_table_stats(ownname=>'scott',estimate_percent=>20, method_opt=>'FOR ALL INDEXED COLUMNS SIZE 1',degree=>7, cascade=>true,granularity=>'all');
I am gathering the stats by above command for some of my schemas. Now, I want to rely on auto stats gathering feature of Oracle 10g. So I want to know the estimate_percent taken by Oracle.
Thanks,
Api14.3.1.1 Statistics Gathering Using Sampling
The statistics-gathering operations can utilize sampling to estimate statistics. Sampling is an important technique for gathering statistics. Gathering statistics without sampling requires full table scans and sorts of entire tables. Sampling minimizes the resources necessary to gather statistics.
Sampling is specified using the ESTIMATE_PERCENT argument to the DBMS_STATS procedures. While the sampling percentage can be set to any value, Oracle Corporation recommends setting the ESTIMATE_PERCENT parameter of the DBMS_STATS gathering procedures to DBMS_STATS.AUTO_SAMPLE_SIZE to maximize performance gains while achieving necessary statistical accuracy. AUTO_SAMPLE_SIZE lets Oracle determine the best sample size necessary for good statistics, based on the statistical property of the object. Because each type of statistics has different requirements, the size of the actual sample taken may not be the same across the table, columns, or indexes. For example, to collect table and column statistics for all tables in the OE schema with auto-sampling, you could use:
EXECUTE DBMS_STATS.GATHER_SCHEMA_STATS('OE',DBMS_STATS.AUTO_SAMPLE_SIZE);
When the ESTIMATE_PERCENT parameter is manually specified, the DBMS_STATS gathering procedures may automatically increase the sampling percentage if the specified percentage did not produce a large enough sample. This ensures the stability of the estimated values by reducing fluctuations. -
Stats collection issue on 11.2
Hello all,
we have a oracle 11.2.0.3 enterprise edition database has auto optimizer stats collection is enabled
but does not collect any stats, I tried to disable and enable the task with same result,
database is been up for a month now,
no rows listed in DBA_AUTOTASK_CLIENT_HISTORY, DBA_AUTOTASK_schedule,DBA_AUTOTASK_TASK
statistics_level is set to typical,
is there anything else I could check,
Any help is appreciated,
Thanks,
Redrred wrote:
Hello all,
we have a oracle 11.2.0.3 enterprise edition database has auto optimizer stats collection is enabled
but does not collect any stats, I tried to disable and enable the task with same result,
database is been up for a month now,
no rows listed in DBA_AUTOTASK_CLIENT_HISTORY, DBA_AUTOTASK_schedule,DBA_AUTOTASK_TASK
statistics_level is set to typical,
is there anything else I could check,
Any help is appreciated,
Thanks,
Red
SQL> show parameter queue
NAME TYPE VALUE
job_queue_processes integer 1000
SQL> select job_name from dba_scheduler_jobs;
JOB_NAME
XMLDB_NFS_CLEANUP_JOB
SM$CLEAN_AUTO_SPLIT_MERGE
RSE$CLEAN_RECOVERABLE_SCRIPT
FGR$AUTOPURGE_JOB
BSLN_MAINTAIN_STATS_JOB
DRA_REEVALUATE_OPEN_FAILURES
HM_CREATE_OFFLINE_DICTIONARY
ORA$AUTOTASK_CLEAN
FILE_WATCHER
PURGE_LOG
MGMT_STATS_CONFIG_JOB
JOB_NAME
MGMT_CONFIG_JOB
RLM$SCHDNEGACTION
RLM$EVTCLEANUP
POSPAY_CHECK_JOB
15 rows selected.
SQL> -
Hi,
I am using 11.1.0.7 on IBMAIX Power based 64 bit system.
In 10g, if i query dba_scheduler_jobs view, i see the GATHER_STATS_JOB for automated statistics collection but in 11g i don't see this rather i see BSLN_MAINTAIN_STATS_JOB job which executes BSLN_MAINTAIN_STATS_PROG program for stats collection.
And if i query DBA_SCHEDULER_PROGRAMS, i also see GATHER_STATS_PROG program here. Can gurus help me understanding both in 11g. Why there are two different programs and what is the difference?
Actually the problem is that i am receiving following error message in my alert log file
Mon Aug 16 22:01:42 2010
GATHER_STATS_JOB encountered errors. Check the trace file.
Errors in file /oracle/diag/rdbms/usgdwdbp/usgdwdbp/trace/usgdwdbp_j000_1179854.trc:
ORA-00054: resource busy and acquire with NOWAIT specified or timeout expiredThe trace files shows
*** 2010-08-14 22:10:14.449
*** SESSION ID:(2028.20611) 2010-08-14 22:10:14.449
*** CLIENT ID:() 2010-08-14 22:10:14.449
*** SERVICE NAME:(SYS$USERS) 2010-08-14 22:10:14.449
*** MODULE NAME:(DBMS_SCHEDULER) 2010-08-14 22:10:14.449
*** ACTION NAME:(ORA$AT_OS_OPT_SY_3407) 2010-08-14 22:10:14.449
ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
*** 2010-08-14 22:10:14.450
GATHER_STATS_JOB: GATHER_TABLE_STATS('"DWDB_ADMIN_SYN"','"TEMP_HIST_HEADER_LIVE"','""', ...)
ORA-00054: resource busy and acquire with NOWAIT specified or timeout expiredBut we dont have GATHER_STATS_JOB in 11g and also the job BSLN_MAINTAIN_STATS_PROG runs only on weekend and the above error message came last night 16 August.
Thanks
SalmanThanks for the people who are contributing.
I know from the information that table is locked, but i have tried manually locking a table and executing gather_table_stats procedure but it runs fine. Here i have two questions
Where is GATHER_STATS_JOB in 11g as you can see the text of trace file where it says that GATHER_STATS_JOB failed, i dont see there is any GATHER_STATS_JOB in 11g.
BSLN_MAINTAIN_STATS_JOB job is supposed gather statistics but only on weekend nights, then how come i see this error occurring last night at 22:11 on 16th August which is not a week end night.
Salman -
Runtime increased after stats collection
Hi,
Below is my SQL query
SELECT wos.*,
t.wo_status,
t.wo_type
FROM cscrpt_transactions t,
(SELECT DISTINCT sb.sub_acct_no_sbb,
sb.vip_flg_sbb,
sb.res_name_sbb,
sb.home_phone_sbb,
sb.delq_1cyc_sbb,
sb.delq_2cyc_sbb,
sb.delq_3cyc_sbb,
sb.delq_4cyc_sbb,
sb.delq_5cyc_sbb,
sb.delq_stat_sbb,
sb.delq_amt_sbb,
sb.ls_pay_dte_sbb,
sb.ls_pay_amt_sbb,
sb.misc_sbb,
hb.misc_hse,
TRUNC(SYSDATE) - sb.start_delq_dte_sbb days_delq,
sb.prom_pays_days_sbb,
sb.start_delq_dte_sbb,
sb.prom_pays_dte_sbb,
ca.category_name,
ct.wo_key,
cc.customer_id
FROM sbb_base sb,
hse_base hb,
cscrpt_customers cc,
cscrpt_transactions ct,
cscrpt_categories ca
WHERE sb.ext_stat_sbb = ' '
AND sb.prin_sbb <> 3000
AND sb.prin_sbb <> 3100
AND sb.delq_stat_sbb NOT IN ('C', 'E', 'Z', 'W')
AND sb.delq_amt_sbb > 10.00
AND ( sb.delq_2cyc_sbb > 0.00
OR sb.delq_3cyc_sbb > 0.00
OR sb.delq_4cyc_sbb > 0.00
OR sb.delq_5cyc_sbb > 0.00)
AND sb.sub_acct_no_sbb = hb.sub_acct_no_hse
AND sb.sub_acct_no_sbb = cc.csg_account_no
AND cc.customer_id = ct.customer_id
AND ct.category_id = ca.category_id) wos
WHERE wos.wo_key = t.wo_key
AND t.wo_key = (SELECT MAX(tr.wo_key)
FROM cscrpt_transactions tr
WHERE tr.customer_id = wos.customer_id)
ORDER BY wos.start_delq_dte_sbb DESC,
wos.delq_2cyc_sbb;Stats for the base tables of the views used
(v)sbb_base – 24,791,659 rows, stats 12/28/07
(v)hse_base – 25,270,280 rows, stats 12/28/07
(v)cscrpt_customers – 20,418,167 rows, stats 10/10/04
(v)cscrpt_transactions – same as for customers
(t)cscrpt_categories – 14,524 rows, stats 10/10/04(v)-View, (t)-table. Rowcount and last date when stats were collected.
Below is the execution plan:
4286 rows selected.
Elapsed: 01:02:39.07
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=236008 Card=1 Bytes=
386)
1 0 SORT (ORDER BY) (Cost=236001 Card=1 Bytes=386)
2 1 FILTER
3 2 FILTER
4 3 NESTED LOOPS (OUTER)
5 4 HASH JOIN (Cost=235998 Card=1 Bytes=365)
6 5 VIEW (Cost=198149 Card=987557 Bytes=335769380)
7 6 SORT (UNIQUE) (Cost=198149 Card=987557 Bytes=2
24175439)
8 7 FILTER
9 8 HASH JOIN (Cost=181816 Card=987557 Bytes=2
24175439)
10 9 TABLE ACCESS (FULL) OF 'CSCRPT_CATEGORIE
S' (Cost=6 Card=6803 Bytes=292529)
11 9 FILTER
12 11 HASH JOIN (OUTER)
13 12 HASH JOIN (Cost=163701 Card=894900 B
ytes=145868700)
14 13 HASH JOIN (Cost=129012 Card=360796
Bytes=49429052)
15 14 HASH JOIN (Cost=68118 Card=32221
6 Bytes=35121544)
16 15 TABLE ACCESS (FULL) OF 'CSCRPT
CUSTOMERSTAB' (Cost=9302 Card=317965 Bytes=6677265)
17 15 TABLE ACCESS (FULL) OF 'SBB_BA
SE_TAB' (Cost=55749 Card=2397901 Bytes=211015288)
18 14 TABLE ACCESS (FULL) OF 'HSE_BASE
_TAB' (Cost=48688 Card=23936080 Bytes=670210240)
19 13 TABLE ACCESS (FULL) OF 'CSCRPT_TRA
NSACTIONS_TAB' (Cost=17313 Card=35912894 Bytes=933735244)
20 12 VIEW OF 'CSCRPT_CUSTOMERS_ALL_VW' (C
ost=9302 Card=15978119 Bytes=335540499)
21 20 TABLE ACCESS (FULL) OF 'CSCRPT_CUS
TOMERS_TAB' (Cost=9302 Card=15978119 Bytes=335540499)
22 8 COUNT (STOPKEY)
23 22 TABLE ACCESS (BY INDEX ROWID) OF 'ACCOUN
T_TYPE_SPA' (Cost=2 Card=1 Bytes=18)
24 23 INDEX (RANGE SCAN) OF 'ACCOUNT_TYPE_SP
A_UK01_I' (UNIQUE) (Cost=2 Card=1)
25 5 TABLE ACCESS (FULL) OF 'CSCRPT_TRANSACTIONS_TAB'
(Cost=17313 Card=35912894 Bytes=897822350)
26 4 VIEW PUSHED PREDICATE OF 'CSCRPT_CUSTOMERS_ALL_VW'
(Cost=1 Card=1 Bytes=21)
27 26 TABLE ACCESS (BY INDEX ROWID) OF 'CSCRPT_CUSTOME
RS_TAB' (Cost=2 Card=1 Bytes=21)
28 27 INDEX (UNIQUE SCAN) OF 'CSCRPT_CUSTOMERS_PK' (
UNIQUE) (Cost=2 Card=1)
29 2 SORT (AGGREGATE)
30 29 FILTER
31 30 NESTED LOOPS (OUTER)
32 31 TABLE ACCESS (BY INDEX ROWID) OF 'CSCRPT_TRANSAC
TIONS_TAB' (Cost=5 Card=5 Bytes=110)
33 32 INDEX (RANGE SCAN) OF 'CSCRPT_TRANSACTIONS_N3'
(NON-UNIQUE) (Cost=3 Card=5)
34 31 VIEW PUSHED PREDICATE OF 'CSCRPT_CUSTOMERS_ALL_V
W' (Cost=1 Card=1 Bytes=21)
35 34 FILTER
36 35 TABLE ACCESS (BY INDEX ROWID) OF 'CSCRPT_CUS
TOMERS_TAB' (Cost=2 Card=1 Bytes=21)
37 36 INDEX (UNIQUE SCAN) OF 'CSCRPT_CUSTOMERS_P
K' (UNIQUE) (Cost=2 Card=1)
Statistics
4519 recursive calls
2 db block gets
64793132 consistent gets
2936560 physical reads
0 redo size
536683 bytes sent via SQL*Net to client
2920 bytes received via SQL*Net from client
287 SQL*Net roundtrips to/from client
78 sorts (memory)
0 sorts (disk)
4286 rows processedI am in the process of getting stats for the ones which were collected in 2004.
I am thinking as the plan shows some FTS steps for those views (base tables for which stats were collected in 2004) and as there are indexes on those tables, the plan might change after stats collection.
I appreciate your inputs in this.
Thanks
Rajiv
Message was edited by:
RajivTx
Message was edited by:
RajivTxI am trying the INDEX hint
INDEX(table [index]) Forces an index scan of the specified table using the specified index(s). If a list of indexes is specified, the optimizer chooses the one with the lowest cost. If no index is specified then the optimizer chooses the available index for the table with the lowest cost.
I am confused whether I need to use the above hint or
/*+ hint(view_name.table_in_view) */
as I have views in the FROM clause.
Thanks
Rajiv -
Hi,
I am using oracle 9i. when I ran refresh for some tables , I found that statistics collection was also running for those tables simultaneously and query performance is poor. however , last_analyzed column in user_tables was updated.
Could you please let me know whether refresh skips stats collection if both are running in parlell ?
Thanks!Please define your terms so we can help you.
1. What does refresh mean? Is this a DML statement, Streams? SQL*Loader? DataPump?
Surely you don't expect that we can help you by guessing?
2. What is your version number ... 9i is not a version number.
SELECT * FROM v$version;3. If both what are running in parallel?
Please provide clarity so someone can help you.
Maybe you are looking for
-
Colour for a Paticular row in alv grid,based on condition
Hi Master's. I want to display a paticular row in my alv_grid based on my condition a diffrent colour. The Entire row ? Regards, Abhisek
-
Since I upgraded to Mavericks, my Maxtor external Hard drive does not work. It is FireWire to Thunderbolt . When I connect it it crashes. What Gives ?j
-
Dear all, I've added an include command in the main window of my sapscript in order to display text object in my forms. THe thing is that I would like to be able to position the free text not on the left of the windows but in the middle of it. But it
-
Safari opens links in new tabs, or in pre-existing tabs without giving me the option of opening the link in the same tab. This has never happened before. Normally I would right-click and select open in new tab. How do I fix it? It's really frustratin
-
Hard Disk stops working on Airport Extreme
I have moved my airport extreme from a "extend network' mode to "create network" mode and wanted to move my hard disk (which worked smoothly) with it. The Extreme is connected to Livebox (France) router in bridge mode. Now if I use my airport utility