配置ACL报ORA-24247的解决方法


前言:

在通过Oracle 11往外部发送邮件的时候,ORA-24247的错误,详细的错误错误信息如下:

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

ORA-06512: at "MIS_PKG", line 1175

ORA-06512: at "MIS_PKG", line 1207

ORA-06512: at line 1
 

在oracle的metalink查找的详细的介绍如下:

1.原因:因为Oracle 数据库 11g有一个新的解决方案:您可以将执行权限程序包授予任何人,但要控制他们可以调用的资源。例如,utl_tcp 可限制为仅调用几个 IP地址,这种机制称为访问控制列表 (ACL)。如果主机在 ACL 中,用户可以在 utl_tcp 中使用;但是仅仅拥有对 utl_tcp的执行权限是不够的。因此,恶意进程不可能取代 utl_tcp 程序包和建立非法连接。

Fine grained auditing, enhanced in Oracle 11g, means access to certain packages (UTL_TCP, UTL_SMTP, UTL_MAIL, UTL_HTTP, or UTL_INADDR) now require specific access lists to be defined for security reasons instead of granting this access to PUBLIC and allowing all users access to them.

二、解决方法

为了允许访问任何上述包,您需要明确赋予其通过访问控制列表。比如创建一个,并分配用户USER1特权使用UTL_SMTP pacakge,因而发送电子邮件。

In order to allow access to any of the above mentioned packages, you will need to explicitly grant it via Access Control Lists. Below is an example of how to create one, and assign the user USER1 the privilege to use the UTL_SMTP pacakge, and therefore send email.

执行脚本:

BEGIN

 DBMS_NETWORK_ACL_ADMIN.CREATE_ACL (

 acl => 'UTL_SMTP.xml',

 description => 'ACL for utl_smtp package',

 principal => 'USER1',

 is_grant => TRUE,

 privilege => 'connect');

 DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL (

 acl => 'UTL_SMTP.xml',

 host => '<mail_server_ip>');

END;

/

三、管理acl的配置

3.1 查看acl的配置

SELECT host, lower_port, upper_port, acl FROM dba_network_acls;

3.2 删除acl的配置

BEGIN

 DBMS_NETWORK_ACL_ADMIN.drop_acl(acl => ' UTL_SMTP.xml');

 COMMIT;

END;

/

总结:ACL是从11G后才有的功能,很多企业发送邮件的设置都是从10G或之前开始的,但是在11G的时候就会报这个错误,通过以上配置之后终于可以发送邮件了。

Oracle 单实例 从32位 迁移到 64位 方法 

在CentOS 6.4下安装Oracle 11gR2(x64)

Oracle 11gR2 在VMWare虚拟机中安装步骤

Debian 下 安装 Oracle 11g XE R2

Oracle RAC 11.2(12C)正确关闭顺序 

相关内容

    暂无相关文章