Oracle Scheduler - Create Complex Schedule with One Job

I have a job being done in Oracle 10g DB with a fairly simple execution plan.

BYDAY=MON,TUE,WED,THU,FRI;BYHOUR=6,10,14,18

      

Now the problem is that we have to change the plan - but only on Mondays. Therefore, on Mondays, the first job should work at 8 instead of 6. Then, like all the others (10, 14, 18). Whereas from Tuesday to Friday it should work as above.

The easiest way is to create a second job for Monday and remove Monday from the original job. This, however, is a problem for our application as it only uses one import job.

So the question is: is there a way to tell the scheduler to run at 6,10,14,18 hours TUE-FRI and 8,10,14,18 on MON with one job?

I read about setting the repetition interval with a PL / SQL expression. But I didn't find out if there is a way to do this.

thanks for the help

+3


source to share


1 answer


create a compound schedule and assign this task when you create it.

eg:



begin
  dbms_scheduler.create_schedule('MY_SCHED1', repeat_interval =>
  'FREQ=DAILY;BYDAY=TUE,WED,THU,FRI;BYHOUR=6,10,14,18');
END;
/
begin
dbms_scheduler.create_schedule('MY_SCHED2', repeat_interval =>
  'FREQ=DAILY;BYDAY=MON;BYHOUR=8,10,14,18');
END;
/
begin
dbms_scheduler.create_schedule('MAIN', repeat_interval =>
  'MY_SCHED1, MY_SCHED2');
END;
/

      

now you just assigned the "MAIN" job by job name instead of the schedule line.

+5


source







All Articles