Sending Mail using PL/SQL

by m-c

by m-c

I have been playing with Oracle Management Server at work receenty to try and mke the management of all our Oracle 8i and 9i databases a little easier.
One of the thing I want to setup was something to monitor the amount of tablespace left in each tablespace. I already had a clunky way to do it using PL/SQL, shell scripts and web pages. But OMS looked like a better way to do it.

It is a much better way of doing it, but all the output goes to into the management server. Which is good, but I didn’t want to have to go to the management server to find out if a tablespace was running out of space. I wanted and alert. I wanted to get an email!

I didn’t know if that was even possible to do from with PL/SQL. Especially when dealing with version 8 and 9 databases.

It turns out that it is possible. OTN have a some good UTL_SMTP Sample Code that I was able to use to get it working.
I should mention that I had great success with the version 9 databases but limited success with the version 8 databases. Something about JVM not being installed in the database. I tried to fix that, but without success. Yet…..

Leave a Comment

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