This content has been marked as final. Show 17 replies
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.
Thank you for your answer.
In my case if set SCHEDULE_LIMIT to 9 mins(my job has to run every 10 mins) would it be ok?
There is one more thing I'd like to know.
If my job misses two turns, at db startup will it execute immediately, with a scheduler limit of 9 mins?
DB start at 9:20
1.run skipped 9:05+9min => 9:14
2.run run after start up 9:15+9min => 9:24
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.
easiest is to setup specific services for you scheduler jobs and tie your job classes to them. As long as you keep your service disabled, no jobs will run.
My operating system is linux
You mean to create a service in linux that is connected with some jobs .
I have no idea about this, can you please explain me a little?
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,
So, creating a database service, the scheduled jobs(stop and start) will be managed by oracle at system startup and shutdown?
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.
If I create the scenario that you are suggesting, should I schedule the jobs individually or I have to schedule only the job class ?
The scheduling remains as it was before, using a calendar, schedule events or whatever you used before. You effectively only change the Job Class definition to become dependent on a service.
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