I need to create some ACL's to allow TCP connections to some hosts. These hosts can only be accessed by their IP address. To make them easier to keep track of in the future, I'd like to be able to give the ACL some kind of friendly name, but I can't see a way of doing it.

I'm on Oracle 12.2, and from reading the DBMS_NETWORK_ACL_ADMIN documentation it sounds like I'm supposed to use the dbms_network_acl_admin.append_host_ace procedure. I've created the ACL with (details changed to protect the innocent):

        host => '',
        lower_port => NULL,
        upper_port => NULL,
        ace => xs$ace_type(
            privilege_list => xs$name_list('connect'),
            principal_name => 'USER1',
            principal_type => xs_acl.ptype_db

This appears to have created it OK, but when I look at DBA_NETWORK_ACL_PRIVILEGES, I'm hoping to find some way of making perhaps the ACL field more friendly (I can understand it having an arbitrary ACLID, but it'd be nice to able to one field customisable!)

SQL> SELECT * FROM dba_network_acls WHERE host = '';

HOST        LOWER_PORT UPPER_PORT ACL                                          ACLID            ACL_OWNER
----------- ---------- ---------- -------------------------------------------- ---------------- ---------                       NETWORK_ACL_780DE78AA2A6289CE0531240D80A83F6 0000000080002774 SYS          

1 Answer 1


This may be a bit unorthodox, but you could have a table that allows you to store "friendly names", and comments etc, which you can update/query whenever required. Eg

create table myfriendlynames (
  id number generated always as identity primary key 
, aclid varchar2( 256 ) unique
, friendlyname varchar2( 256 ) unique
--, comments varchar2( 256 )
) ;

-- pick up all aclids from dba_network_acls, and store them in the new table
merge into myfriendlynames M
using (
  select aclid from dba_network_acls
) ACLS on ( M.aclid = ACLS.aclid )
when not matched then
  insert ( M.aclid ) values ( ACLS.aclid )

Update, set a friendly name ...

SQL> select * from myfriendlynames ;
1   0000000080002710  NULL   

update myfriendlynames
set friendlyname = 'Fred'
where friendlyname is null ;  -- you could also use id here

-- aclid - friendlyname mapping
select ACLS.aclid, M.friendlyname
from dba_network_acls ACLS
  join myfriendlynames M on ACLS.aclid = M.aclid

0000000080002710  Fred 

Query / view

-- add/remove columns here as required
, ACLS.lower_port
, ACLS.upper_port
, substr( ACLS.acl, 1, 16 ) || '...' || substr( ACLS.acl, -4, 4 ) aclshort
, ACLS.aclid
, M.friendlyname
from dba_network_acls ACLS
  left join myfriendlynames M on ACLS.aclid = M.aclid

*     NULL        NULL        NETWORK_ACL_FD9A...FB6F  0000000080002710  Fred
  • Good thinking. I was hoping for something more "built-in", but it might be better than nothing... Oct 13, 2018 at 17:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.