Alter chain (step) - restart_on_failure

I have got Oracle 11gr2 I use dbms_scheduler, it works fine. :o)
I'd like to use 'RESTART_ON_FAILURE'-mechanism in my chain and if it is possible, in my chain steps. But not with default Oracle settings
Oracle PlSql Packages reference, on page 128-41 ->
'RESTART_ON_FAILURE' - If set to TRUE for a step and the step fails due to an application error, then the step is retried using the normal Scheduler retry mechanism (after 1 second, after 10 seconds, after 100 seconds, and so on, up to a maximum of 6 times). If all 6 retries fail (after about 30 hours), then the chain step is marked FAILED. If this attribute is set to FALSE (the default), a failed chain step is immediately marked FAILED.
Can I set number of retries (not need 6 -> it is enough 3 for me)?
And can I set constant number of seconds for (e.g. 100 sec) for all retries?
Is it possible setting these parameters for chain steps too?
What can I do in this case (3 retries with 3x100 sec retries) if "no" is the answer for all above question?
Thanks a lot for any kind of information
Edited by: user6244574 on 2011.03.07. 5:45

1st idea:
Oracle® Business Activity Monitoring - Architect User's Guide 10g (10.1.3.1.0) - B28992-01
http://download.oracle.com/docs/cd/B31017_01/integrate.1013/b28992.pdf
Usage:
http://<host>:<http_port>/oraclebam
Documentation:
■ Oracle Business Activity Monitoring Installation Guide
■ Oracle Business Activity Monitoring Administrator's Guide
■ Oracle Business Activity Monitoring Active Studio User's Guide
You can read this kind of information ;)
Setmonitoring [name=plan_name]
*[restartonfailure=never|always|count]*
*[restartfrequencymax=none|count_in_minutes]*
2nd idea: MAX_FAILURES,FAILURE_COUNT,RETRY_COUNT with DBMS_SCHEDULER.SET_ATTRIBUTE ???? (But it is possible, only the Oracle Scheduler can change these attributes during processing)
select JOB_NAME,JOB_SUBNAME,MAX_FAILURES,FAILURE_COUNT,RETRY_COUNT from ALL_SCHEDULER_JOBS ;
select JOB_NAME,JOB_SUBNAME,FAILURE_COUNT,RETRY_COUNT from ALL_SCHEDULER_JOB_DESTS ;
select PROGRAM_NAME,MAX_FAILURES from ALL_SCHEDULER_PROGRAMS ;
Edited by: user6244574 on 2011.05.12. 3:14

