This discussion is archived
3 Replies Latest reply: Mar 27, 2013 10:04 AM by rp0428 RSS

Job Chain question

Mr.D. Explorer
Currently Being Moderated
i want to schedule a job chain.
I 've created 4 chain steps.
The first perform an action and the second must be executed only if the first completed successfully.
The third must be executed only if the second ends successfully, etc.

The Chain_rule_2 is
The chain_rule_3 is

But the job is actually running because there isn't an end steps (I suppose).
End step must be done if all steps works fine or if only one failed.

Any ideas?

  • 1. Re: Job Chain question
    Chanchal Wankhade Journeyer
    Currently Being Moderated

    For jobs chain you can refer to below link..
  • 2. Re: Job Chain question
    762492 Newbie
    Currently Being Moderated
    You can add rules in Chains:

    Chain rules define when steps run, and define dependencies between steps. Each rule has a condition and an action. Whenever rules are evaluated, if a rule's condition evaluates to TRUE, its action is performed. The condition can contain Scheduler chain condition syntax or any syntax that is valid in a SQL WHERE clause. The syntax can include references to attributes of any chain step, including step completion status. A typical action is to run a specified step or to run a list of steps.

    All chain rules work together to define the overall action of the chain. When the chain job starts and at the end of each step, all rules are evaluated to see what action or actions occur next. If more than one rule has a TRUE condition, multiple actions can occur. You can cause rules to also be evaluated at regular intervals by setting the evaluation_interval attribute of a chain.

    Conditions are usually based on the outcome of one or more previous steps. For example, you might want one step to run if the two previous steps succeeded, and another to run if either of the two previous steps failed.

    Scheduler chain condition syntax takes one of the following two forms:

    stepname [NOT] SUCCEEDED
    stepname ERROR_CODE {comparision_operator|[NOT] IN} integer

    You can combine conditions with boolean operators AND, OR, and NOT() to create conditional expressions. You can employ parentheses in your expressions to determine order of evaluation.
  • 3. Re: Job Chain question
    rp0428 Guru
    Currently Being Moderated
    Have you looked at the examples in the DBA Guide?
    Examples of Creating Chains
    This section contains examples of creating chains. To create chains, you use the CREATE_CHAIN procedure. After creating a chain, you add steps to the chain with the DEFINE_CHAIN_STEP or DEFINE_CHAIN_EVENT_STEP procedures and define the rules with the DEFINE_CHAIN_RULE procedure.

    Example 28-16 Creating a Chain

    The following example creates a chain where my_program1 runs before my_program2 and my_program3. my_program2 and my_program3 run in parallel after my_program1 has completed.
    . . .
    Example 28-17 Creating a Chain

    The following example creates a chain where first my_program1 runs. If it succeeds, my_program2 runs; otherwise, my_program3 runs.
    . . .


  • Correct Answers - 10 points
  • Helpful Answers - 5 points