Search code examples
oracle-databaseoracle11gdatabase-administrationdbms-scheduler

How do I schedule a stored procedure to run daily at certain time?


I am trying to schedule a stored procedure in Oracle, it should run daily at a certain time, for example at 11:59 pm

 BEGIN
 DBMS_SCHEDULER.CREATE_JOB (
 job_name           =>  'BLANKET_WO',
 job_type           =>  'STORED_PROCEDURE',
 job_action         =>  'AAKPID.BLANKET_WO_PROC',
 repeat_interval    =>  'FREQ=DAILY;BYHOUR=23;BYMINUTE=59');
 END;
 /

Will this code work?


Solution

  • Try this, it should work:

     BEGIN
     DBMS_SCHEDULER.CREATE_JOB (
     job_name           =>  'BLANKET_WO',
     job_type           =>  'STORED_PROCEDURE',
     job_action         =>  'AAKPID.BLANKET_WO_PROC',
     start_date         =>  '16-nov-2017 11:50:00 pm',
     repeat_interval    =>  'FREQ=DAILY;BYHOUR=23;BYMINUTE=59',
     enabled            =>  true
    );
     END;
     /