Oracle scheduled task
# Su-oracle
Oracle> sqlplus "/as sysdba"
SQL> exec dbms_scheduler.disable ('Monday _ window ');
SQL> exec dbms_scheduler.disable ('tuesday _ window ');
SQL> exec dbms_scheduler.disable ('wednesday _ window ');
SQL> exec dbms_scheduler.disable ('Thursday _ window ');
SQL> exec dbms_scheduler.disable ('Friday _ window ');
SQL> exec dbms_scheduler.disable ('Saturday _ window ');
SQL> exec dbms_scheduler.disable ('Sunday _ window ');
SQL> exec dbms_scheduler.disable ('weekend _ window ');
# Su-oracle
Oracle> sqlplus "/as sysdba"
SQL> exec dbms_scheduler.enable ('Monday _ window ');
SQL> exec dbms_scheduler.enable ('tuesday _ window ');
SQL> exec dbms_scheduler.enable ('wednesday _ window ');
SQL> exec dbms_scheduler.enable ('Thursday _ window ');
SQL> exec dbms_scheduler.enable ('Friday _ window ');
SQL> exec dbms_scheduler.enable ('Saturday _ window ');
SQL> exec dbms_scheduler.enable ('Sunday _ window ');
Disable oracle scheduled tasks
1 Set the current resource manager plan to null (or another plan that is not restrictive ):
Alter system set resource_manager_plan = ''scope = both;
2 Change the active windows to use the null resource manager plan (or other nonrestrictive plan) using:
Execute dbms_scheduler.set_attribute ('weeknight _ Window', 'Resource _ plan ','');
Execute dbms_scheduler.set_attribute ('weekend _ Window', 'Resource _ plan ','');
3 Then, for each window_name (WINDOW_NAME from DBA_SCHEDULER_WINDOWS), run:
Execute dbms_scheduler.set_attribute ('<window name>', 'Resource _ plan ','');
SQL> select * from DBA_SCHEDULER_WINDOWS;
4 open resources plan
Check the resource status (Maybe need to set NULL or Change the running time. Please contact with the product engineers to confirm)
SQL> select a. name, a. value from v $ parameter a where a. name = 'Resource _ manager_plan ';
SQL> select window_name, resource_plan from dba_scheduler_windows where resource_plan is not null;
If not NULL, please think about Change the running time by the following:
Begin
Dbms_scheduler.set_attribute (name => 'Monday _ Window', attribute => 'Repeat _ INTERVAL ', value => 'freq = daily; byday = MON; byhour = 3; byminute = 0; bysecond = 0 ');
Dbms_scheduler.set_attribute (name => 'tuesday _ Window', attribute => 'Repeat _ INTERVAL ', value => 'freq = daily; byday = TUE; byhour = 3; byminute = 0; bysecond = 0 ');
Dbms_scheduler.set_attribute (name => 'wednesday _ Window', attribute => 'Repeat _ INTERVAL ', value => 'freq = daily; byday = WED; byhour = 3; byminute = 0; bysecond = 0 ');
Dbms_scheduler.set_attribute (name => 'Thursday _ Window', attribute => 'Repeat _ INTERVAL ', value => 'freq = daily; byday = THU; byhour = 3; byminute = 0; bysecond = 0 ');
Dbms_scheduler.set_attribute (name => 'Friday _ Window', attribute => 'Repeat _ INTERVAL ', value => 'freq = daily; byday = FRI; byhour = 3; byminute = 0; bysecond = 0 ');
End;
/
Begin
Dbms_scheduler.set_attribute (name => 'Saturday _ Window', attribute => 'Repeat _ INTERVAL ', value => 'freq = daily; byday = SAT; byhour = 3; byminute = 0; bysecond = 0 ');
Dbms_scheduler.set_attribute (name => 'Saturday _ Window', attribute => 'duration', value => '+ 000 04:00:00 ');
Dbms_scheduler.set_attribute (name => 'Sunday _ Window', attribute => 'Repeat _ INTERVAL ', value => 'freq = daily; byday = SUN; byhour = 3; byminute = 0; bysecond = 0 ');
Dbms_scheduler.set_attribute (name => 'Sunday _ Window', attribute => 'duration', value => '+ 000 04:00:00 ');
End;
/
Exec DBMS_SCHEDULER.SET_SCHEDULER_ATTRIBUTE ('default _ timezone ', 'Asia/TASHKENT ');