I have the following scheduled jobs :
job_action=> 'PROC' ,
repeat_interval => 'FREQ=DAILY; BYHOUR=08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23; BYMINUTE=2,12,22,32,42,52; BYSECOND=1',
job_action=> 'PROC2' ,
repeat_interval => 'FREQ=DAILY; BYHOUR=08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23; BYMINUTE=4,14,24,34,44,54; BYSECOND=1',
At about 8 in the morning the database was bounced with the normal procedure of stop and start.
After I noticed that the 2 jobs were both executed at 8:06.
But this is not the time they were supposed to be executed from the scheduler.
Later the execution was fine.
Can somebody help me explain what has happened?
Thanks in advance!
When DB was down time for job run by you definition could pass. SO after DB start scheduler has found than job miss his run and run it immediatelly.
Check dba_scheduler_job_run_details for givern job.
In column REQ_START_DATE is date when job have to run , in column ACTUAL_START_DATE is date when this job run really start.
To prevent this behaviouryou can set job attribute SCHEDULE_LIMIT. If job miss it run by more then SCHEDULE_LIMIT then this run is skiped.
Let's suppose we plan to have the database down for hours. I guess at db startup all my jobs will run immediately.
But we don't want this.
What if we add to the shutdown script of our database the disable of jobs and to the startup script the enable of jobs.
Would this work for us?
But what would happen if while trying to disable the job(by setting enable => FALSE) the job is running.
We don't want the job to stop while it is running, it should wait for it to finish and then disable it.
No, no OS services but the Oracle Database services.
You start creating service[s] in your databases see
Next define your job classes to use the defined services.
Next make sure that you Oracle Scheduler Jobs do use your defined Job Classes, instead of DEFAULT_JOB_CLASS.
I hope this helps,
No, when you enable a service, jobs that are tied to the Job Class that uses that service are able to run.
If you disable that service, those jobs won't be able to run.
In your case, when you start maintenance, start with de-activating the service[s]
do what you need to do
start the database
make checks you want to do and when ready enable the service[s] after which point the jobs that are coupled to those services are able to start again.
An other option is to adjust job_queue_processes but the various Oracle releases have varying reactions on this. Using services to control your application workload is a more elegant.
I tried your suggestion, when I stop the service, jobs are not executed, but as soon as I start the service they get executed immediately!!!!!!!!!!!
This is not what I wanted, thanks anyway
I don't want the jobs to execute immediately after start of database but according to the schedule because they have to go one after the other in queue.
Edited by: 930648 on Aug 13, 2012 6:43 AM