4 Replies Latest reply: May 7, 2012 4:43 PM by Jamb RSS

    Job associated with a scheduled window didn't retry after failures

    Jamb
      Hi, i would like to know if this is an expected behaivour or there is a restriction when using jobs associated with a specified window.

      Could someone know about this ?,

      I will appreciate your help.
        • 1. Re: Job associated with a scheduled window didn't retry after failures
          Rnr-Oracle
          Hi,

          What version of the database is this ?

          Are you setting 'RESTARTABLE' to TRUE for the job ?

          Thanks,
          Ravi.
          • 2. Re: Job associated with a scheduled window didn't retry after failures
            Jamb
            Hi, this is a Oracle Database 10gR2 and it is right RESTARTABLE attribute is set to TRUE.

            BEGIN
            SYS.DBMS_SCHEDULER.CREATE_JOB
            (
            job_name => 'JA.JOB_MVIEW_TEST'
            ,schedule_name => 'SYS.SIMPLE_WINDOW'
            ,job_class => 'MVIEW_JOB_CLASS'
            ,job_type => 'PLSQL_BLOCK'
            ,job_action => 'begin
            dbms_refresh.refresh(''"JA"."GSCC_MVIEW_TEST"'');
            end;'
            ,comments => 'Prueba'
            );
            SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
            ( name => 'JA.JOB_MVIEW_TEST'
            ,attribute => 'RESTARTABLE'
            ,value => TRUE);
            SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
            ( name => 'JA.JOB_MVIEW_TEST'
            ,attribute => 'LOGGING_LEVEL'
            ,value => SYS.DBMS_SCHEDULER.LOGGING_FULL);
            SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
            ( name => 'JA.JOB_MVIEW_TEST'
            ,attribute => 'MAX_FAILURES');
            SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
            ( name => 'JA.JOB_MVIEW_TEST'
            ,attribute => 'MAX_RUNS');
            BEGIN
            SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
            ( name => 'JA.JOB_MVIEW_TEST'
            ,attribute => 'STOP_ON_WINDOW_CLOSE'
            ,value => TRUE);
            EXCEPTION
            -- could fail if program is of type EXECUTABLE...
            WHEN OTHERS THEN
            NULL;
            END;
            SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
            ( name => 'JA.JOB_MVIEW_TEST'
            ,attribute => 'JOB_PRIORITY'
            ,value => 2);
            SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
            ( name => 'JA.JOB_MVIEW_TEST'
            ,attribute => 'SCHEDULE_LIMIT');
            SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
            ( name => 'JA.JOB_MVIEW_TEST'
            ,attribute => 'AUTO_DROP'
            ,value => FALSE);

            SYS.DBMS_SCHEDULER.ENABLE
            (name => 'JA.JOB_MVIEW_TEST');
            END;
            /


            I'm trying to control snapshot execution of some Mviews using the Scheduler Jobs instead of Simple Jobs, and i need to define a windows to runtime, also i need that Snapshot do not run after window time ends, but also i would like that job retries when a failure occurs only during the window time. Do you know if this is possible with scheduler ?
            • 3. Re: Job associated with a scheduled window didn't retry after failures
              Rnr-Oracle
              IHi,

              it does not look like window jobs do normal retries.

              Maybe it would be possible to use a normal schedule object along with a sniper job to stop the job after it has exceeded a max duration as shown here

              limit runtime of a JOB

              Thanks,
              Ravi.
              • 4. Re: Job associated with a scheduled window didn't retry after failures
                Jamb
                Ok, i will try this.. thanks