Similar Messages

  • Scheduled Chained Steps

    I've been trying to create a Scheduler Chain in Oracle 11.2 to kick off steps based off of a schedule.  Below is an example script I used to attempt this, what I would like is Step1 to execute with the start of the chain, then Step2 to execute on a schedule, then Step3 to execute once Step1 and Step2 are complete.  This is for a nightly process where Step1 would execute at midnight, then Step2 would execute at 1AM.  The step I'm having issues with is defining the start of Step2 is at line 134.
    I also couldn't find an example of using DBMS_SCHEDULER.DEFINE_CHAIN_EVENT_STEP using the event_schedule_name overload, so if anyone has come across one please share.
    /* CREATE TABLE */
    Create table chain_table
        chain_ts timestamp default current_timestamp,
        chain_step varchar2(100)
    /* CREATE PROCEDURE */
    create procedure chain_test_proc
        step_name in varchar2
    ) as
    begin
        execute immediate 'insert into chain_table (chain_step) values (:1)'
        using step_name;
        commit;
    end chain_test_proc;
    /* CREATE SCHEDULE */
    begin
        dbms_scheduler.create_schedule
            repeat_interval  => 'FREQ=MINUTELY;',   
            start_date => to_timestamp_tz('2014-03-17 12:14:00.000000000 AMERICA/CHICAGO','YYYY-MM-DD HH24:MI:SS.FF TZR'),
            comments => 'Runs minutely for testing',
            schedule_name  => '"STEP2_SCHEDULE"');
    end;
    /* CREATE PROGRAMS */
    begin
        dbms_scheduler.create_program
            program_name => 'STEP1_PROGRAM',
            program_action => 'CHAIN_TEST_PROC',
            program_type => 'STORED_PROCEDURE',
            number_of_arguments => 1,
            comments => null,
            enabled => false
        dbms_scheduler.define_program_argument
            program_name => 'STEP1_PROGRAM',
            argument_position => 1,
            argument_name => 'STEP_NAME',
            argument_type => 'VARCHAR2',
            default_value => 'STEP1',
            out_argument => false
        dbms_scheduler.create_program
            program_name => 'STEP2_PROGRAM',
            program_action => 'CHAIN_TEST_PROC',
            program_type => 'STORED_PROCEDURE',
            number_of_arguments => 1,
            comments => null,
            enabled => false
        dbms_scheduler.define_program_argument
            program_name => 'STEP2_PROGRAM',
            argument_position => 1,
            argument_name => 'STEP_NAME',
            argument_type => 'VARCHAR2',
            default_value => 'STEP2',
            out_argument => false
        dbms_scheduler.create_program
            program_name => 'STEP3_PROGRAM',
            program_action => 'CHAIN_TEST_PROC',
            program_type => 'STORED_PROCEDURE',
            number_of_arguments => 1,
            comments => null,
            enabled => false
        dbms_scheduler.define_program_argument
            program_name => 'STEP3_PROGRAM',
            argument_position => 1,
            argument_name => 'STEP_NAME',
            argument_type => 'VARCHAR2',
            default_value => 'STEP3',
            out_argument => false
        dbms_scheduler.enable ('STEP1_PROGRAM');
        dbms_scheduler.enable ('STEP2_PROGRAM');
        dbms_scheduler.enable ('STEP3_PROGRAM');
    end;
    begin
    /* CREATE CHAIN */
        sys.dbms_scheduler.create_chain
            chain_name          => 'MY_CHAIN',
            rule_set_name       => null,
            evaluation_interval => null,
            comments            => null
    /* CREATE CHAIN STEPS */
        sys.dbms_scheduler.define_chain_step
            chain_name          => 'MY_CHAIN',
            step_name           => 'STEP1_PROG',
            program_name        => 'STEP1_PROGRAM'
        sys.dbms_scheduler.define_chain_step
            chain_name          => 'MY_CHAIN',
            step_name           => 'STEP2_PROG',
            program_name        => 'STEP2_PROGRAM'
        sys.dbms_scheduler.define_chain_event_step
            chain_name          => 'MY_CHAIN',
            step_name           => 'STEP2_SCHED',
            event_schedule_name => 'STEP2_START_SCHEDULE'
        sys.dbms_scheduler.define_chain_step
            chain_name          => 'MY_CHAIN',
            step_name           => 'STEP3_PROG',
            program_name        => 'STEP3_PROGRAM'
    /* CREATE CHAIN RULES */
        -- Start of Chain
        sys.dbms_scheduler.define_chain_rule
            chain_name          => 'MY_CHAIN',
            condition           => 'TRUE',
            action              => 'START STEP1_PROG',
            rule_name           => 'STEP1',
            comments            => null
        -- Step having issues with
        sys.dbms_scheduler.define_chain_rule
            chain_name          => 'MY_CHAIN',
            condition           => 'STEP2_SCHED COMPLETED',
            action              => 'START STEP2_PROG',
            rule_name           => 'STEP2',
            comments            => 'Runs on a schedule'
        -- Last step
        sys.dbms_scheduler.define_chain_rule
            chain_name          => 'MY_CHAIN',
            condition           => 'STEP1_PROG COMPLETED AND STEP2_PROG COMPLETED',
            action              => 'START STEP3_PROG',
            rule_name           => 'STEP3',
            comments            => null
        -- End Chain
        sys.dbms_scheduler.define_chain_rule
            chain_name          => 'MY_CHAIN',
            condition           => 'STEP3_PROG COMPLETED',
            action              => 'END',
            rule_name           => 'END_CHAIN',
            comments            => null
    /* ENABLE CHAIN */
        dbms_scheduler.enable (name => 'MY_CHAIN');
    end;
    /* RUN CHAIN */
    -- exec dbms_scheduler.run_chain (chain_name => 'MY_CHAIN', start_steps => null, job_name => null);
    /* ROLLBACK
        -- Drop Chain
        exec dbms_scheduler.drop_chain ('MY_CHAIN');
        -- Drop Programs
        exec dbms_scheduler.drop_program ('STEP1_PROGRAM, STEP2_PROGRAM, STEP3_PROGRAM');
        -- Drop Schedule
        exec dbms_scheduler.drop_schedule ('STEP2_SCHEDULE');
        -- Drop table
        drop table chain_table;
        -- Drop procedure
        drop procedure chain_test_proc;

    Hi,
    Another possible workaround I thought about: play with the PAUSE attribute of the chain.
    When your chain starts, alter it inside program1 to pause Step2:
    DBMS_SCHEDULER.ALTER_CHAIN(chain_name =>'MY_CHAIN',
                               step_name  => 'STEP2_PROG',
                               attribute  => 'PAUSE',
                               value      => TRUE
    Create an independant scheduler job to alter the PAUSE attribute of the chain:
    DBMS_SCHEDULER.CREATE_JOB(job_name       => 'ALTER_MY_CHAIN_JOB',
                              job_type       => 'PLSQL_BLOCK',
                              job_action     => 'BEGIN
                                                      DBMS_SCHEDULER.ALTER_CHAIN(chain_name =>''MY_CHAIN'',
                                                                                 step_name  => ''STEP2_PROG'',
                                                                                 attribute  => ''PAUSE'',
                                                                                 value      => FALSE
                                                 END;',
                              repeat_interval => 'FREQ=DAILY;BYHOUR=1',
                              enabled         => TRUE,
                              auto_drop       => FALSE
    This job will run everyday at 1am to set the PAUSE attribute to FALSE for the chain. This way the chain should restart.   
    Again, it's a suggestion, needs to be tested!

  • Export scheduler job but chain step and chain rule failed with ORA-24150 ORA-06512 during executed sql script.

    Hi Folks,
    I used expdp utility to export all Oracle scheduler jobs and chains with below method, after that generate sql script by impdp, later on executing sql script encountered some errors.
    Only chain step and chain rule for executing script. Does anyone bright me some light? Thanks!
    My env: Oracle 11g + Oracle Linux 5.5
    My steps as below:
    1. export(expdp) oracle scheduler job(chain)
    2. generate sql script by impdp.
    3. remove orginal scheduler job(chain)
    4. execute sql script
    5. job with no chain well but job with chain failed
    [oracle@linux1 ~]$ expdp scott/tiger directory=db_dump_dir dumpfile=scott_job.dmp include=procobj:\" in \(select \
    > name from sys.obj$ where type\# in \(46,59,66,67,68,69,72,74,79\)\)\"  schemas=scott
    Export: Release 11.2.0.1.0 - Production on Tue Dec 3 17:42:31 2013
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options
    Starting "SCOTT"."SYS_EXPORT_SCHEMA_01":  scott/******** directory=db_dump_dir dumpfile=scott_job.dmp include=procobj:" in (select name from sys.obj$ where type# in (46,59,66,67,68,69,72,74,79))" schemas=scott
    Estimate in progress using BLOCKS method...
    Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 0 KB
    Processing object type SCHEMA_EXPORT/POST_SCHEMA/PROCOBJ
    Master table "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
    Dump file set for SCOTT.SYS_EXPORT_SCHEMA_01 is:
      /u03/database/usbo/BNR/dump/scott_job.dmp
    Job "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully completed at 17:42:54
    [oracle@linux1 ~]$ impdp scott/tiger sqlfile=scott_job.sql directory=db_dump_dir dumpfile=scott_job.dmp logfile=imp_scott_job.log
    Import: Release 11.2.0.1.0 - Production on Tue Dec 3 17:43:04 2013
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options
    Master table "SCOTT"."SYS_SQL_FILE_FULL_01" successfully loaded/unloaded
    Starting "SCOTT"."SYS_SQL_FILE_FULL_01":  scott/******** sqlfile=scott_job.sql directory=db_dump_dir dumpfile=scott_job.dmp logfile=imp_scott_job.log
    Processing object type SCHEMA_EXPORT/POST_SCHEMA/PROCOBJ
    Job "SCOTT"."SYS_SQL_FILE_FULL_01" successfully completed at 17:43:07
    [oracle@linux1 ~]$ more /u03/database/usbo/BNR/dump/scott_job.
    scott_job.dmp  scott_job.sql 
    [oracle@linux1 ~]$ more /u03/database/usbo/BNR/dump/scott_job.sql
    -- CONNECT SCOTT
    ALTER SESSION SET EVENTS '10150 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '10904 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '25475 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '10407 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '10851 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '22830 TRACE NAME CONTEXT FOREVER, LEVEL 192 ';
    -- new object type path: SCHEMA_EXPORT/POST_SCHEMA/PROCOBJ
    BEGIN
    BEGIN
    dbms_rule_imp_obj.import_rule('"SCOTT"','"CHAIN_RULE_1"','1=1',NULL, 'First link in the chain.',0,NULL);
    END;
    COMMIT;
    END;
    BEGIN
    BEGIN
    dbms_rule_imp_obj.import_rule('"SCOTT"','"CHAIN_RULE_2"',':"CHAIN_STEP_1".COMPLETED = ''TRUE''',NULL, 'Second link in the chain.',0,NULL);
    END;
    COMMIT;
    END;
    BEGIN
    BEGIN
    dbms_rule_imp_obj.import_rule('"SCOTT"','"CHAIN_RULE_3"',':"CHAIN_STEP_2".COMPLETED = ''TRUE''',NULL, 'Third link in the chain.',0,NULL);
    END;
    COMMIT;
    END;
    BEGIN
    BEGIN
    dbms_rule_imp_obj.import_rule('"SCOTT"','"CHAIN_RULE_4"',':"CHAIN_STEP_3".COMPLETED = ''TRUE''',NULL, 'End of the chain.',0,NULL);
    END;
    COMMIT;
    END;
    BEGIN
    BEGIN
    dbms_rule_imp_obj.import_rule_set('"SCHED_RULESET$1"','"SCHED_EV_CTX$1"',NULL, 0);
    END;
    COMMIT;
    END;
    BEGIN
    dbms_scheduler.create_program('"TEST_PROC_1"','PLSQL_BLOCK',
    'BEGIN
                             INSERT INTO tb_schduler (id, descr, cr_date)
                             VALUES (tb_schduler_seq.NEXTVAL, ''test_proc_1'', SYSDATE);
                             COMMIT;
                           END;'
    ,0, TRUE,
    'Program for first link in the chain.'
    COMMIT;
    END;
    BEGIN
    dbms_scheduler.create_program('"TEST_PROC_3"','PLSQL_BLOCK',
    'BEGIN
                             INSERT INTO tb_schduler (id, descr, cr_date)
                             VALUES (tb_schduler_seq.NEXTVAL, ''test_proc_3'', SYSDATE);
                             COMMIT;
                           END;'
    ,0, TRUE,
    'Program for last link in the chain.'
    COMMIT;
    END;
    BEGIN
    dbms_scheduler.create_program('"TEST_PROC_2"','PLSQL_BLOCK',
    'BEGIN
                             INSERT INTO tb_schduler (id, descr, cr_date)
                             VALUES (tb_schduler_seq.NEXTVAL, ''test_proc_2'', SYSDATE);
                             COMMIT;
                           END;'
    ,0, TRUE,
    'Program for second link in the chain.'
    COMMIT;
    END;
    BEGIN
    dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
    , rule_set_name=>'"SCHED_RULESET$1"   '
    dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
    dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
    dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
    COMMIT;
    END;
    BEGIN
    dbms_scheduler.create_job('"TEST_CHAIN_1_JOB"',
    job_type=>'CHAIN', job_action=>
    'test_chain_1'
    , number_of_arguments=>0,
    start_date=>TO_TIMESTAMP_TZ('03-DEC-2013 05.38.56.718161000 PM +08:00','DD-MON-RRRR HH.MI.SSXFF AM TZR','NLS_DATE_LANGUAGE=english'), repeat_interval=>
    'freq=minutely; interval=2'
    , end_date=>TO_TIMESTAMP_TZ('03-DEC-2013 06.08.56.000000000 PM +08:00','DD-MON-RRRR HH.MI.SSXFF AM TZR','NLS_DATE_LANGUAGE=english'),
    job_class=>'"DEFAULT_JOB_CLASS"', enabled=>FALSE, auto_drop=>TRUE,comments=>
    NULL
    COMMIT;
    END;
    [oracle@linux1 ~]$ export ORACLE_SID=usbo
    [oracle@linux1 ~]$ sqlplus / as sysdba
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Dec 3 17:44:43 2013
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options
    sys@USBO> show parameter db_name
    NAME                                 TYPE                              VALUE
    db_name                              string                            usbo
    sys@USBO> conn scott/tiger;
    Connected.
    --remove job and chain.
    scott@USBO> EXEC DBMS_SCHEDULER.drop_job(job_name => 'test_chain_1_job');
    EXEC DBMS_SCHEDULER.drop_chain (chain_name  => 'test_chain_1');
    EXEC DBMS_SCHEDULER.drop_program (program_name  => 'test_proc_1');
    EXEC DBMS_SCHEDULER.drop_program (program_name  => 'test_proc_2');
    EXEC DBMS_SCHEDULER.drop_program (program_name  => 'test_proc_3');
    PL/SQL procedure successfully completed.
    scott@USBO> @/u03/database/usbo/BNR/dump/scott_job.sql
    Session altered.
    Session altered.
    Session altered.
    Session altered.
    Session altered.
    Session altered.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    BEGIN
    ERROR at line 1:
    ORA-24150: evaluation context SCOTT.SCHED_EV_CTX$1 does not exist
    ORA-06512: at "SYS.DBMS_RULEADM_INTERNAL", line 28
    ORA-06512: at "SYS.DBMS_RULE_IMP_OBJ", line 40
    ORA-06512: at line 3
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    BEGIN
    ERROR at line 1:
    ORA-24141: rule set SCOTT.SCHED_RULESET$1 does not exist
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
    ORA-06512: at "SYS.DBMS_ISCHED", line 1694
    ORA-01403: no data found
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1638
    ORA-06512: at line 5
    PL/SQL procedure successfully completed.

    Thanks all of you!
    Hi DK2010,
    I took some test that the data dict(dba_rule_sets/dba_evaluation_contexts) no any data returned after I had removed the job.
    So I tried to create evaluation context and re-executed script(only exception setion.) the first error has gone. For the second still have some issue.
    ---->no any returned
    scott@USBO> select * from dba_rule_sets where rule_set_owner='SCOTT';       
    no rows selected
    scott@USBO> select * from dba_evaluation_contexts WHERE evaluation_context_owner='SCOTT';
    no rows selected
    -->add new EVALUATION CONTEXT
    scott@USBO> exec DBMS_RULE_ADM.CREATE_EVALUATION_CONTEXT('SCOTT.SCHED_EV_CTX$1');
    PL/SQL procedure successfully completed.
    --->now it looks fine
    scott@USBO> BEGIN
      2  BEGIN
      3  dbms_rule_imp_obj.import_rule_set('"SCHED_RULESET$1"','"SCHED_EV_CTX$1"',NULL, 0);
      4  END;
      5 
      6  COMMIT;
      7  END;
      8  /
    PL/SQL procedure successfully completed.
    --->add new rule set, it prompt aleady exists
    scott@USBO> exec DBMS_RULE_ADM.CREATE_RULE_SET('SCOTT.SCHED_RULESET$1') 
    BEGIN DBMS_RULE_ADM.CREATE_RULE_SET('SCOTT.SCHED_RULESET$1'); END;
    ERROR at line 1:
    ORA-24153: rule set SCOTT.SCHED_RULESET$1 already exists
    ORA-06512: at "SYS.DBMS_RULEADM_INTERNAL", line 28
    ORA-06512: at "SYS.DBMS_RULE_ADM", line 138
    ORA-06512: at line 1
    -->chain rule still could not find.
    scott@USBO> @job_chain_rules.sql
    no rows selected
    -->rerun
    scott@USBO> BEGIN
      2  dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
      3  , rule_set_name=>'"SCHED_RULESET$1"   '
      4  );
      5  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
      6  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
      7  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
      8  COMMIT;
      9  END;
    10  /
    BEGIN
    ERROR at line 1:
    ORA-27477: "SCOTT.TEST_CHAIN_1" already exists 
    ORA-06512: at "SYS.DBMS_ISCHED", line 1148
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1598
    ORA-06512: at line 2
    -->drop chain
    scott@USBO> exec dbms_scheduler.drop_chain('TEST_CHAIN_1');
    BEGIN dbms_scheduler.drop_chain('TEST_CHAIN_1'); END;
    ERROR at line 1:
    ORA-27479: Cannot drop "SCOTT.TEST_CHAIN_1" because other objects depend on it
    ORA-06512: at "SYS.DBMS_ISCHED", line 1319
    ORA-06512: at "SYS.DBMS_ISCHED", line 1222
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1854
    ORA-06512: at line 1
    scott@USBO> exec dbms_scheduler.drop_chain('TEST_CHAIN_1',force=>TRUE);
    PL/SQL procedure successfully completed.
    scott@USBO> BEGIN
      2  dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
      3  , rule_set_name=>'"SCHED_RULESET$1"   '
      4  );
      5  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
      6  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
      7  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
      8  COMMIT;
      9  END;
    10  /
    BEGIN
    ERROR at line 1:
    ORA-24141: rule set SCOTT.SCHED_RULESET$1 does not exist   --->still returned no rule set
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
    ORA-06512: at "SYS.DBMS_ISCHED", line 1694
    ORA-01403: no data found
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1638
    ORA-06512: at line 5
    scott@USBO> exec DBMS_RULE_ADM.CREATE_RULE_SET('SCOTT.SCHED_RULESET$1')
    PL/SQL procedure successfully completed.
    scott@USBO> BEGIN
      2  dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
      3  , rule_set_name=>'"SCHED_RULESET$1"   '
      4  );
      5  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
      6  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
      7  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
      8  COMMIT;
      9  END;
    10  /
    BEGIN
    ERROR at line 1:
    ORA-27477: "SCOTT.TEST_CHAIN_1" already exists
    ORA-06512: at "SYS.DBMS_ISCHED", line 1148
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1598
    ORA-06512: at line 2
    scott@USBO> exec dbms_scheduler.drop_chain('TEST_CHAIN_1',force=>TRUE);
    PL/SQL procedure successfully completed.
    scott@USBO> BEGIN
      2  dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
      3  , rule_set_name=>'"SCHED_RULESET$1"   '
      4  );
      5  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
      6  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
      7  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
      8  COMMIT;
      9  END;
    10  /
    BEGIN
    ERROR at line 1:
    ORA-24141: rule set SCOTT.SCHED_RULESET$1 does not exist
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
    ORA-06512: at "SYS.DBMS_ISCHED", line 1694
    ORA-01403: no data found
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1638
    ORA-06512: at line 5
    Would you like to give me more clue?
    Thanks again.

  • Missing chain step name in events raised by the scheduler

    I use events raised by the scheduler (SYS.SCHEDULER$_EVENT_QUEUE) to monitor scheduler chains processing.
    For event_type = "JOB_STARTED" (chain step started in case of chains) in event message (sys.scheduler$_event_info) there is no log_id (log_id is null).
    In user_scheduler_job_log view there is column job_subname that contains chain step name but this column is missing in the event message.
    Is there any way to get chain step name for event_type = "JOB_STARTED"?
    Job configuration:
    dbms_scheduler.set_attribute(
    name => job_name,
    attribute => 'logging_level',
    value => dbms_scheduler.logging_full
    dbms_scheduler.set_attribute(
    name => job_name,
    attribute => 'raise_events',
    value => dbms_scheduler.job_all_events
    Database:
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    OS:
    CentOS - redhat-4
    Regards
    Mariusz

    I want to track chain processing by dequeue messages from SCHEDULER$_EVENT_QUEUE.
    Examples of messages automatically inserted by scheduler into SCHEDULER$_EVENT_QUEUE (user_data column from SCHEDULER$_EVENT_QTAB)
    SYS.SCHEDULER$_EVENT_INFO('JOB_SUCCEEDED','CDWMAIN','JOB_NAME','2011-07-27 16:19:11.191969',0,NULL,0,340374,1,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)
    SYS.SCHEDULER$_EVENT_INFO('JOB_STARTED','CDWMAIN','JOB_NAME','2011-07-27 16:19:10.947994',0,NULL,1,NULL,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)
    SYS.SCHEDULER$_EVENT_INFO('JOB_CHAIN_STALLED','CDWMAIN','JOB_NAME','2011-07-27 15:45:13.727127',0,NULL,0,NULL,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)
    For event JOB_SUCCEEDED there is log_id = 340374 so we can find job_subname (chain step name) in log table.
    For JOB_STARTED and JOB_CHAIN_STALLED there is no log_id so we do not know wich chain step in this case was started and wich chain was stalled.
    JOB_NAME is the same for all steps in case of chain processing

  • Question about the chain step name in DEFINE_CHAIN_STEP

    I have questions about the chain step name in DEFINE_CHAIN_STEP:
    1. Can the step name be a number (e.g. "8")?
    2. Should the step name be unique within a chain or across all chains?
    I am having this exception:
    ORA-25448: rule DMUSER.RULE_6_3707 has errors
    ORA-22806: not an object or REF
    After I changed the step names (in DEFINE_CHAIN_STEP), the chain seems to run fine.
    Thanks,
    Denny

    The reason I asked about the step name is to confirm it can handle numbers (it looks it can handle it from the doc).
    Why I changed the step names say from "11" to "21", the error goes away, that puzzled me. Because the way I defined steps and the rules for the steps were exactly the same. Just changing the step names made the error goes away?!
    Thanks.

  • Send Message from Process Chain Step without Process Log

    We send a mail message, depending on the success or failure of the process chain step, to user list.
    When the message is sent not only custom message but also the status information and the process log are sent.
    Our users are only interested about the result of the chain and they don' t want to view all technical information.
    Is it possible to send message without process log?
    Regards

    Hi,
    Take 2 process(red and green line) from each of the process in the process Chain, one is for sucessfull and other is for failure and at the end of the proces chain,  just put all failure process to the OR and have add a ABAP Program (with Not Sucessfull) and then just put all sucessfull process to the AND and have add a ABAP Program (with Sucessfull) .
    This wil send the mail to the users, when ever there is failure in PC any where, or sends a mail ..if the process chain completes sucessfully.
    If you want only add the send of mail option at the end of the process chain, we can just add 2 process (red and green line) and have same flow as above. so that.. it will only sends mail..when there is failure or sucessfull of the process chian.
    Hope it helps ......

  • Event Based Chain Step?

    For a couple days now I've been trying to come up with a working example of a Job Chain w/ an Inline Event for a Chain Step.
    Would anyone happen to have a fairly simple example of this, or be able to point me in the right direction?
    Thanks,
    James

    Hi James,
    An inline event in a chain allows the chain to wait until an event is received before continuing with one or more branches of the chain. The way this works is that one of the chain steps is an event step which does nothing but wait for an event and completes successfully as soon as that event is received.
    In a database events are represented by AQ messages to the chain event step waits until a message is received into a certain queue. Here is a simple complete example with comments. First step1 runs, then step 2 waits for an event . After the message is received, the final step3 runs and the chain completes. If you have any more questions, please reply.
    Hope this helps,
    Ravi.
    -- ================= simple complete chain with event step example ==============
    -- grant necessary privileges to scott
    grant create job to scott ;
    grant execute on dbms_aq to scott;
    grant execute on dbms_aqadm to scott;
    begin
    dbms_rule_adm.grant_system_privilege
    (dbms_rule_adm.CREATE_EVALUATION_CONTEXT_OBJ, 'scott', FALSE);
    dbms_rule_adm.grant_system_privilege
    (dbms_rule_adm.CREATE_RULE_SET_OBJ, 'scott', FALSE);
    dbms_rule_adm.grant_system_privilege
    (dbms_rule_adm.CREATE_RULE_OBJ, 'scott', FALSE);
    end ;
    connect scott/tiger
    -- setup a multiple consumers queue for event messages
    create or replace type msg_type as object ( col1 varchar2(20) ) ;
    begin
    dbms_aqadm.create_queue_table('qt1','msg_type',multiple_consumers => TRUE);
    dbms_aqadm.create_queue ( queue_name => 'Q1', queue_table => 'QT1');
    dbms_aqadm.start_queue ( queue_name => 'Q1' ) ;
    end ;
    -- create a scheduler program and chain
    exec dbms_scheduler.create_program('prog1','plsql_block','null;',0,true);
    begin
    dbms_scheduler.create_chain('chain1');
    dbms_scheduler.define_chain_step('chain1','step1','prog1');
    dbms_scheduler.define_chain_event_step('chain1','step2',
    'tab.user_data.col1 is not null', 'Q1');
    dbms_scheduler.define_chain_step('chain1','step3','prog1');
    dbms_scheduler.define_chain_rule('chain1','true','START step1');
    dbms_scheduler.define_chain_rule('chain1','step1 completed', 'start step2');
    dbms_scheduler.define_chain_rule('chain1','step2 completed','start step3');
    dbms_scheduler.define_chain_rule('chain1','step3 completed','end');
    dbms_scheduler.enable('chain1');
    end;
    -- now create the master chain job, and enable it so it runs immediately
    exec dbms_scheduler.create_job('job1','chain','chain1',0,enabled=>true);
    -- wait a second or two to let first step complete
    select * from all_scheduler_job_log where job_name='JOB1' order by log_id;
    -- observe that only first step has completed
    -- now enqueue message to complete second step
    declare
    msg msg_type;
    my_msgid RAW(16);
    props dbms_aq.message_properties_t;
    enqopts dbms_aq.enqueue_options_t;
    begin
    msg := msg_type('test');
    dbms_aq.enqueue('q1', enqopts, props, msg, my_msgid);
    end;
    commit;
    -- now check that chain has completed successfully
    select * from all_scheduler_job_log where job_name='JOB1' order by log_id;
    -- ======= end of complete inline event step example

  • Process chain step by step documentation

    Hi friends,
    I am looking step by step documentation for process chains,please  send me documents.
    thanks for advace
    bye
    habeeb
    [email protected]

    Hi Habeeb,
    look at www.service.sap.com/bi --> SAP BW old release --> BI Infoindex --> P: you will find 5 documents on Process Chains.
    Go through this help documents and downloads.
    http://help.sap.com/saphelp_nw04/helpdata/en/67/13843b74f7be0fe10000000a114084/content.htm
    SAP help Creating process chains..
    http://help.sap.com/saphelp_nw2004s/helpdata/en/8f/c08b3baaa59649e10000000a11402f/frameset.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/8da0cd90-0201-0010-2d9a-abab69f10045
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/19683495-0501-0010-4381-b31db6ece1e9
    ..http://help.sap.com/saphelp_nw2004s/helpdata/en/8f/c08b3baaa59649e10000000a11402f/frameset.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/8da0cd90-0201-0010-2d9a-abab69f10045
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/19683495-0501-0010-4381-b31db6ece1e9
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/36693695-0501-0010-698a-a015c6aac9e1
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9936e790-0201-0010-f185-89d0377639db
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3507aa90-0201-0010-6891-d7df8c4722f7
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/263de690-0201-0010-bc9f-b65b3e7ba11c
    Process Chains
    Steps for Creating Process chain!
    http://help.sap.com/saphelp_nw04/helpdata/en/67/13843b74f7be0fe10000000a114084/frameset.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/events/sap-teched-03/using%20process%20chains%20in%20sap%20business%20information%20warehouse
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/19683495-0501-0010-4381-b31db6ece1e9
    and also check this.
    http://help.sap.com/saphelp_nw04s/helpdata/en/58/9c6c4251e4c153e10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/44/60c800738d311de10000000a155369/content.htm
    /people/sap.user72/blog/2005/12/27/the-new-sap-netweaver-job-scheduler-a-redwood-oem-tool
    http://help.sap.com/saphelp_nw2004s/helpdata/en/86/6ff03b166c8d66e10000000a11402f/frameset.htm
    ***Pls assign the points , if info is useful**
    Regards
    CSM Reddy

  • Execute process chain step based on value in a custom table

    HI,
    I have a requirement where i need to execute a process chain step based in the value of a field in a custom table.
    e.g. If ztable-zflag = 'X' then execute next step else stop.
    I am trying to use the decision between multiple alternatives process type, but i guess we can only use formulas in it.
    Also, i created a custom method and called it through the badi RSAR_CONNECTOR, but the same isnt working as expected.
    Would appreciate inputs from the experts.

    Hi,
    Thank you for your response.
    I followed exactly what is written in the document. But when I execute the process chain with the Decision between Multiple Alternatives process type, it fails with an exception message.
    Below is what I have done:
    Below is the code that I entered in the method (Please note that ZPC_CONTROL is the table from which I need to check the value. This table contains 2 fields: Process Chain Name and Flag. My requirement is that when a particular process chain has the flag checked, then the process chain should move ahead):
    Below is the GET method:
    Finally, here is the formula that I have written in the Decision Between Multiple Alternatives process type:
    And the event is Option 2 (which I assume will move the process chain forward if the flag is checked for the process chain ‘TEMP_TEST’)
    Please note that the flag for process chain ‘TEMP_TEST’ is checked in the table ZPC_CONTROL.
    Below is the error in the process chain:
    Please let me know where am I going wrong here. Appreciate your help.

  • Process Chain Step by Step

    Hi to all,
    Please can any one tell me, how to designe Process Chain Step by Step.
    Or any Document Related to that.
    i shall be thankful to you for this.
    Regards
    Pavneet Rana

    Hi Rana,
    Have you searched in the SDN or Google. this is the general topic was discussed n no of times and lots of documents are there on this.
    Check the below link which givs step by step
    Process chain creation - step by step
    /people/juergen.noe/blog/2008/01/11/process-chain-creation--step-by-step
    https://wiki.sdn.sap.com/wiki/display/BI/Processchainscreationandmonitoring
    Regards
    KP
    Edited by: prashanthk on Jan 19, 2011 5:08 PM

  • Oracle Scheduler Chain Step - Succeeds and Fails at the same time?

    Hi,
    I have a chain program that executes a script :-
    exec DBMS_SCHEDULER.CREATE_PROGRAM (
    program_name => 'xxxx_execute_script'
    ,program_type => 'EXECUTABLE'
    ,program_action => '/home/xxx/run_remote_xxxx.sh'
    ,number_of_arguments => 0
    ,enabled => true
    ,comments => 'execute drms shell script'
    The script does a remote execute to a another script on a different machine.
    I have a chain step setup as :-
    exec DBMS_SCHEDULER.DEFINE_CHAIN_STEP (
    chain_name => 'xxx_drms_manual_load',
    step_name => 'STEP30',
    program_name => 'drms_execute_script');
    I have chain rules :-
    (execute the script)
    exec DBMS_SCHEDULER.DEFINE_CHAIN_RULE (
    chain_name => 'xxx_drms_manual_load'
    ,condition => 'STEP20 succeeded'
    ,action => 'START STEP30'
    ,rule_name => 'drms_rule_030'
    ,comments => 'start drms step30 - execute_script'
    (chain rule for failed - executes a stored procedure to sends a warning email)
    exec DBMS_SCHEDULER.DEFINE_CHAIN_RULE (
    chain_name => 'jpl_drms_manual_load'
    ,condition => 'STEP30 failed'
    ,action => 'start step31'
    ,rule_name => 'drms_rule_035'
    ,comments => 'drms - sends unix script error email'
    (chain rule for succeeded - executes a stored procedure to check for certain processing codes)
    exec DBMS_SCHEDULER.DEFINE_CHAIN_RULE (
    chain_name => 'jpl_drms_manual_load'
    ,condition => 'STEP30 succeeded'
    ,action => 'START STEP40'
    ,rule_name => 'drms_rule_050'
    ,comments => 'start drms step40 - check for errors'
    Everything has been running fine until a couple of days ago.
    The job chain now seems to run Step 31 (failed) AND step40 (successful) ! How can this be?
    All job steps run according to the oracle job log (all_SCHEDULER_JOB_RUN_DETAILS) - (STEP31 does not appear in the log - even though it runs - we recieve a warning email)
    There no non zero return codes for the job steps.
    Is there a way to see the return code from the execution of the script (STEP30) to see what the return code is ??
    Thanks in advance,

    Hi,
    You can select from the dba_scheduler_job_run_details and filter on job name to track the execution progress of a chain.
    Hope this helps,
    Ravi.

  • Chain step - attributes

    Hi all, Does chain steps have attributes? If so, what are all the attributes which can be modified or used??
    Thanks in advance

    Hi,
         I checked this documentation and only I was confused.
    Step Attributes
    The following is a list of step attributes that you can include in conditions when using SQL WHERE clause syntax:
    completed
    state
    start_date
    end_date
    error_code
    duration
    These are all the attributes for chain steps or for chain rules. because the condition is an attribute of chain rule na.
    And can I change these attributes or not ??
    Thanks

  • Process Chain step failures

    Hi,
    We have a process chain that frequently fails on a load data step. The step prior is a delete index. The data load is loading to a PSA and then to the data targets. The issue we are seeeing is if you repeat the data load step when it fails the delete index, which was already successful, changes to yellow. The delete index step stays yellow and never changes to green, it really is not running. Then the data load step that was repeated actually does run and complete successfully but the step never changes to green it stays red. As a result the process chain never completes. I have a work around, by running the info package manually then changing the failed step to green. But I would like to find out why this happens and can we stop it from happening.
    Thanks
    Cheryl Farley

    Hi,
    When loading the data from PSA and then into datatargets fails at the second stage from PSA to target,
    here if u repeat the chain as far i guess the load to PSA appears into yellow and then changes to green when the data is updated o target...
    but in ur case u r saying tht the delte index step is failing/changing into yellow when repeating at load step..
    now confirm from where u r repeating ur chain either from load to PSA or PSA to target...
    in both the cases the delte index shuld not be running again..once chk the whole design of ur chain,,,
    rgds,

  • Process Chain step repeat/restart

    I have a process chain which schedules 3 loads to psa and then loads the data into ods/cubes. it often fails here due to data problems. now there are at least 4 subsequent steps that are not executed due to this failure which is correct but i don't want to have to fix the problem with the data by deleting the requests from the ods/cube and correcting in the PSA and then have to do all the subsequent steps manually.
    Once i have corrected the data in the PSA:
    if i repeat the load to ODS step will it continue through the rest of the chain?
    if i restart the chain will it repeat the extract to PSA steps which i definitely don't want it to do?
    or can i schedule the subsequent part of the chain to run from the planning view?

    Hi Richard,
    I guess when there is some data issue, there is always need for manual intervention.
    "if i repeat the load to ODS step will it continue through the rest of the chain?"
    <i>You have to delete the failed request manually from DataTarget before doing this.</i>
    "if i restart the chain will it repeat the extract to PSA steps which i definitely don't want it to do?"
    <i>Yes. Restarting chain will extract the data again.</i>
    or can i schedule the subsequent part of the chain to run from the planning view?
    <i>I don't think you can start a chain from the middle from planning view.</i>
    Regards,
    Sree

  • Process Chain step status

    Hello All,
    In one of our process chain , we have an AND step, where in its checks its 4 preeceding steps, its all 4 are green,the AND Step executes and it goes to the next step.
    Chain is running fine since many years. But yesterday , we faced the issue that even if the preeceding steps were green, the AND step status showed Completed  rather it should show Successfully Completed.
    So we had to manually change the status to Successfully Completed  and it went fine.
    We check with the Basis also, the system was fine during that point.
    Any pointers why the step did not get the Status as Successfully Completed.
    Job name: BI_PROCESS_AND
    Regards,
    Mayank

    Hi,
    You can find the necessary logs & status of the process chains in the RSPCLOGCHAIN table.
    Let's know the status.
    Also check in table RSPCPROCESSLOG
    Let us know the details.
    Reg
    Pra

Maybe you are looking for

  • Business area not updating automatically.

    Hi Gurus,     Business area is not getting updated when a transaction is posted thru PO/SD process. BA is getting updated only for line items i.e. FI-MM(GL maintained in OBYC) and FI-SD(GL maintained in VKOA) but the same is not happening for line it

  • Access to itunes shop

    Had no troubles until yesterday and today....I am continually getting the "Cannot connect to Itunes store, it may be busy - try again later" message. I do not have a problem with my internet connection. I this the norm or may I have a problem at this

  • Graphic Change from CS3 to CS5

    I created a 3 layer graphic file in CS3 with one layer being text. I imported it into the target application, DVD Studio Pro, and it looked fine. I copied that file onto another computer where I installed the trial version of CS5. (I didn't want to r

  • Validate a screen entry through message

    Moderator message: do NOT offer points Dear experts,   I have designed one screen containing 10 entries of 10 different fields. One entry is for amount . I want that amount to be less than 1000.00 and if it is not so it should give message.    My log

  • MalformedURLException - Oracle not support?

    Dear all, I'm trying to use a standalone java client to talk to ALBPM via PAPI. I get it compiled (the Fuego55-APIsGuide is a bit out dated in terms of jar file list, btw). However, when I try to get it run, I got the following error: W:\savaria_1\se