Juste un post rapide pour montrer comment modifier les fenêtres de maintenance d’Oracle 10g à la main et ainsi, si vous utilisez les travaux automatiques (statistiques, sauvegardes…), changer leur planification…
1- D’abord quelles sont les fenêtres programmées ?
set lines 120
col WINDOW_NAME format a16
col DURATION format a14
col REPEAT_INTERVAL format a70
select WINDOW_NAME,REPEAT_INTERVAL,DURATION, ENABLED
from dba_scheduler_windows;
WINDOW_NAME REPEAT_INTERVAL DURATION ENABL
---------------- ---------------------------------------------------------------------- -------------- -----
WEEKNIGHT_WINDOW freq=daily;byday=MON,TUE,WED,THU,FRI;byhour=22;byminute=0;bysecond=0 +000 08:00:00 TRUE
WEEKEND_WINDOW freq=daily;byday=SAT;byhour=0;byminute=0;bysecond=0 +002 00:00:00 TRUE
2– Modifiez les attributs « repeat_interval » et « duration » des 2 fenêtres
exec dbms_scheduler.set_attribute(-
name=>'WEEKNIGHT_WINDOW', -
attribute=>'repeat_interval', -
value=>'freq=daily;byday=MON,TUE,WED,THU,FRI,SAT;byhour=0;byminute=0;bysecond=0')
exec dbms_scheduler.set_attribute(-
name=>'WEEKNIGHT_WINDOW', -
attribute=>'duration', -
value=>'+000 06:00:00')
exec dbms_scheduler.set_attribute(-
name=>'WEEKEND_WINDOW', -
attribute=>'repeat_interval', -
value=>'freq=daily;byday=SUN;byhour=0;byminute=0;bysecond=0')
exec dbms_scheduler.set_attribute(-
name=>'WEEKEND_WINDOW', -
attribute=>'duration', -
value=>'+001 00:00:00')
3- Validez les modifications
WINDOW_NAME REPEAT_INTERVAL DURATION ENABL
---------------- --------------------------------------------------------------------------- -------------- -----
WEEKNIGHT_WINDOW freq=daily;byday=MON,TUE,WED,THU,FRI,SAT;byhour=0;byminute=0;bysecond=0 +000 05:00:00 TRUE
WEEKEND_WINDOW freq=daily;byday=SUN;byhour=0;byminute=0;bysecond=0 +001 00:00:00 TRUE