Create AWR Reports and Send Them via Email (RAC Compatible)

In one of my old posts, I tried to explain how to create AWR and ADDM reports by PL/SQL and send them as email. One of my reader asked me how to run them in RAC environment. As I see, my script for ADDM is already compatible but AWR was not, so I added 1-2 lines to make it compatible, and wanted to share it:

It sends one email for each instance. So you get 3 emails if you have 3-node RAC. It doesn’t seem quite right to me, so I modified the code to send these reports as attachments in one mail:

I hope that PL/SQL script will be helpful, at least it demonstrates how to send attachments in emails. 🙂

Please share

AWS Big Data Specialist. Oracle Certified Professional (OCP) for EBS R12, Oracle 10g and 11g. Co-author of "Expert Oracle Enterprise Manager 12c" book published by Apress. Awarded as Oracle ACE (in 2011) and Oracle ACE Director (in 2016) for the continuous contributions to the Oracle users community. Founding member, and vice president of Turkish Oracle User Group (TROUG). Presented at various international conferences including Oracle Open World.


  1. Pingback: Log Buffer #286, A Carnival of the Vanities for DBAs | The Pythian Blog

    • Gokhan Atil

      Hi Anuj,

      Add UTL_SMTP.RCPT (v_mail_conn, v_recipient) multiple times, and also add the email address with comma to the “TO” string.

      UTL_SMTP.RCPT (v_mail_conn, '');
      UTL_SMTP.RCPT (v_mail_conn, '');
      UTL_SMTP.WRITE_DATA ( v_mail_conn, 
      || UTL_TCP.CRLF );

Leave Comment

Your email address will not be published.

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