ORA-24247: network access denied by access control list (ACL) while sending email oracle

前端 未结 2 866
时光取名叫无心
时光取名叫无心 2021-01-23 04:44

i have done all the activity i.e mention below, please tell which step / activity i am missing.

BEGIN
  DBMS_NETWORK_ACL_ADMIN.CREATE_ACL(
                               


        
2条回答
  •  萌比男神i
    2021-01-23 05:03

    You don't need any commit, since explicit DML operations are not performed for these operations. And using begin..end blocks not needed for every method invoking, either.

    Your issue stems from the fact the neccessity of invoking Dbms_Network_Acl_Admin.Add_Privilege method with privilege => 'connect' option also. So you can use the following :

    BEGIN
      DBMS_NETWORK_ACL_ADMIN.CREATE_ACL(
                                        acl         => 'apex_user.xml',
                                        description => 'access to apex email',
                                        principal   => 'DBUSER',
                                        is_grant    => TRUE,
                                        privilege   => 'connect',
                                        start_date  => SYSTIMESTAMP,
                                        end_date    =>Null
                                        );
      DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(
                                           acl       => 'apex_user.xml',
                                           principal => 'DBUSER',
                                           is_grant  => true,
                                           privilege => 'connect'
                                           );
    
      DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(
                                           acl       => 'apex_user.xml',
                                           principal => 'DBUSER',
                                           is_grant  => true,
                                           privilege => 'resolve'
                                           );
    
    
      DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL(
                                        acl         => 'apex_user.xml',
                                        host        => 'smtp.gmail.com',
                                        lower_port  =>587,
                                        upper_port  =>587
                                        );
     END;
    

    With the following query all privileged accesses could be checked ( through SYS or SYSTEM schemas ):

    select a.host,p.*
      from dba_network_acl_privileges p
      join dba_network_acls a on a.aclid = p.aclid
     order by a.host, p.principal, p.privilege;
    

提交回复
热议问题