Link to home
Start Free TrialLog in
Avatar of crayola3
crayola3

asked on

Specifying when a failed job is to retry running

Using Oracle's DBMS_SCHEDULER is there any way to specify when a failed job is to retry running again?  Our scheduled jobs are of the variety that if they fail, we would like to wait an hour before retrying running them again.  The Oracle online documentation on this seems to indicate that a scheduled job fail will be instantly retried to run again (up to max num retries).

              DBMS_SCHEDULER.CREATE_JOB (
                job_name            => strJobName
               ,job_type              => strJobType
               ,job_action          => strJobAction
               ,number_of_arguments => 1
               ,start_date          => dteStart
               ,end_date            => dteEnd
               ,repeat_interval     => 'FREQ=HOURLY;INTERVAL=1'
               ,enabled             => FALSE
               ,auto_drop           => FALSE
               ,comments            => strComments
              );
             
              DBMS_SCHEDULER.set_attribute (
                name        => strJobName
               ,attribute   => 'max_failures'
               ,value       =>  numMaxRetryAttempts
              );
Avatar of David VanZandt
David VanZandt
Flag of United States of America image

I have to concur that the restart cannot be deferred -- except in the following condition:

If restartable is set to FALSE for the job:
If the job is a run-once job and auto_drop is set to TRUE, the job run is done and the job is dropped.
If the job is a run-once job and auto_drop is set to FALSE, the job is disabled and the job state is set to 'STOPPED'.
If the job is a repeating job, the Scheduler schedules the next job run and the job state is set to 'SCHEDULED'.
 
SOLUTION
Avatar of David VanZandt
David VanZandt
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
in simple terms, there is no answer as of now for your requirement with 10g dbms_scheduler. I mean dbms_scheduler does not have an option for your requirement as far as i am aware. I wish to some option/solution to your requirement in oracle 11g version.