ORA-24247: network access denied by access control list (ACL)

Try to execute PL/SQL procedure with sending mail by using UTL_SMTP, it fails with error “ORA-24247”.

Solution:

ACL is to be created.

DECLARE
acl_path VARCHAR2(4000);
BEGIN
SELECT acl INTO acl_path FROM dba_network_acls
WHERE host = ‘*’ AND lower_port IS NULL AND upper_port IS NULL;
IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(acl_path,’SCOTT’,’connect’) IS NULL THEN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(acl_path,’SCOTT’, TRUE, ‘connect’);
END IF;
EXCEPTION
WHEN no_data_found THEN
DBMS_NETWORK_ACL_ADMIN.CREATE_ACL(‘utl_mail.xml’,’ACL description’, ‘SCOTT’, TRUE, ‘connect’);
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL(‘utl_mail.xml’,’*’);
END;

COMMIT;

SQL> select ACL,PRINCIPAL,PRIVILEGE,IS_GRANT from DBA_NETWORK_ACL_PRIVILEGES;

ACL PRINCIPAL PRIVILEGE IS_GRANT
—————————— —————————— ———————– ——————–
/sys/acls/utl_mail.xml SCOTT connect true

 

ORA-24247 Trying To Send Email Using UTL_SMTP from 11gR1 (11.1.0.6) or higher (Doc ID 557070.1)

Advertisements
This entry was posted in Security and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s