Documentation repeat

Default a scheduler task is scheduled once every day. If a scheduler task must run more than once on a day one can schedule each scheduler task seperate or if the interval between each scheduler task is the same a repeat interval can be specified for this scheduler task.
The repeat properties are entered on the script submit window (repeat panel).

Screenshot PL/SQL scheduler window W22 Script submit (repeat panel)
Number

The total times a scheduler task must be repeated.

Till

The time (format HH24:MI:SS) untill the scheduler task is repeated.

Historical

If set the next repeated task can be scheduled before the current date and time, otherwise these scheduler tasks are skipped.

From starttime

If set the next repeat is scheduled at the schedule date of the last task incremented with the repeat interval period.
If not set the next repeat is schedule at the date and time the last repeated task was ready incremented with the repeat interval.

Precreate tasks

If set all the repeated tasks are created immediately when the scheduler script is submitted.

Hours Minutes Seconds

The total of these three values determine the repeat interval between each repeated scheduler task.

Back to top 

Example 1

In this example a scheduler task is created for scheduler script so_demo_sleep which is repeated eight times with a one minute interval.

Screenshot PL/SQL scheduler window W22 Script submit (repeat panel)

When using PL/SQL the same can be achived with the next code.

begin
  so_task.schedule_create(
     p_schedule_date => to_date('2007-04-11'),
     p_schedule_time => '13:50',
     p_repeat_number => 8,
     p_repeat_minutes => 1);
  so_demo_sleep(10);
  so_task.committasks;
end;
/
  

The task will now execute 8 times, as can be seen from the next schedule dates, we use the database view SO_VW_TASKS for displaying the scheduled tasks.

column rep format 999
column tot format 999
column task format 999999
select task_id task,
       task_scheduled
       task_activated,
       task_ready,
       repeat_current rep,
       repeat_number tot
from so_vw_tasks
where script_name='SO_DEMO_SLEEP'
and trunc(task_created) = trunc(sysdate)
order by task_id
/

   TASK TASK_SCHEDULED      TASK_ACTIVATED      TASK_READY           REP  TOT
======= =================== =================== =================== ==== ====
  11943 2007-04-11 13:50:00 2007-04-11 13:50:02 2007-04-11 13:50:15    1    8
  11944 2007-04-11 13:51:00 2007-04-11 13:51:01 2007-04-11 13:51:14    2    8
  11945 2007-04-11 13:52:00 2007-04-11 13:52:00 2007-04-11 13:52:14    3    8
  11946 2007-04-11 13:53:00 2007-04-11 13:53:00 2007-04-11 13:53:14    4    8
  11947 2007-04-11 13:54:00 2007-04-11 13:54:00 2007-04-11 13:54:14    5    8
  11948 2007-04-11 13:55:00 2007-04-11 13:55:00 2007-04-11 13:55:15    6    8
  11949 2007-04-11 13:56:00 2007-04-11 13:56:01 2007-04-11 13:56:15    7    8
  11950 2007-04-11 13:57:00 2007-04-11 13:57:00 2007-04-11 13:57:15    8    8
  

Because repeat historical and repeat from starttime are set the tasks will be scheduled in the past if the schedule date of the next task lies before the current date and time.
In the next list the first task was scheduled at 14:40:00 but started at 14:44:16. Tasks two till six are scheduled before the current date and time and are activated immediate. Task seven and eight are activated at the scheduled time.

   TASK TASK_SCHEDULED      TASK_ACTIVATED      TASK_READY           REP  TOT
======= =================== =================== =================== ==== ====
  11952 2007-04-11 14:40:00 2007-04-11 14:44:16 2007-04-11 14:44:31    1    8
  11953 2007-04-11 14:41:00 2007-04-11 14:44:31 2007-04-11 14:44:45    2    8
  11954 2007-04-11 14:42:00 2007-04-11 14:44:45 2007-04-11 14:45:00    3    8
  11955 2007-04-11 14:43:00 2007-04-11 14:45:00 2007-04-11 14:45:15    4    8
  11956 2007-04-11 14:44:00 2007-04-11 14:45:15 2007-04-11 14:45:30    5    8
  11957 2007-04-11 14:45:00 2007-04-11 14:45:31 2007-04-11 14:45:45    6    8
  11958 2007-04-11 14:46:00 2007-04-11 14:46:00 2007-04-11 14:46:15    7    8
  11959 2007-04-11 14:47:00 2007-04-11 14:47:00 2007-04-11 14:47:15    8    8
  

If repeat historical is not set but repeat from starttime is set the tasks that would be scheduled in the past are skipped.
In the next example can be seen that because the first task was activated five minutes too late tasks two till six are not scheduled.

   TASK TASK_SCHEDULED      TASK_ACTIVATED      TASK_READY           REP  TOT
======= =================== =================== =================== ==== ====
  11964 2007-04-11 14:50:00 2007-04-11 14:55:05 2007-04-11 14:55:17    1    8
  11965 2007-04-11 14:56:00 2007-04-11 14:56:00 2007-04-11 14:56:12    7    8
  11966 2007-04-11 14:57:00 2007-04-11 14:57:01 2007-04-11 14:57:12    8    8
  

If repeat from starttime is not set the next repeated task will be scheduled at the time the previous task ended incremented with the repeat interval.
These repeated tasks are never scheduled historical so the setting of repeat historical is ignored.
In the next example can be seen that the second task is scheduled at the date and time the first task was ready incremented with the repeat interval.

   TASK TASK_SCHEDULE       TASK_ACTIVATED      TASK_READY           REP  TOT
======= =================== =================== =================== ==== ====
  11967 2007-04-11 14:55:00 2007-04-11 15:00:50 2007-04-11 15:01:03    1    8
  11968 2007-04-11 15:02:03 2007-04-11 15:02:03 2007-04-11 15:02:18    2    8
  11969 2007-04-11 15:03:18 2007-04-11 15:03:18 2007-04-11 15:03:33    3    8
  11970 2007-04-11 15:04:33 2007-04-11 15:04:33 2007-04-11 15:04:48    4    8
  11971 2007-04-11 15:05:48 2007-04-11 15:05:48 2007-04-11 15:06:03    5    8
  11972 2007-04-11 15:07:03 2007-04-11 15:07:03 2007-04-11 15:07:18    6    8
  11973 2007-04-11 15:08:18 2007-04-11 15:08:19 2007-04-11 15:08:34    7    8
  11974 2007-04-11 15:09:34 2007-04-11 15:09:34 2007-04-11 15:09:49    8    8
  
Back to top