自动收集统计信息从22点开始,默认2点结束,只干活4小时,有时为了避免与夜晚跑批作业冲突,需要进行调整。
-
--调整统计信息收集窗口为6个小时
-
col WINDOW_NAME for a18
-
col REPEAT_INTERVAL for a60
-
col DURATION for a30
-
set linesize 120
-
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 IN
-
('MAINTENANCE_WINDOW_GROUP', 'BSLN_MAINTAIN_STATS_SCHED');
-
-
BEGIN
-
sys.dbms_scheduler.set_attribute(NAME => 'SYS.MONDAY_WINDOW',
-
attribute => 'REPEAT_INTERVAL',
-
VALUE => 'freq=daily;byday=MON;byhour=22;byminute=0;bysecond=0');
-
sys.dbms_scheduler.set_attribute(NAME => 'SYS.MONDAY_WINDOW',
-
attribute => 'DURATION',
-
VALUE => '0 06:00:00');
-
END;
-
/
-
-
BEGIN
-
sys.dbms_scheduler.set_attribute(NAME => 'SYS.TUESDAY_WINDOW',
-
attribute => 'REPEAT_INTERVAL',
-
VALUE => 'freq=daily;byday=TUE;byhour=22;byminute=0;bysecond=0');
-
sys.dbms_scheduler.set_attribute(NAME => 'SYS.TUESDAY_WINDOW',
-
attribute => 'DURATION',
-
VALUE => '0 06:00:00');
-
END;
-
/
-
-
BEGIN
-
sys.dbms_scheduler.set_attribute(NAME => 'SYS.WEDNESDAY_WINDOW',
-
attribute => 'REPEAT_INTERVAL',
-
VALUE => 'freq=daily;byday=WED;byhour=22;byminute=0;bysecond=0');
-
sys.dbms_scheduler.set_attribute(NAME => 'SYS.WEDNESDAY_WINDOW',
-
attribute => 'DURATION',
-
VALUE => '0 06:00:00');
-
END;
-
/
-
-
BEGIN
-
sys.dbms_scheduler.set_attribute(NAME => 'SYS.THURSDAY_WINDOW',
-
attribute => 'REPEAT_INTERVAL',
-
VALUE => 'freq=daily;byday=THU;byhour=22;byminute=0;bysecond=0');
-
sys.dbms_scheduler.set_attribute(NAME => 'SYS.THURSDAY_WINDOW',
-
attribute => 'DURATION',
-
VALUE => '0 06:00:00');
-
END;
-
/
-
-
BEGIN
-
sys.dbms_scheduler.set_attribute(NAME => 'SYS.FRIDAY_WINDOW',
-
attribute => 'REPEAT_INTERVAL',
-
VALUE => 'freq=daily;byday=FRI;byhour=22;byminute=0;bysecond=0');
-
sys.dbms_scheduler.set_attribute(NAME => 'SYS.FRIDAY_WINDOW',
-
attribute => 'DURATION',
-
VALUE => '0 06:00:00');
-
END;
-
/
-
-
BEGIN
-
sys.dbms_scheduler.set_attribute(NAME => 'SYS.SATURDAY_WINDOW',
-
attribute => 'REPEAT_INTERVAL',
-
VALUE => 'freq=daily;byday=SAT;byhour=6;byminute=0;bysecond=0');
-
sys.dbms_scheduler.set_attribute(NAME => 'SYS.SATURDAY_WINDOW',
-
attribute => 'DURATION',
-
VALUE => '0 20:00:00');
-
END;
-
/
-
-
BEGIN
-
sys.dbms_scheduler.set_attribute(NAME => 'SYS.SUNDAY_WINDOW',
-
attribute => 'REPEAT_INTERVAL',
-
VALUE => 'freq=daily;byday=SUN;byhour=6;byminute=0;bysecond=0');
-
sys.dbms_scheduler.set_attribute(NAME => 'SYS.SUNDAY_WINDOW',
-
attribute => 'DURATION',
-
VALUE => '0 20:00:00');
-
END;
-
/
阅读(22634) | 评论(0) | 转发(0) |