Oracle Database Error Solutions & DBA Knowledge Base

Welcome to Oracle Database Error Solutions, a professional technical knowledge base dedicated to helping Oracle Database Administrators, Oracle E-Business Suite administrators, developers, and IT professionals troubleshoot Oracle Database and Oracle Linux issues with confidence.

This website provides practical, real-world troubleshooting guides based on hands-on Oracle administration experience. You'll find detailed solutions for Oracle Database errors, RMAN backup and recovery, Data Guard, ASM, RAC, Oracle Linux administration, Oracle E-Business Suite (EBS), cloning, performance tuning, patching, installation, and day-to-day DBA tasks.

Whether you're resolving ORA-27101, ORA-28040, ORA-01555, ORA-12154, ORA-01017, or other Oracle errors, our step-by-step articles are designed to save you time and help you solve problems efficiently.

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.


Comments