How to send email notifications for dbms_scheduler jobs

SITUATION

Jobs can be scheduled  from either OEM ( Oracle Enterprise Manager ) or database DBMS_SCHEDULER. The following two pictures  show the boxes ticked will trigger notifications when the event happens.

Environment:

                 OEM : 12c or 13c
                 Database: any versions

(picture 1 ) — OEM JOB

OEM Job Email Notification


( picture 2 )– DBMS_SCHEDULER JOB

DBMS_SCHEDULER Job Notification

Email notification for OEM jobs works fine, but we could not receive email notifications from DBMS_SCHEDULER  jobs.

SOLUTION

Subscribe to get access

Read more of this content when you subscribe today.

8 thoughts on “How to send email notifications for dbms_scheduler jobs”

  1. James,
    Thank you for your blog. Could you explain what you mean by “it will not work again” in the following:
    “PLEASE NOTE: don’t tick the box of email notification for database dbms_scheduler jobs ( ( picture 2 )– DBMS_SCHEDULER JOB ) , otherwise it will not work again. Hopefully this will be fixed in future. It is not working for OEM 12.1.0.4.’

    Do you mean the job won’t run again or email notifications won’t be sent?

    I’m asking because our email DBMS Jobs don’t send notifications on one of our prod databases, but they run when we make a clone of it. SMTP is sending emails from the prod server and so is OEM.
    Thanks again,
    Rick

    Like

    1. Hello Rick,
      Thanks for reading my blog.
      It has been long time. As far as i remember, after everything is configured for DBMS_SCHEDULER JOB, and email notification is working fine. Then if you click the the box of email notification for database dbms_scheduler jobs ( ( picture 2 )– DBMS_SCHEDULER JOB, and save it. The email notifications won’t be received for some reason, it is an OEM bug. not sure it is fixed or not. Certainly the job will run normally. So better configure DBMS jobs email notifications manually, instead of using OEM by clicking the boxes.

      Thanks,
      James

      Like

  2. James,
    Thank you for the quick response!
    I was hoping the bug you mention above was my problem, but I just created a fresh job, being careful to set up the email notifications outside of OEM and still am not receiving notifications. I’ve tested mail from the server outside of Oracle, and it works fine. OEM jobs themselves also send notifications without any issues. It’s just the DBMS jobs that have a problem.

    I have a clone of the database that sends email notifications without a problem as well. Here’s one clue from the clone that might help: msg_state for AQ$SCHEDULER$_EVENT_QTAB on the clone show’s PROCESSED, while it shows READY on the production database that does not send email notifications. Do you have any ideas?

    Thank you very much for your time,
    Rick

    Like

    1. Hi Rick,

      It is a strange problem. since it works on clone database, so there is no ACL problem. Also there is no SMTP problem. Sorry about, I am really not sure why.

      job_queue_processes is not zero ?

      Thanks,
      james

      Like

  3. James,
    job_queue_processes is 100. It may not be high enough, but I assume that too low a value wouldn’t keep notifications from being sent at all.

    We upgraded the clone that sends email notifications to 12.1.0.2. We did this before anyone reported the notification problem. Now that I think of it, the email notifications didn’t start working until after the upgrade.

    Does that give you any clues to the problem?

    Thanks again,
    Rick

    Like

Leave a reply to dbalifeeasy Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.