<!– @page { margin: 0.79in } P { margin-bottom: 0.08in }
–>
Steps to enable Mailing from Database:
1. sqlplus ‘/ as sysdba’
$ORACLE_HOME/rdbms/admin/utlmail.sql
$ORACLE_HOME/rdbms/admin/utlsmtp.sql
$ORACLE_HOME/rdbms/admin/prvtmail.plb
SQL> GRANT EXECUTE ON utl_smtp TO PUBLIC;
4. Set smtp_server information in init.ora or spfile.ora like the following you have to change with right configuration for yourself :
alter system set smtp_out_server = ‘SMTP_SERVER_IP_ADDRESS:SMTP_PORT’ scope=both;
Note : 25 = Default SMTP Port
If instance had been started with spfile
eg: alter system set smtp_out_server = ’172.25.90.165:25′ scope=both;
Thats It, your database is configured to send emails ….
How to send an email
1. sqlplus ‘/ as sysdba’
2. exec utl_mail.send((sender => ‘omustafa@savvytek.com’, recipients => ‘omustafa@savvytek.com’, subject => ‘database alert’, message => ‘database is corrputed’);
3. Check the inbox of the email id, to verify the email receipt.
To enable other DB users to use this functionality, grant execute permission on UTL_MAIL package.
eg: grant execute on utl_mail to omustafa;
Enjoy
osama mustafa
Like this:
Like Loading...
Related
Published by Osama Mustafa
Osama considered as one of the leaders in Cloud technology, DevOps and database in the Middle-East. I have more than ten years of experience within the industry. moreover, certfied 4x AWS , 4x Azure and 6x OCI, have also obtained database certifications for multiple providers.
In addition to having experience with Oracle database and Oracle products, such as middle-ware, OID, OAM and OIM, I have gained substantial knowledge with different databases.
Currently, I am architecting and implementing Cloud and DevOps. On top of that, I'm providing solutions for companies that allow them to implement the solutions and to follow the best practices.
View all posts by Osama Mustafa
I like your blog really…..love it Great information!
LikeLike
Thank you i really appreciate it
LikeLike
great.
LikeLike
Thank you
LikeLike
Hi why i did'nt found the full script utlmail.sql on server ? can you transfer it to meRegardsJamel
LikeLike
Which Version you are using ? Send me your E-mail Please
LikeLike