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 this post Share on Facebook2Share on Google+0Share on LinkedIn6Share on Reddit0Tweet about this on Twitter

Gokhan Atil is a database administrator who has hands-on experience with both RDBMS and noSQL databases (Oracle, PostgreSQL, Microsoft SQL Server, Sybase IQ, MySQL, Cassandra, MongoDB and ElasticSearch), and strong background on software development. He is certified as Oracle Certified Professional (OCP) and is awarded as Oracle ACE (in 2011) and Oracle ACE Director (in 2016) for his continuous contributions to the Oracle users community.

10 Comments

  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.

Leave Comment

Your email address will not be published. Required fields are marked *