Network access denied by access control list (ACL) in Oracle Database 11g
<p>Recently we have switched from Oracle 10g to 11g, and only now I noticed that my mailing function does not work, I now get an error:</p>

<pre><code>ORA-24247: network access denied by access control list (ACL)
</code></pre>

<p>So I did a bit of googling and was able to figure out that a new feature in Oracle 11g is now restricting users from using certain packages including utl_smtp. Because I am looking for a quick solution I did not read Oracle documentation, but instead I went looking for easier solutions and came across this tutorial:</p>

<pre><code>https://www.pythian.com/blog/setting-up-network-acls-in-oracle-11g-for-dummies/
</code></pre>

<p>I messed around with it a little bit, but because I did not know any better I think I added two seperate configuration .xml files. So first part of my question is - HOW DO I REMOVE IT? </p>

<p>Second question is: </p>

<p>After adding some grants to my user I try to test to see if it worked, but I soon realised it did not:</p>

<pre><code>  SELECT DECODE(
         DBMS_NETWORK_ACL_ADMIN.check_privilege('netacl.xml', 'TEST1', 'connect'),
         1, 'GRANTED', 0, 'DENIED', NULL) privilege 
FROM dual;
</code></pre>

<p>Returns:</p>

<pre><code>PRIVILE
-------
DENIED
</code></pre>

<p>WHY?(THIS HAS BEEN SORTED)</p>

<p>Third part of the question - after reading it was denied I try to fix it like:</p>

<pre><code>BEGIN
  DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE('netacl.xml' ,'TEST1', TRUE, 'connect');
END;
</code></pre>

<p>But that gives me an error:</p>

<pre><code>Ora19279 - XQuery dynamic type mismatch.....(more text meaning nothing to me).
</code></pre>

<p>WHY?(I FIGURED OUT, THAT ERROR HAPPENS WHEN YOU GRANT SAME PERMISSION TO SAME USER SECOND TIME)</p>

<p><strong>UPDATE</strong></p>

<p>I have followed the suggested answer by kevinsky below and have learned quite a bit in the process, however I still have a problem. I still get the ORA-24247: network access denied by access control list (ACL). Because I did everything else as suggested, I am starting to think that the problem could be that first configuration file which I added, but cannot remove now because I cannot remember its name. If anyone can help me I would appreciate that very much.</p>

<p>RESULTS OF(I was trying out a few different things so):</p>

<pre><code>select * from dba_network_acls;
</code></pre>

<p>Returns</p>

<pre><code>*                              | 25 | 25 | /sys/acls/utl_smtp.xml| ACLID...
myservername.com               | 25 | 25 | /sys/acls/utl_smtp.xml| ACLID...
myDBName                       | 25 | 25 | /sys/acls/utl_smtp.xml| ACLID...
mailServerDomainName           | 25 | 25 | /sys/acls/utl_smtp.xml| ACLID...
mailserver.myDomain.local      | 25 | 25 | /sys/acls/utl_smtp.xml| ACLID...
</code></pre>