I'm new to developing chains, and want to know how to do the following:
1) I run Step 1
2) If step 1 fails, I want to run Step1 recovery step.
3) When the recovery step completes. I want to re-run Step 1 again.
4) If Step 1 fails for a second time, I want to end the chain, and report/email a failure message.
How do I count the steps, so that I know that Step 1 failed for a second time?
Oracle Database 11g Enterprise Edition Release 126.96.36.199.0 - 64bit Production
PL/SQL Release 188.8.131.52.0 - Production
I think that you must analyze dba_scheduler_job_log view. There is logged job/chain start adn then every step run.
So chain will have step1 and step1check.
There will be rule that run step1check after step1 complete.
In step1check you look to dba_scheduler_job_log to find how step1 finished.
If you found that step1 fails for second time you send an email.
Error_code of step1check will be used to make decision to run setp1 again or to end chain.