Friday, September 25, 2026
  • About Us
  • Contact
DBAInsight
  • Guides
    • 23ai
    • RMAN
    • 26ai
    • Patch Update
    • RMAN
    • MySQL
    • Oracle GoldenGate
  • Cloud Technology
  • Case Studies
  • Troubleshooting
  • Training & Certification
NEWSLETTER
No Result
View All Result
DBAInsight
Home Troubleshooting

ORA-24247: Network Access Denied by Access Control List (ACL) – Causes, Fix, and Best Practices

March 19, 2026
in Troubleshooting
0
ORA-24247
0
SHARES
603
VIEWS

When working with Oracle Database, sending emails directly from PL/SQL procedures using UTL_MAIL or UTL_SMTP is a common requirement. Developers often use these packages to send alerts, notifications, or automated reports from database applications.

However, many Oracle users encounter the following error when attempting to send emails:

Table of Contents

Toggle
    • Related posts
    • When “Invalid Objects” Isn’t What It Looks Like: A GSMADMIN_INTERNAL Detective Story
    • Oracle RAC Node Addition Failed with INS-32156 Due to AHF Permissions
  • Understanding the ORA-24247 Error
  • Example Scenario That Causes the Error
  • Why Oracle Uses ACL for Network Access
  • Step-by-Step Solution to Fix ORA-24247
    • Step 1: Configure the SMTP Server
    • Step 2: Create an Access Control List (ACL)
    • Step 3: Grant Additional Privileges
    • Step 4: Assign the ACL to the SMTP Host
    • Step 5: Commit the Changes
  • Testing the Fix
  • Best Practices for Oracle Network ACL Configuration
    • 1. Avoid Using Wildcards When Possible
    • 2. Grant Only Required Privileges
    • 3. Use Dedicated ACL Files
    • 4. Monitor ACL Configurations
  • Final Thoughts

Related posts

GSMADMIN_INTERNAL

When “Invalid Objects” Isn’t What It Looks Like: A GSMADMIN_INTERNAL Detective Story

September 24, 2026
INS-32156

Oracle RAC Node Addition Failed with INS-32156 Due to AHF Permissions

September 15, 2026
ORA-24247: network access denied by access control list (ACL)
ORA-06512: at "SYS.UTL_MAIL", line 662
ORA-06512: at "SYS.UTL_MAIL", line 679
ORA-06512: at line 2

If you have seen this error, don’t worry. It is a common issue in Oracle Database versions 11g and later. In this blog, we will explain what causes the ORA-24247 error, why Oracle introduced this restriction, and how to properly resolve it using Access Control Lists (ACLs).


Understanding the ORA-24247 Error

The ORA-24247 error occurs when a database user tries to access a network resource without proper permissions defined in Oracle’s Network Access Control List (ACL).

In earlier Oracle versions (before 11g), database users could access network resources directly using packages like:

  • UTL_MAIL
  • UTL_SMTP
  • UTL_TCP
  • UTL_HTTP

However, starting from Oracle 11g, Oracle introduced a security model that restricts network access from the database unless explicitly allowed through ACLs. This change prevents unauthorized network connections from within the database.

Therefore, when a user attempts to send an email using UTL_MAIL without the required ACL privileges, Oracle raises the ORA-24247 error.


Example Scenario That Causes the Error

Consider the following PL/SQL block that attempts to send an email:

BEGIN
  UTL_MAIL.SEND(
    sender     => 'info@dbainsight.org',
    recipients => 'info@dbainsight.org',
    subject    => 'MAIL from ADMIN of dbainsight',
    message    => 'Do visit dbainsight'
  );
END;
/

When this block is executed without proper ACL configuration, Oracle returns the error:

ERROR at line 1:
ORA-24247: network access denied by access control list (ACL)
ORA-06512: at "SYS.UTL_MAIL", line 662
ORA-06512: at "SYS.UTL_MAIL", line 679
ORA-06512: at line 2

This simply means that the database user does not have permission to connect to the SMTP server.


Why Oracle Uses ACL for Network Access

Oracle introduced the ACL mechanism to improve database security.

Without ACLs, any database user could potentially connect to external servers, which could lead to security risks such as:

  • Unauthorized data transfers
  • Access to external systems
  • Network misuse from within the database

ACLs ensure that only authorized users and schemas can access specific network resources.


Step-by-Step Solution to Fix ORA-24247

To resolve this issue, you must configure the database to allow the user to access the SMTP server.

Step 1: Configure the SMTP Server

First, ensure the database knows which SMTP server should be used for sending emails.

Run the following command as a DBA:

ALTER SYSTEM SET smtp_out_server='mailhost.dbainsight.com' SCOPE=BOTH;

This parameter defines the SMTP server that Oracle will use for sending emails.


Step 2: Create an Access Control List (ACL)

Next, create an ACL that allows the user to access network resources.

For example, if the schema APPUSER needs permission to send emails, create the ACL as follows:

