Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to create a procedure to send a mail if the Database is down?

620516Feb 15 2011 — edited Feb 16 2011
Hi,


I have created the below procedure to send a mail if the count is less than 1300. It scheduled daily @ 15 30 hrs. Its fine.


CREATE OR REPLACE procedure SCOTT.hrsmail
is
v_count number;
begin

Select count(*) into v_count from emp;

if v_count < 1300
then
UTL_MAIL.send(sender => 's@n.org',
recipients => 's@y.com',
cc => 's@a.com',
bcc => 's@h.com',
subject => 'Testing the UTL_MAIL Package',
message => 'If you get this, UTL_MAIL package

else
null; --what you want to do here
end if ;

end;
/



Sometime the Database is down, so the job is not running.


How to create a procedure to send a mail if the database is down?

Pls help me. Its highly appreciated.



Thanks

Nihar
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 16 2011
Added on Feb 15 2011
5 comments
491 views