# Query to find users granted an ACL -- the natural question after seeing ORA-24247

You may have encountered ORA-24247: network access denied by access control list (ACL) and wondered "who has access to what from my database?" I extended a query from the Oracle documentation to give me the results I wanted: ACL Name, Username, host, lower port, upper port, and if granted connect and resolve.  
  
with privs as (  
  SELECT acl,  u.username, host, lower\_port, upper\_port,   
     DECODE(  
         DBMS\_NETWORK\_ACL\_ADMIN.CHECK\_PRIVILEGE\_ACLID(aclid, u.username, 'connect'),  
            1, 'GRANTED', 0, 'DENIED', null) conn\_privilege,  
     DECODE(  
         DBMS\_NETWORK\_ACL\_ADMIN.CHECK\_PRIVILEGE\_ACLID(aclid, u.username, 'resolve'),  
            1, 'GRANTED', 0, 'DENIED', null) res\_privilege         
     FROM dba\_network\_acls a, dba\_users u  
     )  
select \*  
  from privs  
  where conn\_privilege is not null  
     or res\_privilege is not null  
  order by acl, username  
     ;  
  
  
It's nothing special, but can be a handy query.
