4

I have a job which runs a chain. The chain consists of 5 steps. First step is run and if it succeeds, three other steps will be run (independently, in parallel). Only if all three steps succeed, the last step will start. Everything works fine.

I would like to test a case with error. I intentionally provided an error in one of three above-mentioned steps. As a result, my first step succeeded so three steps were run. As I expected, only two of them succeeded and the third one failed. All steps were working for some automatically generated job_name (I checked job_name by querying user_scheduler_job_run_details). I removed the intentional error and ran only the failed step using:

dbms_scheduler.run_chain(chain_name => 'MY_CHAIN', start_steps => 'MY_FAILED_STEP');

Of course, my previously failed step succeeded (because an error was removed). But this step was run with another automatically generated job_name and unfortunately the last step (which was to run after all three mentioned steps succeed) was not run. I would like to run the failed step with specific (previous) job_name, and as a result, the last step should be run automatically.

How can I run a failed step in chain in Oracle using previous, specific job name?

Eve
  • 41
  • 1
  • 4
  • I also tried using: dbms_scheduler.run_chain(chain_name => 'MY_CHAIN', job_name => 'MY_PREVIOUS_JOB_NAME', start_steps => 'MY_FAILED_STEP'); but I got exception as follows: ORA-27477: "MY_PREVIOUS_JOB_NAME" już istnieje ORA-06512: przy "SYS.DBMS_ISCHED", linia 135 ORA-06512: przy "SYS.DBMS_ISCHED", linia 2605 ORA-06512: przy "SYS.DBMS_SCHEDULER", linia 2113 ORA-06512: przy linia 12 – Eve Jan 21 '16 at 10:00
  • It seems that the ORA exception appeared because the chain (job) is still running (I queried user_scheduler_running_chains). Anyway, when I called dbms_scheduler.run_chain(chain_name => 'MY_CHAIN', job_name => 'MY_PREVIOUS_JOB_NAME', start_steps => 'MY_FAILED_STEP'); for not running job, the last (dependent) step was not executed. I want to run one step and have all dependent steps to be executed automatically. – Eve Jan 21 '16 at 11:57
  • I made tests and noticed that next steps will be ran automatically if they depend only on the step we run. Otherwise they will not be ran automatically. The question is: can we force automatic execution of dependent steps? – Eve Jan 22 '16 at 07:49
  • 2
    I finally found the solution. For running chain we can simply do as follows: dbms_scheduler.alter_running_chain('MY_JOB', 'STEP1', 'STATE', 'NOT_STARTED'); All dependent steps will be run automatically. – Eve Jan 27 '16 at 09:14

0 Answers0