Oracle 11g 系統自帶任務的檢視和更改
檢視自動收集統計資訊的任務及狀態:
SQL> select client_name,status from dba_autotask_client;
CLIENT_NAME STATUS
---------------------------------------------------------------- --------
auto optimizer stats collection ENABLED
auto space advisor ENABLED
sql tuning advisor ENABLED
獲得當前自動收集統計資訊的執行時間:
1 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 and t2.window_group_name in ('MAINTENANCE_WINDOW_GROUP','BSLN_MAINTAIN_STATS_SCHED')
SQL> /
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_WINDOW freq=daily;byday=WED;byhour=22;byminute=0; bysecond=0 +000 04:00:00
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行。
--禁止自動收集統計資訊的任務
exec DBMS_AUTO_TASK_ADMIN.DISABLE(client_name => 'auto optimizer stats collection',operation => NULL,window_name => NULL);
--獲得當前自動收集統計資訊的執行時間
select t1.window_name, t1.repeat_interval, t1.duration
from dba_scheduler_windows t1, dba_scheduler_wingroup_members t2
where t1.window_name = t2.window_name
and t2.window_group_name = 'MAINTENANCE_WINDOW_GROUP';
修改統計資訊執行的時間:
1.停止任務:
SQL> BEGIN
2 DBMS_SCHEDULER.DISABLE(
3 name => '"SYS"."THURSDAY_WINDOW"',
4 force => TRUE); --停止任務是true
5 END;
6 /
2.修改任務的持續時間,單位是分鐘:
SQL> BEGIN
2 DBMS_SCHEDULER.SET_ATTRIBUTE(
3 name => '"SYS"."THURSDAY_WINDOW"',
4 attribute => 'DURATION',
5 value => numtodsinterval(60,'minute'));
6 END;
7 /
SQL>
3.開始執行時間,BYHOUR=2,表示2點開始執行:
SQL> BEGIN
2 DBMS_SCHEDULER.SET_ATTRIBUTE(
3 name => '"SYS"."THURSDAY_WINDOW"',
4 attribute => 'REPEAT_INTERVAL',
5 value => 'freq=daily;byday=THU;byhour=10;byminute=40;bysecond=0');
6 END;
7 /
4.開啟任務:
SQL> BEGIN
2 DBMS_SCHEDULER.ENABLE(
3 name => '"SYS"."THURSDAY_WINDOW"');
4 END;
5 /
5.檢視修改後的情況:
SQL> 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 and t2.window_group_name in ('MAINTENANCE_WINDOW_GROUP','BSLN_MAINTAIN_STATS_SCHED');
SQL> select client_name,status from dba_autotask_client;
CLIENT_NAME STATUS
---------------------------------------------------------------- --------
auto optimizer stats collection ENABLED
auto space advisor ENABLED
sql tuning advisor ENABLED
獲得當前自動收集統計資訊的執行時間:
1 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 and t2.window_group_name in ('MAINTENANCE_WINDOW_GROUP','BSLN_MAINTAIN_STATS_SCHED')
SQL> /
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_WINDOW freq=daily;byday=WED;byhour=22;byminute=0; bysecond=0 +000 04:00:00
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行。
--禁止自動收集統計資訊的任務
exec DBMS_AUTO_TASK_ADMIN.DISABLE(client_name => 'auto optimizer stats collection',operation => NULL,window_name => NULL);
--獲得當前自動收集統計資訊的執行時間
select t1.window_name, t1.repeat_interval, t1.duration
from dba_scheduler_windows t1, dba_scheduler_wingroup_members t2
where t1.window_name = t2.window_name
and t2.window_group_name = 'MAINTENANCE_WINDOW_GROUP';
修改統計資訊執行的時間:
1.停止任務:
SQL> BEGIN
2 DBMS_SCHEDULER.DISABLE(
3 name => '"SYS"."THURSDAY_WINDOW"',
4 force => TRUE); --停止任務是true
5 END;
6 /
2.修改任務的持續時間,單位是分鐘:
SQL> BEGIN
2 DBMS_SCHEDULER.SET_ATTRIBUTE(
3 name => '"SYS"."THURSDAY_WINDOW"',
4 attribute => 'DURATION',
5 value => numtodsinterval(60,'minute'));
6 END;
7 /
SQL>
3.開始執行時間,BYHOUR=2,表示2點開始執行:
SQL> BEGIN
2 DBMS_SCHEDULER.SET_ATTRIBUTE(
3 name => '"SYS"."THURSDAY_WINDOW"',
4 attribute => 'REPEAT_INTERVAL',
5 value => 'freq=daily;byday=THU;byhour=10;byminute=40;bysecond=0');
6 END;
7 /
4.開啟任務:
SQL> BEGIN
2 DBMS_SCHEDULER.ENABLE(
3 name => '"SYS"."THURSDAY_WINDOW"');
4 END;
5 /
5.檢視修改後的情況:
SQL> 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 and t2.window_group_name in ('MAINTENANCE_WINDOW_GROUP','BSLN_MAINTAIN_STATS_SCHED');
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26506993/viewspace-1985476/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORACLE 11G 維護視窗和自動維護任務Oracle
- ORACLE主要的系統表和系統檢視Oracle
- ORACLE 11G 自動維護任務Oracle
- Windows10系統如何關閉任務檢視Windows
- 11G執行oracle自帶的檢查 checkOracle
- Win10喚醒系統裝置和任務檢視命令大全Win10
- orale 10g和11g中的自動統計任務
- 10g和11g自動任務的區別
- oracle系統檢視大全Oracle
- 【Oracle】Oracle 11g 中的自動資料庫維護任務管理Oracle資料庫
- ubuntu16.4系統和Gentos6.8系統檢視開機自啟動服務Ubuntu
- oracle 11g asm自動備份asm磁頭任務OracleASM
- Part 5: 任務列表檢視
- 檢視Spark任務的詳細資訊Spark
- EXPDP/IMPDP任務的檢視與管理
- exp / imp 任務的檢視與管理
- Oracle 11g Release 2 RAC叢集系統——安裝後置任務Oracle
- oracle系統檢視作用大全Oracle
- ORACLE常用系統檢視(整理) .Oracle
- oracle 11g 統計資訊 相關檢視Oracle
- 11g 啟用或關閉自動統計任務
- Oracle 11g系列:檢視Oracle
- win10任務檢視快捷鍵是什麼 開啟win10任務檢視的方法Win10
- oracle 11g 更改sid和dbnameOracle
- 如何檢視solaris系統的版本和位數?solaris系統的版本和位數的檢視方法
- 11g啟用或關閉自動統計等任務
- Oracle自動維護任務Oracle
- win10系統使用自帶畫圖工具更改照片大小的方法Win10
- 檢視oracle系統的執行時間Oracle
- oracle檢視和更新統計表的資訊Oracle
- Oracle 11g 建立物化檢視Oracle
- win10任務檢視怎麼用 win10任務檢視功能詳細介紹Win10
- 系統狀態統計和檢視
- 任務系統之Jenkins子任務Jenkins
- Win10任務檢視怎麼刪除記錄 win10清除任務檢視記錄的教程Win10
- win10任務檢視怎麼關閉歷史記錄 關閉任務檢視的具體方法Win10
- 如何檢視資料庫中的job任務資料庫
- oracle 系統自帶幾個常用函式Oracle函式