BEGIN
  DBMS_NETWORK_ACL_ADMIN.CREATE_ACL(
      acl         => 'send_mail.xml',
      description => 'Allow mail to be sent',
      principal   => 'USER',
      is_grant    => TRUE,
      privilege   => 'connect'
  );
END;
/

This step creates an ACL file named send_mail.xml and grants the connect privilege to the user.


Step 3: Grant Additional Privileges

In most cases, the user also needs the resolve privilege to resolve hostnames.

Run the following commands:

BEGIN
  DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(
      acl       => 'send_mail.xml',
      principal => 'USER',
      is_grant  => TRUE,
      privilege => 'connect'
  );

  DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(
      acl       => 'send_mail.xml',
      principal => 'USER',
      is_grant  => TRUE,
      privilege => 'resolve'
  );
END;
/

These privileges allow the database user to connect to and resolve external hosts.


Step 4: Assign the ACL to the SMTP Host

Now assign the ACL to the SMTP host and port.

BEGIN
  DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL(
      acl  => 'send_mail.xml',
      host => '*',
      lower_port => 25,
      upper_port => 25
  );
END;
/

Here:

  • * means the ACL applies to all hosts
  • Port 25 is the standard SMTP port

You may replace * with your specific mail server hostname for better security.


Step 5: Commit the Changes

Finally, commit the configuration:

COMMIT;

Testing the Fix

After configuring the ACL, connect using the application schema and try sending the email again.

CONNECT appuser

BEGIN
  UTL_MAIL.SEND(
      sender     => 'info@dbainsight.org',
      recipients => 'info@dbainsight.org',
      subject    => 'MAIL from ADMIN of learnomate',
      message    => 'Do visit learnomate'
  );
END;
/

If everything is configured correctly, you should see:

PL/SQL procedure successfully completed.

This means the email has been sent successfully.


Best Practices for Oracle Network ACL Configuration

When configuring ACLs, consider the following best practices:

1. Avoid Using Wildcards When Possible

Instead of using '*' for the host, specify the exact SMTP server.

Example:

mailhost.dbainsight.com

This improves security by limiting access to a specific server.


2. Grant Only Required Privileges

Avoid granting unnecessary privileges. Typically, only these are required:

  • connect
  • resolve

3. Use Dedicated ACL Files

Create separate ACL files for different purposes, such as:

  • Email services
  • HTTP web services
  • External APIs

This keeps permissions organized and easier to manage.


4. Monitor ACL Configurations

Regularly check configured ACLs using:

SELECT * FROM DBA_NETWORK_ACLS;
SELECT * FROM DBA_NETWORK_ACL_PRIVILEGES;

These views help verify which users have network access.


Final Thoughts

The ORA-24247: Network Access Denied by Access Control List (ACL) error is a common issue when working with Oracle’s email packages like UTL_MAIL or UTL_SMTP. Although it may seem confusing at first, the error simply indicates that Oracle’s security mechanism is preventing unauthorized network access.

By properly configuring the SMTP server and granting the required privileges through Oracle Network ACLs, you can safely enable database users to send emails.

Understanding how ACLs work not only helps resolve this error but also ensures your Oracle database remains secure while interacting with external systems.

If you regularly build PL/SQL-based applications that require email notifications, setting up ACLs correctl

Tags: fix ORA-24247ORA-24247Oracle 11g ACL configurationOracle ACL errorOracle send email from PL/SQLUTL_MAIL network access denied
Previous Post

Fixing ORA-39405: Oracle Data Pump TSTZ Version Mismatch (Step-by-Step Guide)

Next Post

The AWS Oracle Database Network (ODB Network): A Complete Guide to Oracle Database@AWS

Next Post
Oracle Database@AWS

The AWS Oracle Database Network (ODB Network): A Complete Guide to Oracle Database@AWS

Leave a Reply Cancel reply

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

POPULAR NEWS

  • Oracle Patch 38632161: Step-by-Step Guide to Upgrade Oracle 19c to Release Update 19.30

    Oracle Patch 38632161: Step-by-Step Guide to Upgrade Oracle 19c to Release Update 19.30

    0 shares
    Share 0 Tweet 0
  • How To Download And Install The Latest OPatch

    0 shares
    Share 0 Tweet 0
  • How to Install Oracle 19c Database on Red Hat Enterprise Linux 9

    0 shares
    Share 0 Tweet 0
  • Oracle Database 19.32 Release Update (RU) Patching Guide – Patch 39472050

    0 shares
    Share 0 Tweet 0
  • Installing Oracle Database 26AI on Red Hat Enterprise Linux 9

    0 shares
    Share 0 Tweet 0
  • About Us
  • Contact

© 2026 DBAInsight - Smarter Databases. Sharper Insights. DBAInsight.

No Result
View All Result
  • Home
  • Cloud & Modern DBs
  • Guides
  • Cloud Technology
  • Case Studies
  • Troubleshooting
  • Training & Certification

© 2026 DBAInsight - Smarter Databases. Sharper Insights. DBAInsight.

Add as a preferred source on Google
Add as preferred source on Google