小編給大家分享一下數(shù)據(jù)庫中如何修改自動(dòng)收集統(tǒng)計(jì)信息任務(wù)的執(zhí)行時(shí)間,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!
我們提供的服務(wù)有:網(wǎng)站制作、成都網(wǎng)站制作、微信公眾號(hào)開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認(rèn)證、惠濟(jì)ssl等。為成百上千企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務(wù),是有科學(xué)管理、有技術(shù)的惠濟(jì)網(wǎng)站制作公司一般情況,oracle11G數(shù)據(jù)庫自動(dòng)收集統(tǒng)計(jì)信息任務(wù)的設(shè)置如下:
1、Oracle11g 的默認(rèn)設(shè)置;
2、user_tab_modifications 跟蹤記錄表的修改;
3、當(dāng)分析對(duì)象的數(shù)據(jù)變化超過10% 時(shí),Oracle 會(huì)重新分析;
4、定時(shí)任務(wù)gather_stats_job 負(fù)責(zé)定時(shí)調(diào)度收集統(tǒng)計(jì)信息。
5、在Oracle11g 中,默認(rèn)自動(dòng)收集統(tǒng)計(jì)信息的時(shí)間為:
# 周一~周五,22點(diǎn)啟動(dòng),收集4個(gè)小時(shí)
# 周六,周日,6點(diǎn)啟動(dòng),收集20個(gè)小時(shí)
---查看自動(dòng)統(tǒng)計(jì)信息的時(shí)間:
sys@PROD>col WINDOW_NAME for a15
sys@PROD>col REPEAT_INTERVAL for a60
sys@PROD>col DURATION for a30
sys@PROD>set linesize 120
sys@PROD>SELECT t1.window_name, t1.repeat_interval, t1.duration
2 FROM dba_scheduler_windows t1, dba_scheduler_wingroup_members t2
3 WHERE t1.window_name = t2.window_name
4 AND t2.window_group_name IN
5 ('MAINTENANCE_WINDOW_GROUP', 'BSLN_MAINTAIN_STATS_SCHED');
WINDOW_NAME REPEAT_INTERVAL DURATION
--------------- ------------------------------------------------------------ ------------------------------
MONDAY_WINDOW freq=daily;byday=MON;byhour=22;byminute=0; bysecond=0 +000 04:00:00
TUESDAY_WINDOW freq=daily;byday=TUE;byhour=22;byminute=0; bysecond=0 +000 04:00:00
WEDNESDAY_WINDO freq=daily;byday=WED;byhour=22;byminute=0; bysecond=0 +000 04:00:00
W
THURSDAY_WINDOW freq=daily;byday=THU;byhour=22;byminute=0; bysecond=0 +000 04:00:00
FRIDAY_WINDOW freq=daily;byday=FRI;byhour=22;byminute=0; bysecond=0 +000 04:00:00
SATURDAY_WINDOW freq=daily;byday=SAT;byhour=6;byminute=0; bysecond=0 +000 20:00:00
SUNDAY_WINDOW freq=daily;byday=SUN;byhour=6;byminute=0; bysecond=0 +000 20:00:00
7 rows selected.
--備注:
#freq=daily:每天收集;
#;byday=SUN:一周之內(nèi)的星期,例如這里是星期日;
#byhour=22 :每天的時(shí)間點(diǎn)時(shí),這里是22時(shí);
#byminute=0:每天的的時(shí)間點(diǎn)分,這里是0分,則第1分;
#bysecond=0:每天的時(shí)間點(diǎn)秒,這里是0秒,則第1秒;
#+000 20:00:00 :表示收集信息的時(shí)間區(qū)間長,這里表示20小時(shí)。
---修改自動(dòng)收集統(tǒng)計(jì)信息計(jì)劃任務(wù)時(shí)間:
--首先停止原來計(jì)劃;
sys@PROD>BEGIN
2 DBMS_SCHEDULER.DISABLE(
3 name => '"SYS"."THURSDAY_WINDOW"');
4 end;
5 /
PL/SQL procedure successfully completed.
--修改計(jì)劃任務(wù)的執(zhí)行時(shí)間:
sys@PROD>BEGIN
2 DBMS_SCHEDULER.SET_ATTRIBUTE(
3 name => '"SYS"."THURSDAY_WINDOW"',
4 attribute => 'REPEAT_INTERVAL',
5 value =>
6 'freq=daily;byday=THU;byhour=22;byminute=0;bysecond=0');
7 end;
8 /
PL/SQL procedure successfully completed.
--啟用新的計(jì)劃任務(wù)的執(zhí)行時(shí)間:
sys@PROD>BEGIN
2 DBMS_SCHEDULER.ENABLE(
3 name => '"SYS"."THURSDAY_WINDOW"');
4 end;
5 /
PL/SQL procedure successfully completed.
看完了這篇文章,相信你對(duì)“數(shù)據(jù)庫中如何修改自動(dòng)收集統(tǒng)計(jì)信息任務(wù)的執(zhí)行時(shí)間”有了一定的了解,如果想了解更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)-成都網(wǎng)站建設(shè)公司行業(yè)資訊頻道,感謝各位的閱讀!