Oracle Database Error Solutions – Easy & Practical Guides

Welcome to a dedicated platform for solving common Oracle Database errors like ORA-01194, ORA-01555, ORA-01017, ORA-12154 and more.

Learn step-by-step solutions, real-world troubleshooting, and best practices to handle Oracle issues efficiently.

View All Oracle Error Solutions

Configure and Send EMAIL from Oracle Database


Configure and Send EMAIL from Oracle Database
           
Applies to:
            Oracle Enterprise Linux – Version: 7
            Oracle Database 11gR2
           
Description:
            How to configure EMAIL from Oracle Database and Send Email from PL/SQL.

Solution:
Following the simple steps to configure EMAIL from Oracle Database:

1.    Connect Oracle Database as sysdba

2.    Install the following two packages:
SQL> @ORACLE_HOME/rdbms/admin/utlmail.sql;
SQL> @ORACLE_HOME/rdbms/admin/prvtmail.plb;

3.    To set SMTP parameter:
SQL> show parameter SMTP_OUT_SERVER;
SQL> Alter system set SMTP_OUT_SERVER=<enter your smtp server address>;
SQL> shutdown immediate;
SQL> startup;
SQL> show parameter SMTP_OUT_SERVER;
If the SMTP_OUT_SERVER parameter is set then you go to next step.

4.    Connect Oracle Database as sysdba

5.    SQL>grant execute on UTL_TCP TO <SCHEMA_NAME>;
SQL> grant execute on UTL_SMTP TO <SCHEMA_NAME>;
SQL> grant execute on UTL_MAIL TO <SCHEMA_NAME>;
SQL> grant execute on DBMS_NETWORK_ACL_ADMIN TO <SCHEMA_NAME>;


6.    Connect to schema which is granted
SQL> connect <SCHEMA_NAME>

7.    Begin
UTL_MAIL.SEND (
sender      =>  ‘dba.admin@pakistan.com’,
recipients  =>    ‘abdul.wahid@pakistan.com’,
subject    =>    ‘TEST EMAIL’,
message     =>    ‘Salam, This EMAIL is sent from Oracle Database’);
end;
/

👉 Check our complete guide: Oracle Error Codes Guide

Author Box

About the Author

Rana Abdul Wahid is an experienced Oracle Database Administrator with expertise in Oracle Database Administration, Oracle Data Guard, RMAN Backup & Recovery, Oracle RAC, Oracle E-Business Suite, Performance Tuning, and High Availability Solutions.

Through this blog, he shares practical Oracle DBA solutions, troubleshooting guides, interview preparation resources, and production-tested best practices for database professionals worldwide.


No comments:

Post a Comment

Contact / Feedback Form

Name

Email *

Message *