5 Replies Latest reply: Jan 14, 2013 4:43 AM by Mihael RSS

    dbms_schedular to use for 3 hours

    Chanchal Wankhade
      Dear All,

      We have oracle 10G R2 on windows.

      I am trying to use dbms_scheduler create the schedule to run procedures.

      My requirement is to run the job from 12.30 pm to 3.30 pm for the interval of every 10 minuts and 2.45 t0 3.45 for the interval of 5 minuts.

      For the above requirement, Can you please suggest how can i create a job. I have created something like below :-
      begin
      DBMS_SCHEDULER.CREATE_JOB(
      JOB_NAME          =>     'TEST_JOB',
      JOB_TYPE          =>     'PLSQL_PROCEDURE',
      JOB_ACTION          =>     'BEGIN TEST; END; ',
      START_DATE          =>     SYSTIMESTAMP,
      END_DATE          =>     NULL,
      COMMENTS          =>     'JOB IS CREATED FOR TESTING PURPOSE',
      ENABLED               =>     TRUE,
      REPEAT_INTERVAL          =>     ‘freq=WEEKLY;BYDAY=MON,TUE,WED,THU,FRI; byhour=12.30 to 15; byminute=10; bysecond=0;’
      )
      Can we do this.
        • 1. Re: dbms_schedular to use for 3 hours
          moreajays
          Hi,

          Check if below can help
          begin
          DBMS_SCHEDULER.CREATE_JOB(
          JOB_NAME          =>     'TEST_JOB',
          JOB_TYPE          =>     'PLSQL_PROCEDURE',
          JOB_ACTION          =>     'BEGIN TEST; END; ',
          START_DATE          =>     SYSTIMESTAMP,
          END_DATE          =>     NULL,
          COMMENTS          =>     'JOB IS CREATED FOR TESTING PURPOSE',
          ENABLED               =>     TRUE,
          REPEAT_INTERVAL          =>     ‘freq=WEEKLY;BYDAY=MON,TUE,WED,THU,FRI; byhour=12,13,14,15; byminute=10; bysecond=0;’
          )
          
          
          begin
          DBMS_SCHEDULER.CREATE_JOB(
          JOB_NAME          =>     'TEST_JOB1',
          JOB_TYPE          =>     'PLSQL_PROCEDURE',
          JOB_ACTION          =>     'BEGIN TEST; END; ',
          START_DATE          =>     SYSTIMESTAMP,
          END_DATE          =>     NULL,
          COMMENTS          =>     'JOB IS CREATED FOR TESTING PURPOSE',
          ENABLED               =>     TRUE,
          REPEAT_INTERVAL          =>     ‘freq=WEEKLY;BYDAY=MON,TUE,WED,THU,FRI; byhour=2,3; byminute=5; bysecond=0;’
          )
          Thanks,
          Ajay More
          http://moreajays.blogspot.com
          • 3. Re: dbms_schedular to use for 3 hours
            Mihael
            REPEAT_INTERVAL          =>     ‘freq=WEEKLY;BYDAY=MON,TUE,WED,THU,FRI; byhour=12,13,14,15; byminute=10; bysecond=0;’
            REPEAT_INTERVAL          =>     ‘freq=WEEKLY;BYDAY=MON,TUE,WED,THU,FRI; byhour=2,3; byminute=5; bysecond=0;’
            job will run not every 10 or 5 minutes, but at 12:10, 13:10, 14:10....
            • 4. Re: dbms_schedular to use for 3 hours
              Chanchal Wankhade
              Hi,

              I want job should run after interval of 10 minuts from 12.30 to 3.30.
              I can do it by using windows commands but not been able to do it with oracle.

              please suggest.
              • 5. Re: dbms_schedular to use for 3 hours
                Mihael
                Have you seen the answer in "Scheduler" forum where you have duplicated the question?