Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2009
    Location
    Mumbai
    Posts
    29

    Unanswered: scheduler daily from starting now

    Hi,

    i have below scheduler code written on oracle 10g to run.

    Code:
    BEGIN
    DBMS_SCHEDULER.CREATE_JOB
    (
    job_name =>'TESTING_JOB',
    job_type =>'STORED_PROCEDURE',
    job_action =>'TEST1',
    start_date => SYSDATE,
    repeat_interval => 'FREQ=DAILY;INTERVAL=1;BYHOUR=0;BYMINUTE=0;BYSECOND=0',
    enabled => TRUE
    );
    END;
    scheduler is calling a procedure test1() just makes an entry to table.

    i want to run the scheduler now (i.e first time should be fired time) and daily morning 12:00 AM.

    so i have written the above code, after i run the scheduler successfully.
    i tested in the table which does not make any entry into it, this means it is not runned for the first time.

  2. #2
    Join Date
    Feb 2006
    Posts
    173
    Provided Answers: 1
    Run this sql and review entries to validate job setup correctly:
    Code:
    select * from sys.dba_jobs

  3. #3
    Join Date
    Jul 2009
    Location
    Mumbai
    Posts
    29
    i am using this sql query to check

    Code:
    SELECT job_name, enabled, NEXT_RUN_DATE FROM USER_scheduler_jobs;

  4. #4
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    Did you commit after entering the scheduler job?
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  5. #5
    Join Date
    Jul 2009
    Location
    Mumbai
    Posts
    29
    Hi,

    i tested with commit. No luck.

    As per my understanding start_date is to mention from which time stamp the scheduler should active, it is not the first running time. Based on the interval it is runs first execution also.

    any way for how to run scheduler first when i was fired and then next time is the every day change (i.e 12:00 AM)..?

  6. #6
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Well, if you leave both START_DATE and REPEAT_INTERVAL NULL, it will be executed immediately. Though, no scheduling in this case.

    Therefore, perhaps you should do that in two steps: first, run the procedure - it will do the initial insert. Second, schedule a job. (Don't forget to COMMIT). It will run tomorrow and the days that follow.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •