Rerun a step in a chain

i want to rerun a step after it was marked as failed.
if step 1 failed notify the dba and invoke step 1 again else invoke step 2.
i wrote the folowing :
DBMS_SCHEDULER.DEFINE_CHAIN_STEP(
chain_name => 'reports.some_chain',
step_name => 'step_1' ,
program_name => 'do_something1');
DBMS_SCHEDULER.DEFINE_CHAIN_STEP(
chain_name => 'reports.some_chain',
step_name => 'step_2' ,
program_name => 'do_something_else');
DBMS_SCHEDULER.DEFINE_CHAIN_STEP(
chain_name => 'reports.some_chain',
step_name => 'step_fail' ,
program_name => 'notify_dba');
DBMS_SCHEDULER.DEFINE_CHAIN_RULE (
chain_name => 'reports.some_chain',
condition => 'step_1 SUCCEEDED',
action => 'START step_2',
rule_name => 'step_1_success'
DBMS_SCHEDULER.DEFINE_CHAIN_RULE (
chain_name => 'reports.some_chain',
condition => 'step_2 SUCCEEDED',
action => 'END',
rule_name => 'step_2_success'
DBMS_SCHEDULER.DEFINE_CHAIN_RULE (
chain_name => 'reports.some_chain',
condition => 'step_1 FAILED',
action => 'START step_fail',
rule_name => 'step_1_failed'
DBMS_SCHEDULER.DEFINE_CHAIN_RULE (
chain_name => 'reports.some_chain',
condition => 'step_fail COMPLETED',
action => 'START step_1',
rule_name => 'step_retry_step_1'
this works fine if step 1 ends successfuly. when step 1 failes and "step_fail" is triggered, step 1 is not being executed again. i cant understand why.
i would also like to know how to use the syntax for 'AFTER X SECONDS START step'.
thanks !

Hi,
The reason this doesn't work is that once step1 has is in a completed state the rules will not let it run again.
There is a way to get around this though. In your step_fail program you can set step1 to be not_started yet or you can set step1 to start immediately by directly modifying the running chain e.g.
exec dbms_scheduler.alter_running_chain('chainjob1','step1', 'state', 'RUNNING')
or
exec dbms_scheduler.alter_running_chain('chainjob1','step1', 'state', 'NOT_STARTED')
both of these will run step1 again.
Your notify_dba program can be modified to take the step_name as one of the arguments (define_metadata_argument job subname) so it will know which step failed.
Hope this helps,
Ravi.

Similar Messages

  • Save Hierarchy step in process chain

    Hi All,
    I have a process chain which include the following steps.
    Z* program([for loading multiple hierarchies   |http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/e0d5c74a-8a39-2d10-2d8b-9e1971cb053a]) --> Save hierarchy --> Change run
    In the above scenario, I cannot include a step for the hierarchy save/activate because the hierarchy is not being loaded in this chain through an infopackage.
    And I learned from the [site|http://help.sap.com/saphelp_nw70/helpdata/en/3d/320e3d89195c59e10000000a114084/content.htm], that 'Save hierarchy' has to be included after loading the hierarchial data.
    So, is there any procedure for including any step in process chain for activating the hierarchial master data..?
    If I want write a Z* program for activating hierarchial data, which programs/ function modules are used to activate hierarchial master data..?
    Thanks in advance.

    Hi,
    There is an option in the infopackage used to load hierarchy -- to activate upon loading.
    tick that option and remove the hierarchy name from Save hierarchy variant of the process chain.
    Ticking this option will activate your hierarchy automatically after loading.No need to explicitely save it.
    Hope this helps !!
    Regards,
    Yogita.

  • Adding mail ids & Removing mail ids from the last step of process chain

    Hi
    Can you please guied me how to do this.
    Adding mail ids & Removing mail ids from the last step of process chain.
    Thanks
    Subbu

    You can refer the following thread.
    email alert for process chain
    Still I would suggest to search the forum. There will be many threads and articles on this which can help you out.

  • Run steps in a chain at a specific time frame

    I've got an ETL process running in a scheduler chain. First steps are extracting data from remote servers. Each remote server has it's own time frame in which I can extract the data. Once the window is closing I need to kill the job immediately.
    My question is, Is it possible to define a time frame for single steps in a chain ?
    Other options i'm considering (but all are less favorable)
    Create a job with max_run_duration for each extraction step and manually time the transformation / load chain steps after. Advantage - simple, Disadvantage - A lot of ideal time.
    Same as above but make the transformation / load chain with an event based job to when all extraction jobs are done. Advantage - Less ideal time, Disadvantage - More complex, error prune.
    These two options requires a sniper job to catch JOB_OVER_MAX_DUR event and kill the job.These options also require breaking up the chain - something I would like to avoid. Another option that keeps the chain intact is
    Defining the step rule with a time based condition (and using low evaluation_interval ~ 60 seconds) But then I cannot set max_run_duration and there for cannot stop the job if it's working when the time frame is closing.
    I would appreciate any ideas on solving this problem.

    Hello,
    You can for instance execute the following when you create your Refresh Group:
    BEGIN
    DBMS_REFRESH.MAKE(
    name => '"{color:red}schema{color}"."{color:red}refresh_group_name{color}"',
    list => '',
    next_date => TRUNC(SYSDATE) + 1 + 1/24,
    interval => 'TRUNC(SYSDATE) + 1 + 1/24',
    implicit_destroy => FALSE,
    lax => FALSE,
    job => 0,
    rollback_seg => '{color:red}rollback_segment{color}',
    push_deferred_rpc => TRUE,
    refresh_after_errors => TRUE,
    purge_option => NULL,
    parallelism => NULL,
    heap_size => NULL);
    END;
    /Then you add your MV to the Refresh Group as follow:
    BEGIN
    DBMS_REFRESH.ADD(
    name => '"{color:red}schema{color}"."{color:red}refresh_group_name{color}"',
    list => '"{color:red}schema{color}"."{color:red}MV_name{color}"',
    lax => TRUE);
    END;
    NB: The syntax and option can change with the Release (this syntax is well tested on 8.1.7).
    Hope it can help.
    Best regards,
    Jean-Valentin
    Edited by: Lubiez Jean-Valentin on Dec 16, 2009 9:04 AM

  • Error on step in process chain

    Hello All,
    I have just scheduled a process chain immediately and it is running. One step (A full update) has gone red with error "Object requested is currently locked by user DCKIBUUK" - DCKIBUUK is my username. 11 out of 26 Data Packages have processesed OK. Data Package number 12 is where the error occured. Please advise on what to do.
    Thank you and kind regards,
    Keith

    The first thing is to unlock the node of the process chain which has been locked by you. So you need to come out of the  infopackage in question.
    Now, right-click on the node that failed and use the "Repeat" option. If the repeat does not exist , you have 2 options :
    1. manually run the remaining steps
    2. Manually make the system believe that the failed node went in successfully by forcing the status of the step to "G".
    Hope this helps .

  • Can we schedule steps in Job Chain to run at a particular time of the Day.

    Hi ,
    We have created a Job chain for 3 steps.our requirement is we want to step 1 to run as per the schedule of Job chain but we want  step2 to run on fri 2 gmt and step 3 to run on saturday 1 gmt.
    is ther any setting in Job chain so that we can schedule subsequent steps to run at a particular time.
    Regards
    Rajesh

    Hi,
    You can add a timewindow to the jobdefinitions that you call in step 2 and 3, to restrict the start times for these jobs to the desired time.
    Regards,
    Anton.

  • "Save Hierarchies" step in Process chain getting failed

    Hello all,
    After searching thoroughly through various links / forums, i failed to get a solution. So, I am posting here.
    Recently we had a system copy. After that, in Quality system - "Save all Hierarchies" step in PC is getting failed.
    I ran the process chain for 3 times till now:
    1) Sometimes, it fails at batch monitor itself with UNCAUGHT_EXCEPTION runtime error.
    2) Sometimes, it fails saying "Error 0 when reading PSA 1" & "No hierarchy found for the selection criteria entered".
    When it fails with "Error 0 when reading PSA 1", then the above Hierarchy info package which is green automatically turns RED again with Process monitor saying "No PSA tables for the selection criteria".
    I also went through the below sdn links.
    http://scn.sap.com/thread/278794
    http://scn.sap.com/thread/1753212
    Things I did:
    1) Tried replicating & activating the Transfer rules and Data source.
    2) Repeated the step, as suggested in one post.
    3) Refreshed the OLTP hierarchies in Infopack. selections.
    I have attached a screenshot of a sample Data source which says Modified, though the transfer rules are active. Also, the process chain sample.
    Please let me know, if someone has faced this issue. Whatelse did I miss? Any clue.
    Thanks,
    Vikranth.

    Hi Raman,
    I couldn't retransport, but i removed it from schedule and re-activated it. But, i think the issue lies with one of the Info objects 0PROFIT_CTR.
    Because, when i tried to check the hierarchy structure; there are duplicate entries for one code. Can we delete one of them? Is it preferable.
    I tried using OSS and used a program RSR_REPAIR_INFOAREAHIER but this showed no errors.
    Any clue?
    Thanks,
    VIkranth

  • Error in First step of Process Chain

    Hi everybody,
    i have created a process chain with a start process (direct scheduling) to InfoPackage to load into InfoCube-so delete indexes and generate indexes were automatically inserted becoz of default chain option.
    i have checked the chain-- the message was chain is ok but when i activated the chain it gave a error message job-delete index cannot be scheduled return code-8. In addition to this, i checked the status of indexes and DB statastics at cube level and it's showing green light. Further to that, when i checked sytem log, it is displaying
    "> illegal values in step one....the Job_submit was not defined
    properly..???"
    Any inputs to this topic highly appriciated.
    Thanks and Regards,
    ~Sapins

    Make sure you have the following steps in order in your process chain.
    1.Start Process Variant.
    2.Delete Indexes step.
    3.Load data.
    4.Create Indexes.
    5.Roll up (if required)
    6.Compression(if required)
    7.Completion job.
    8.PSA deletion(if required)
    I process chain should allways start with a start Process variant step.
    Thanks,
    Uma Srinivasa Rao

  • No repeat option available for the process step in process chain

    If the process chain failed at the ODS activation level, generally the repeat option will be available for activation and to continue the next step. But in some cases the repeat option will not be available for the process step.
    Is there any process to get the repeat option in the process chain?

    You can change this in RSPC > Settings > Maintain process types > Loading (or process of your interest) > put the check mark for Repeatable.

  • Hierarchy failure in "Save hiererachies' step in process chain.

    Hi,
    In process chain I am getting an error stating hierarchy loaded with requestXXXXXXXXXXXXX could not be activated.
    step: Save hierarchies.
    even though the above step is in failure state, the chain execution gets completed with status red.
    temporary solution:
    we are manually turning the status to green through program(SE38- rspc_process_finish).
    this happening on every time the chain has run.
    any suggestions on this for a permanent fix.
    thanks
    ameer.

    Hi,
    There is an option in the infopackage used to load hierarchy -- to activate upon loading.
    tick that option and remove the hierarchy name from Save hierarchy variant of the process chain.
    Ticking this option will activate your hierarchy automatically after loading.No need to explicitely save it.
    Hope this helps !!
    Regards,
    Yogita.

  • Failing at ACR step in process chain?

    Hi,
      Could any body explain on this topic?
    In process chain job mostly the chain was failing at ACR(attribute change run) step. that it is materdata ACR step.i want permanent solution for this step? I want find why this ACR step is failing weekly twice not regularly.
    So,plz any body help on this..
    Thanks&regards,
    Goodyear.

    What is happening here is that while the ACR process is trying to run in one chain(the main MD chain) most probably another chain is already getting kicked off before the MD chain and its ACR process is RUNNING while the main MD chain's  ACR process is trying to kick off.
    -Try to have sufficient spacing between the process chain batch scheduling runs so that 2 ACR processes NEVER clash.
    -An ACR process while running,locks the MD tables and so no MD loads on those said infoobjects should kick off while the ACR process is running.
    -goto Tools->Attr/Change run.It does contain a short log of the past ACR runs.Maybe u can get details about..at which day/time ACR process taking long time.
    -Recommend that u have single ACR process at the end of the MD load chain.U can even have a meta chain having all MD chains as local chains and then put an AND collector from the local chains and map it to a ACR process.Right click on the ACR process and then insert the list of all MD infoobjects that are being loaded in all the local chains.
    cheers,
    Vishvesh

  • Decision Step in Process chain

    Hello All,
    I have a meta chain which run at 00:30 midnight everyday.
    It consist of 4 sub process chain.
    The last process chain consist of decision step in it.
    This last process chain should run only at first friday of every month.
    For this reason this decision step is included in it.
    It consist of the following formula.
    "( ( Local Time > '17:00:00' ) AND ( DATE_WEEKDAY1( Local date + 1 ) = '6' ) AND ( RIGHT( 2, ( Local date + 1 ) ) <= '07' ) ) OR ( ( Local Time <= '17:00:00' ) AND ( DATE_WEEKDAY1( Local date ) = '6' ) AND ( RIGHT( 2, ( Local date ) ) <= '07' ) )"
    Till now the process chain had never executed at 1st friday of every month.
    The third sub process chain finishes at 3:30 everyday. So due to that the local time of starting the 4th process will be 3:32 and then this decison checks.
    The first condition fails as the local time is <17:00:00 and not  > 17:00:00.
    Hence it will move to the other OR condition.
    But friday is weekday '05' and not as '06' hence again the second condition is failing. Hence the process chain is not executed at first friday.
    After doing this small change also what further more changes should be done in the formula which will help me to execute that chain only at first friday of every month and for rest day it should not execute.
    Points will be assigned for helpful answere.

    The decision step is fine and making changes in the formulae would be ideal but another alternative is through restrictions in the start step for the 4th process chain w.r.t the calenday you will choose. You can restrict it to a particular day for the month with marking only 1st Friday for every month as workday

  • How can I define a function in "decide" step in process chain?

    Hi guys,
    I have a process chain und want to use the "decide" step in this process chain. It seems possible that a funktion can be created ( "Customer defined"  ) in this step. But how can I create it and how can I check the available code?
    Thanks for any hint!
    Regards,
    Youyou

    It's a helpfel document!
    But I steel have a question:
    I want to use a self-defeind function. And I also see it is possible to use such function here.
    But I am not sure how I can define this function, via BADI?
    And how can I use this function here. (Maybe if I can define it, then it shows automatically...)
    Regards,
    Liying

  • Failure of infopackage step in process chain - Error in source system.

    Hello Experts,
    We are experiencing this during the execution of process chain.
    All the step for data loads within BW(DSO to DSO, DSO to cube) are failing with error -
    - Error in source system
    - Error during data selection
    Please note that we are 3.5 data flow and thus, data load within BW is through emulated data source and the infopackage. Steps running such  infopackages for emulated data source are failing in process chain with error above.
    Surprisingly, when I run the infopackage manually out of process chain it runs successful without any error. But when I run through process chain it fails.
    Any clue or suggestion? We have already tried doing re-initialization for infopackage.
    Appreciate your inputs.
    Regards,
    PK.

    Hi,
    When we run data loads thru process chain it will run in background. as per the available background application servers your request will be processed.
    as my your during your load time server will be on high load.
    please check your system busy schedule and schedule your process chains.
    Check Tx - SM50, if you have less application servers, then ask basis to create few more to application servers to process the request at busiest time.
    check about increasing parallel processing and default data transfer settings.
    go to info package---> menu scheduler--> data settings for default data transfer.
    Thanks

  • Failind AND step of process chain

    Hi all
    I am facing problem with AND step in one process chain.
    AND step is failing as soon as chain is triggered.
    All the proceses before AND are executing properly with GREEN Status.
    "This AND process is not waiting for event RSPROCESS, parameter 4BYB726KFX6RHP8SWWPP1CIR9" is the message displayed... parameter mentioned is a DTP.
    Please Help
    Thanks
    SUDEEP

    Did you transport the process chain again?
    Go to edit mode of the process chain, right click on AND, maintain and press Ok ! try to activate the process chain again and see if that shows any error.
    - Danny

Maybe you are looking for

  • How can the words typed in a cell flow naturally into the following pages?

    Pages can make beautiful document which is very good. However, 1. The words that I type into a cell of a Table inside Pages cannot flow naturally onto the next page, it will disappear at the end and I am very frustrated. I need to create another Tabl

  • Regarding Generic Extraction

    Hi Experts, I m new to SAP BW, I need a information regarding Generic Extraction as the senario is follows. I created a table with fields, Customer Id (PK), name, age ***, address and i maintained five records in it. i created a generic master data a

  • How to set up WEB SHOP in R/3 & CRM?

    Hi I want to set up Webshop in both R/3 & CRM & linking of url for CRM B2B transaction. please let me know. -Rohit

  • Why Firefox always opens with last session tabs?

    When I open firefox always opens with last session tabs? How can I fix it?

  • Best way to move to an external boot drive

    I going to move my main iMac boot drive to an external as I need to be able to pick it up and go and use it on the move with my MBP. What is the best way to clone the iMac's internal and then put it on the external. Both drives are 320GB in size. Can