Suraj
Suraj

Reputation: 3137

what if there is no repeat_interval in dbms_scheduler.create_job

I have created a Job using this.

BEGIN 
   dbms_scheduler.create_job ( 
    job_name => 'test_JOB', 
    job_type => 'PLSQL_BLOCK', 
    JOB_ACTION => 'UP_TRYNR;', 
    start_date =>sysdate, 
    enabled => true, 
    repeat_interval => 'FREQ=DAILY;INTERVAL=1'
   ); 
END;

If I create the job without specifying repeat_interval what will happen? i.e.

BEGIN 
   dbms_scheduler.create_job ( 
    job_name => 'test_JOB', 
    job_type => 'PLSQL_BLOCK', 
    JOB_ACTION => 'UP_TRYNR;', 
    start_date =>sysdate, 
    enabled => true, 
   ); 
END; 

Any suggestion will be helpful. Thanks.

Upvotes: 0

Views: 4548

Answers (1)

XING
XING

Reputation: 9886

The DBMS_SCHEDULER package includes functionality that can be used to set up and manage the timetabling and execution of tasks that need to be run according to a – repeating or non-repeating – schedule. DBMS_SCHEDULER breaks the process of scheduling a task into 3 parts:

  1. Create a schedule
  2. Identify a ‘program’ – by which they mean the procedure you wish to run
  3. Create a ‘job’ – by which they mean chain a program to a schedule.

As name suggests Repeat_interval,describes the frequency when the programs needs to be executed. This is a bit like the cron syntax in UNix.

If you create it without any Repeat_interval,it would execute only once at the specified startdate and then remain dormant.

Upvotes: 4

Related Questions