CREATE_SCHEDULE v18
Use the CREATE_SCHEDULE procedure to create a job schedule. The signature of the CREATE_SCHEDULE procedure is:
CREATE_SCHEDULE( <schedule_name> IN VARCHAR2, <start_date> IN TIMESTAMP WITH TIME ZONE DEFAULT NULL, <repeat_interval> IN VARCHAR2, <end_date> IN TIMESTAMP WITH TIME ZONE DEFAULT NULL, <comments> IN VARCHAR2 DEFAULT NULL)
Parameters
schedule_name
schedule_name specifies the name of the schedule.
start_date
start_date is a TIMESTAMP WITH TIME ZONE value that specifies the date and time that the schedule is eligible to execute. If you don't specify a start_date, the date that the job is enabled is used as the start_date. By default, start_date is NULL.
repeat_interval
repeat_interval is a VARCHAR2 value that specifies how often the job repeats. If you don't specify a repeat_interval, the job executes only once, on the date specified by start_date.
!!! Note
You must provide a value for either start_date or repeat_interval. If both start_date and repeat_interval are NULL, the server returns an error.
end_date
end_date is a TIMESTAMP WITH TIME ZONE value that specifies a time after which the schedule no longer executes. If you specify a date, the end_date must be after the start_date. The default value is NULL.
!!! Note
If you specify a repeat_interval and don't specify an end_date, the schedule repeats indefinitely until you disable it.
comments
Use the comments parameter to specify a comment about the schedule. By default, this parameter is NULL.
Example
This code fragment calls CREATE_SCHEDULE to create a schedule named weeknights_at_5:
EXEC DBMS_SCHEDULER.CREATE_SCHEDULE ( schedule_name => 'weeknights_at_5', start_date => '01-JUN-13 09:00:00.000000', repeat_interval => 'FREQ=DAILY;BYDAY=MON,TUE,WED,THU,FRI;BYHOUR=17;', comments => 'This schedule executes each weeknight at 5:00');
The schedule executes each weeknight, at 5:00, effective after June 1, 2013. Since no end_date is specified, the schedule executes indefinitely until disabled with DBMS_SCHEDULER.DISABLE.
- On this page
- Parameters
- Example