ACL issue :
ERROR at line 1:
ORA-24247: network access denied by access control list (ACL)
ORA-06512: at "SYS.UTL_TCP", line 17
ORA-06512: at "SYS.UTL_TCP", line 246
ORA-06512: at "SYS.UTL_SMTP", line 127
ORA-06512: at "SYS.UTL_SMTP", line 150
If you got the above error, Please check whether the ACL configuration using the below queries.
select * from dba_network_acls;
select * from dba_network_acl_privileges;
If the user is trying to execute the package in different user, then you need to add the privillege(connect/resolve) in the corresponding ACL configuration.
There is two option to resolve this issue.
Option 1 : Add the privillege to ACL configuration to the target user.
BEGIN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(acl => 'test.xml',
principal => 'SCOTT',
is_grant => true,
privilege => 'connect',
position => 1);
COMMIT;
END;
/
BEGIN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(acl => 'test.xml',
principal => 'SCOTT',
is_grant => true,
privilege => 'resolve',
position => 1);
COMMIT;
END;
/
Option 2 : Recreate the procedure as INVOKER RIGHTS, so it will be executed with the user that invokes it
CREATE OR REPLACE PROCEDURE SCOTT.GM_COM_SEND_EMAIL_PRC AUTHID CURRENT_USER ...
ERROR at line 1:
ORA-24247: network access denied by access control list (ACL)
ORA-06512: at "SYS.UTL_TCP", line 17
ORA-06512: at "SYS.UTL_TCP", line 246
ORA-06512: at "SYS.UTL_SMTP", line 127
ORA-06512: at "SYS.UTL_SMTP", line 150
If you got the above error, Please check whether the ACL configuration using the below queries.
select * from dba_network_acls;
select * from dba_network_acl_privileges;
If the user is trying to execute the package in different user, then you need to add the privillege(connect/resolve) in the corresponding ACL configuration.
There is two option to resolve this issue.
Option 1 : Add the privillege to ACL configuration to the target user.
BEGIN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(acl => 'test.xml',
principal => 'SCOTT',
is_grant => true,
privilege => 'connect',
position => 1);
COMMIT;
END;
/
BEGIN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(acl => 'test.xml',
principal => 'SCOTT',
is_grant => true,
privilege => 'resolve',
position => 1);
COMMIT;
END;
/
Option 2 : Recreate the procedure as INVOKER RIGHTS, so it will be executed with the user that invokes it
CREATE OR REPLACE PROCEDURE SCOTT.GM_COM_SEND_EMAIL_PRC AUTHID CURRENT_USER ...