4 Replies Latest reply: Mar 5, 2014 5:12 AM by 1009890 RSS

    Email notification when the DBMS Scheduler job is disabled

    1009890

      Hi ,

          I have added a email notifications when the job is disabled. But the email is not triggered when the  job is disabled .

       

       

       

      BEGIN

        DBMS_SCHEDULER.set_scheduler_attribute('email_server', 'internal-mail-router.com:25');

        DBMS_SCHEDULER.set_scheduler_attribute('email_sender', 'do_not_reply@oracle.com');

      end;

       

      begin

      for I in (select JOB_NAME from USER_SCHEDULER_JOBS )

      LOOP

      --DBMS_SCHEDULER.SET_ATTRIBUTE(i.job_name, 'raise_events',DBMS_SCHEDULER.JOB_FAILED + DBMS_SCHEDULER.JOB_SCH_LIM_REACHED+DBMS_SCHEDULER.JOB_DISABLED);

      DBMS_SCHEDULER.ADD_JOB_EMAIL_NOTIFICATION (

        JOB_NAME         =>  'GOOGLEAPI1_JOB3',

        RECIPIENTS       =>  'shashidhar.k.nanjeshappa@oracle.com'

         subject         =>  'UAT - IMMEDIATE ACTION REQUIRED - %job_name% - FAILED ' ,

          body           =>   'Hi ,

                               The sceduler job '||i.job_name||' has been failed because of %error_message%',

        events           =>  'JOB_FAILED, JOB_BROKEN, JOB_DISABLED, JOB_SCH_LIM_REACHED'

      );

      end loop;

      end;

       

      I am getting emails for other events except when the job is disable . Please let me know is there any attribute set up is required to trigger the email for job_disabled ..