If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > scheduler daily from starting now

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-02-10, 02:28
scharan07 scharan07 is offline
Registered User
 
Join Date: Jul 2009
Location: Mumbai
Posts: 21
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.
Reply With Quote
  #2 (permalink)  
Old 09-02-10, 04:29
spacebar spacebar is offline
Registered User
 
Join Date: Feb 2006
Posts: 63
Run this sql and review entries to validate job setup correctly:
Code:
select * from sys.dba_jobs
Reply With Quote
  #3 (permalink)  
Old 09-02-10, 07:24
scharan07 scharan07 is offline
Registered User
 
Join Date: Jul 2009
Location: Mumbai
Posts: 21
i am using this sql query to check

Code:
SELECT job_name, enabled, NEXT_RUN_DATE FROM USER_scheduler_jobs;
Reply With Quote
  #4 (permalink)  
Old 09-02-10, 11:12
beilstwh beilstwh is offline
Lead Application Develope
 
Join Date: Jun 2004
Location: Liverpool, NY USA
Posts: 2,172
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.
Reply With Quote
  #5 (permalink)  
Old 09-03-10, 02:53
scharan07 scharan07 is offline
Registered User
 
Join Date: Jul 2009
Location: Mumbai
Posts: 21
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)..?
Reply With Quote
  #6 (permalink)  
Old 09-03-10, 05:17
Littlefoot Littlefoot is offline
Lost Boy
 
Join Date: Jan 2004
Location: Croatia, Europe
Posts: 3,591
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.
Reply With Quote
Reply

Tags
daily scheduler, scheduler

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On