How to run chain by defined steps

Dear all,
how to run chain flowing my defined step?
Begin
dbms_Scheduler.Create_Chain(Chain_Name => 'MYTEST_CHAIN');
dbms_Scheduler.Define_Chain_Step(chain_name =>'MYTEST_CHAIN',
                                 step_name =>'mytest_chain_1',
                                 program_name =>'p_step1');
dbms_Scheduler.Alter_Chain(chain_name => 'MYTEST_CHAIN',
                           step_name => 'mytest_chain_1',
                           attribute => 'skip',
                           value => False
dbms_Scheduler.Define_Chain_Step(chain_name =>'MYTEST_CHAIN',
                                 step_name =>'mytest_chain_2',
                                 program_name =>'p_step2');
dbms_Scheduler.Alter_Chain(chain_name => 'MYTEST_CHAIN',
                           step_name => 'mytest_chain_2',
                           attribute => 'skip',
                           value => False
dbms_Scheduler.Enable('MYTEST_CHAIN');
End;I have create chain name 'MYTEST_CHAIN' and contain two steps named 'mytest_chain_1' and 'mytest_chain_2'.
I want to run the chain just as flowing,but it cann't not work,why?
Begin
  Dbms_Scheduler.Run_Chain(Chain_Name  => 'MYTEST_CHAIN',
                           start_steps => Null,
                           Job_Name    => Null);
End;

Hi,
check this link
http://www.oracle-base.com/articles/10g/SchedulerEnhancements_10gR2.php#job_chains

Similar Messages

  • Running Chain Job in Restricted Session

    I have my normal jobs running is Restricted Session
    DBMS_SCHEDULER.SET_ATTRIBUTE('job_name', 'ALLOW_RUNS_IN_RESTRICTED_MODE', TRUE);
    I did the same for my chain job. The chain job starts but the first step doesn't start until out of restricted session.
    I get this if I try to set_attribute on a program
    ORA-27469: ALLOW_RUNS_IN_RESTRICTED_MODE is not a valid program attribute
    ORA-06512: at "SYS.DBMS_ISCHED", line 4436
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 2925
    Is there some way to run the steps of a chain in restricted session?
    11gR2

    Greg Here is an example I created for you. It is very close to what I am doing and I was able to duplicate the problem with it.
    -- replace sch_util.send_mail()   with your own PL SQL code.
    DECLARE
    v_job_name VARCHAR2(32) := 'example_job';
    v_chain_name VARCHAR2(32) := 'example_chain';
    BEGIN
    --drop chain and job
    BEGIN
      DBMS_SCHEDULER.DROP_CHAIN(v_chain_name,TRUE);
    EXCEPTION WHEN OTHERS THEN
      DBMS_OUTPUT.PUT_LINE('Error DROP_CHAIN ' || v_chain_name);
    END;
    BEGIN
      DBMS_SCHEDULER.DROP_JOB(v_job_name, TRUE);
    EXCEPTION WHEN OTHERS THEN
      DBMS_OUTPUT.PUT_LINE('Error DROP_JOB ' || v_job_name);
    END;
    --create all the programs for chain
    DECLARE
      v_pl_sql VARCHAR2(4000) := 'BEGIN sch_util.send_email(''example chain step 1'', ''Hellow world 1''); END;';
      v_prog_name VARCHAR2(32) := 'example_1_prog';
    BEGIN
      --drop program
      BEGIN
       DBMS_SCHEDULER.DROP_PROGRAM(v_prog_name);
      EXCEPTION WHEN OTHERS THEN
       DBMS_OUTPUT.PUT_LINE('Error DROP_PROGRAM ' || v_prog_name);
      END;
      --create program
      DBMS_SCHEDULER.CREATE_PROGRAM (
         program_name           => v_prog_name,
         program_action         => v_pl_sql,
         program_type           => 'PLSQL_BLOCK',  
         enabled                => TRUE,
         number_of_arguments    => 0,
         comments               => 'example chain step 1');
      DBMS_SCHEDULER.SET_ATTRIBUTE (
         name                   => v_prog_name,
         attribute              => 'max_run_duration',
         value                  => interval '240' minute );
    END;
    DECLARE
      v_pl_sql VARCHAR2(4000) := 'BEGIN sch_util.send_email(''example chain step 2'', ''Hello world 2''); END;';
      v_prog_name VARCHAR2(32) := 'example_2_prog';
    BEGIN
      --drop program
      BEGIN
       DBMS_SCHEDULER.DROP_PROGRAM(v_prog_name);
      EXCEPTION WHEN OTHERS THEN
       DBMS_OUTPUT.PUT_LINE('Error DROP_PROGRAM ' || v_prog_name);
      END;
      --create program
      DBMS_SCHEDULER.CREATE_PROGRAM (
         program_name           => v_prog_name,
         program_action         => v_pl_sql,
         program_type           => 'PLSQL_BLOCK',  
         enabled                => TRUE,
         number_of_arguments    => 0,
         comments               => 'example chain step 1');
      DBMS_SCHEDULER.SET_ATTRIBUTE (
         name                   => v_prog_name,
         attribute              => 'max_run_duration',
         value                  => interval '240' minute );
    END;
    -----------------------------Start Chain Definition -----------------------------------
    DBMS_SCHEDULER.CREATE_CHAIN (
         chain_name            =>  v_chain_name,
         comments              =>  'Example chain!');
    --- define steps for this chain.
    DBMS_SCHEDULER.DEFINE_CHAIN_STEP(v_chain_name, 'example_step1', 'example_1_prog');
    DBMS_SCHEDULER.DEFINE_CHAIN_STEP(v_chain_name, 'example_step2', 'example_2_prog');
    -- define corresponding rules for the chain.
    DBMS_SCHEDULER.DEFINE_CHAIN_RULE(v_chain_name, 'TRUE', 'START example_step1');
    DBMS_SCHEDULER.DEFINE_CHAIN_RULE(v_chain_name, 'example_step1 SUCCEEDED', 'START example_step2');
    DBMS_SCHEDULER.DEFINE_CHAIN_RULE(v_chain_name, 'example_step2 COMPLETED', 'END');
    -- enable the chain
    DBMS_SCHEDULER.ENABLE(v_chain_name);
    --- create a chain job to start the chain 
    DBMS_SCHEDULER.CREATE_JOB (
         job_name        => v_job_name,
         job_type        => 'CHAIN',
         job_action      => v_chain_name,
         start_date    => '6-AUG-2014 9.35.00 AM AMERICA/CHICAGO',
         enabled         => FALSE);
       DBMS_SCHEDULER.SET_ATTRIBUTE(v_job_name , 'max_run_duration' , interval '4' hour);
       DBMS_SCHEDULER.SET_ATTRIBUTE(v_job_name, 'raise_events',DBMS_SCHEDULER.JOB_FAILED);
       DBMS_SCHEDULER.SET_ATTRIBUTE(v_job_name, 'ALLOW_RUNS_IN_RESTRICTED_MODE', TRUE);
       DBMS_SCHEDULER.ENABLE(v_job_name);
    END;

  • How to run Oracle workflow in windows 7 os

    Hi,
    Am new to oracle workflow.
    I have installed oracle workflow successfully in my laptop.
    After installation I dont see any shortcut's in my desktop.
    Can any one sugess me how to run oracle workflow.
    Steps to begin from basic level.
    Thanks
    Balaji

    You mean to say you installed Workflow Builder on your laptop? See that Oracle Workflow has a Client Side (WF Builder), a backend Server side and middle application side.
    Assuming you successfully installed the client side then you must have a group of programs called Oracle OUIHome and there one called Application Development. There you should be able to find Workflow builder.
    Useful notes for WF Builder:
    How To Download and Install the Latest Oracle Workflow Builder (Client Tool) and XML Gateway Message Designer for E-Business (Doc ID 261028.1)
    which leads to <internal URL removed>
    Regards.

  • How to run group solve with the batch manager

    I'd like to know if it is possible (and how) to run group solve defined in OFA with the batch manager.
    Thank you
    Luigi Polverini
    Synesis s.r.l.

    OFA uses its Task Processor rather than Batch Manager to run tasks in batch. Group solves can be scheduled this way by submitting the group solve task to the TP, and then rescheduling it in the Task Queue window.
    null

  • How i run that delta infopackage in my process chain

    Hello Sir,
    i have a delta infopackage which sciduled in a process chain but it does not pick any delta i have to manualy run repair full infopackage dally and then delta comes in to picture my target is a dso so it does't have any problem.
    the datasourse is costamize
    delta pointer is cal day
    my question is how i run that delta infopackage in my process chain
    Thanks...

    Hi
    IS the process type "delta infopackage " is executing in the process chain or not? Plz once check in SM37 Tcode . and Why r u running the repair full request infopackage . If u miss any delta records then only u have to run the repair full request . If delta records are not extracted then better to manually extract the delta infopackage.
    Plz once check in SM37 Tcode whether the execute infopackage process step is running or not? or any error has occured in that PC.
    Thanx & Regards,
    RaviChandra

  • How do we create user defined Task in OM & Which report we run for the Task

    Hi
    How do we create user defined Task in OM & Which report we run for the Task.
    Regards
    Rajesh

    You can create tasks using PFCT or path: Human resources> Organizational management> Expert mode> Task catalog in Easy access.
    Check this link may be useful for you: http://help.sap.com/saphelp_40b/helpdata/pt/fb/135d89457311d189440000e829fbbd/content.htm

  • How to run process chains

    hi,
    this is sudhakar
    pls any one tell me
    I prepaired process chain
    but i dont know how to start how it run daily automatically
    pls any one give ans
    thanks
    sudhakar

    hi,
       open your process chain -> right click on start process ->  select maintain varient -> select direct scheduling -> goto change selections tab -> select date/time give from when you want to run for eg from today 3.00 PM means in date tab give todays date and in time tab give the time info.  in bottom select periodic jobs check box and click on periodic values tab -> here select daily check and save again check and save again save. now you schedule your job at 3.00PM from today, now you need to release this job, after this settings come to your process chain click on clock symbol to activate and schedule your process chain. so this chain will run at specified time, you can check this in SM37 by giving your user name and released job as job status.
    Regards
    Sankar

  • How to run change run in process chain when it fails

    HI All,
    How to run  attribute change run in process chain when it fails. Give me the procedure with clear description. Is there is any difference with 3.x versions in running this.
    Thanks,
    Pratap Reddy

    Hi Pratap.
    If BI Accelerator is not being implemented by ur company, in that case if change run fails u'll proceed by 'Repeat' process option as usual we do in 3.x.
    If BIA is exists, in this scenario u can not repeat as we do in 3.x. U have to drop the indexes on cubes effecting that change run and run the change runs. Once it is finished recreate BIA Indexes on cubes.
    Warm Regards,
    Ramki

  • Please help me how to define step by step multi level a hierarchy in BW?

    Hi expert.
    Please help me how to define step by step multi level a hierarchy in BW?
    HieuLM
    Edited by: hieulm_VietNam on Oct 11, 2011 11:21 AM

    Hi all,
    I want to create a Hierarchy base on Product hierarchy attribute in 0Material characteristic.
    I want 4 level :
    1. SBU
    2. BRAND
    3. SUBBRAND
    4. Material Number
    In Product hierarchy I have a string store 4 level like 01.001.0001
    Ex :
    01 : is BUNS (SBU)
    001 : is ALOHA (BRAND)
    0001 : is FRESH (SUBBRAND )
    Please help me how to capture this information like that, I want to drill down by level examble drill down from SBU to BRAND,...
    Thanks
    HieuLM

  • How to run javascript step by step

    I write a javascript function.
    I want to the javascript can run line by line. For example, after finishing sumbit, then, it will run following code. However, the form is big, and saving variables to database need time. Therefore, rest code run before database finish saving form variables.
    How to run the rest code after database finish transactions?
    function processSaveZB(){
              document.getElementById("businessForm").action="${pageContext.request.contextPath}/pages/compreApp/compreApp_createGdjbxxzb.action";
              document.getElementById("businessForm").submit();           
              for(var v=0; v<allrows.length; v++){
                   var url='${pageContext.request.contextPath}/pages/compreApp/compreApp_createTdytNew.action';
    ...........run action......................
    window.close();
    }

    I write a javascript function.Then you're in the wrong place. This is a Java Programming forum, not JavaScript. Locking.

  • Can any please post detail steps of how to run XMLPostUtility using CSElement

    I want a details of XMLPost Utility .
    How to run XMLPostUtility directly?
    Can I do it using CSElement?
    Anyone having sample code to run XMLPostUtility?

    Hi ,
    In that case the correct forum to post this question is : https://forums.oracle.com/community/developer/english/fusion_middleware/webcenter/webcenter_sites
    Thanks,
    Srinath

  • How to run Assignment in Series - Workflow can not connect two Assignments

    Here is my scenario:
    I have a custom repository with no Taxanomy table.
    I want to run series of Assignments.
    I defined 5 assignments.
    Thought that I can use MDM Workflow to call them in series. However MDM Workflow does not let me connect one Assignmen Task to next Assignment Task.
    How to run Assignments in Series, either using Workflow or by using someother mechanism.
    Idealy it could have been nice to Group the Assignments like Validation.
    Or even Much better powerful Assignment and Validation Script. Add "Script Documentation" to that please.
    Thanks,
    Abhay

    I tested with 2 assignments.
    I created 2 assignments.
    My workflow definition has a Start, Assign1, Assign2, Stop.
    Start -> Assign1
    Assign1 -> Assign2
    Assign2-> Assign3
    They are connected in Series.
    Make sure all the steps are connected properly.
    I executed the workflow and the two fields in the table got the assigned values as the result of the workflow.
    Check the version of your Data Manager. The DataManager I used to test this is of version 5.5.34.26.
    A single workflow should suffice for your requirements.
    However, there is a workaround for this.
    You create 5 workflows each with a single assingment step.
    For the <b>Stop Step</b> in the Workflow you have <b>Launch</b> Property.
    In this case, for workflow1 you set the launch property to Workflow2.
    For workflow2 set the launch property as workflow3.
    This way you are calling separate workflows sequentially.

  • How to use a user defined function in XI

    Hi Experts,
    I would like learn how to use a user defined function  in Xi during mapping . Is there any step by step on that.
    Besides during when me make communcaton channels I see the following tabs...Paramters ..Identifiers ...Module...
    The module that is given here ...where and how it is used.

    Hi,
    You can write UDFs in java in Graphical mapping to enhance your XI Graphical mapping functionality
    The steps for doing it would be:
    1. Click on Create New function Button found on Bottom left corner on your XI Mapping window.
    2. Write your java code.
    3. Run the Mapping Test as usual.
    >>The module that is given here ...where and how it is used.
    The adapters in the Adapter Framework convert XI messages to the protocols of connected external systems and the other way around. When doing so, some
    functionality might need to be added specific to a situation which is possible with the use of custom modules.
    Typical example would be validation of file content when using a File Adapter or modification of the message payload to a common content structure which is not supported by any of the standard SAP modules.
    An Adapter module is developed as an Enterprise Java Bean and is called locally by the Adapter.
    An example on modules :
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/da5675d1-0301-0010-9584-f6cb18c04805">How to develop a module for reading file name in a sender file adapter XI 3.0</a>
    Cheers,
    Chandra

  • How to Run a Report automatically in Background for every night

    Hi,
    How to run a report program in Background automatically for every nigh.
    Thanks
    Ramesh

    Hi Ramesh,
    You can use SM36 and use the "Job Wizard" to define a background job in simple step by step procedure
    Or
    Goto SM37 and specify a job name.
    Next specify the ABAP Program Name of the report you want to execute under Job Step.
    Then click on "Extended Job Selection" and goto the Period Tab.
    There select "Only Periodic Jobs" and then specify the frequency of execution based on Months, Weeks, Days, Hours or Minutes.
    Hope this helps,
    Regards,
    Madhur
    Message was edited by: Madhur Chopra

  • How to run a report in back ground

    how to run a report in background with out using job open, submit , close is there any other function module to run report in background.

    Hi,
               There are two ways for you to handle,
    one manually setting up the job through SM36 which is better and convinient,
    secondly through program using FM's JOB_OPEN, SUBMIT, JOB_CLOSE.
    Find below steps in doing both:
    Procedure 1:
    1. Goto Trans -> SM36
    2. Define a job with the program and variant if any
    3. Click on start condition in application tool bar
    4. In the pop-up window, click on Date/Time
    5. Below you can see a check box "Periodic Job"
    6. Next click on Period Values
    7. Select "Other Period"
    8. Now give '15' for Minutes
    9. Save the job
    Procedure 2 via Program:
    Below is a sample code for the same. Note the ZTEMP2 is the program i am scheduling with 15mins frequency.
    DATA: P_JOBCNT LIKE TBTCJOB-JOBCOUNT,
    L_RELEASE(1) TYPE c.
    CALL FUNCTION 'JOB_OPEN'
    EXPORTING
    JOBNAME = 'ZTEMP2'
    IMPORTING
    JOBCOUNT = P_JOBCNT
    EXCEPTIONS
    CANT_CREATE_JOB = 1
    INVALID_JOB_DATA = 2
    JOBNAME_MISSING = 3
    OTHERS = 4.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    SUBMIT ZTEMP2 VIA JOB 'ZTEMP2' NUMBER P_JOBCNT
    TO SAP-SPOOL WITHOUT SPOOL DYNPRO
    WITH DESTINATION = 'HPMISPRT'
    WITH IMMEDIATELY = SPACE
    WITH KEEP_IN_SPOOL = 'X' AND RETURN.
    CALL FUNCTION 'JOB_CLOSE'
    EXPORTING
    JOBCOUNT = P_JOBCNT
    JOBNAME = 'ZTEMP2'
    STRTIMMED = 'X'
    PRDMINS = 15
    IMPORTING
    JOB_WAS_RELEASED = L_RELEASE
    EXCEPTIONS
    CANT_START_IMMEDIATE = 1
    INVALID_STARTDATE = 2
    JOBNAME_MISSING = 3
    JOB_CLOSE_FAILED = 4
    JOB_NOSTEPS = 5
    JOB_NOTEX = 6
    LOCK_FAILED = 7
    INVALID_TARGET = 8
    OTHERS = 9.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Hope the above helps you.
    <b>Reward points</b>
    REGARDS

Maybe you are looking for

  • == ERROR: arch contains invalid characters: ','

    I been using GNU/Arch Linux for few weeks now. One program I liked for Ganoo/Leenox was "screencloud", it let me bind hotkeys to draw a square then snap a screenshot and upload it to my FTP server. So I typed 'yaourt screencloud', It fails to install

  • How to pass pdf documents through idocs

    I wanted to know how to pass pdf document along with a transaction code like sales order or travel expense manager with the help of IDOCs.

  • Access at account record level

    I have account data for subsidiaries in 11 different countries and need to setup some access rights for all the users. Each user will be allowed to access all accounts in his own country. However he should not be able to view accounts of another coun

  • Sharing files between pc and mac using ipod ?

    I have a PC at work and Mac at home. My work email only allows 10MB enclosures and my work files are often 100MB. I want to take the files and not the processor home to work on. Can i do this using my colour iPod ? What i did is format the iPod on th

  • Downloading already purchased itunes items?

    I had purchased a few tv series on my itunes account however recently my computer crashed completely. I had to buy a new computer and was able to sign into itunes but can't watch my purchases without re-purchasing them. How can i download them again?