自动收集统计信息从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;
-
/
阅读(22472) | 评论(0) | 转发(0) |