Oracle 12c Apex 4.2 ORA-24247 network access denied by access control list (ACL)

7k views Asked by At

hope you can help me too.

I'm developing an APEX-Application.

Oracle 12c APEX 4.2.  

I'm using the workspace wrk_projects in pdborcl.

I need some information about the client. The client will act in the same domain.
So I'm building a report:

select utl_inaddr.get_host_name(sys_context('userenv','ip_address')) as hostname from dual;

When I run it:

report error:
ORA-24247 network access denied by access control list (ACL)

My question is: I have to define the ACL in the container or in pdb?
How to find out the user I have to grant the ACL to? Any other tips?

1

There are 1 answers

0
Tom On

Oracle Apex Documentation: Granting Connect Privileges in Oracle Database 12c

Which can be found under "Oracle Application Express Application Builder User's Guide -> Managing Application Security"

Procedures CREATE_ACL, ASSIGN_ACL, ADD_PRIVILEGE and CHECK_PRIVILEGE in DBMS_NETWORK_ACL_ADMIN are deprecated in Oracle Database 12c. Oracle recommends using APPEND_HOST_ACE instead. The following example demonstrates how to grant connect privileges to any host for the APEX_050000 database user. This example assumes you connected to the database where Oracle Application Express is installed as SYS specifying the SYSDBA role.

BEGIN
    DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
        host => '*',
        ace => xs$ace_type(privilege_list => xs$name_list('connect'),
                           principal_name => 'apex_050000',
                           principal_type => xs_acl.ptype_db));
END;
/

The following example demonstrates how to provide less privileged access to local network resources. This example enables access to servers on the local host only, such as email and report servers.

BEGIN
    DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
        host => 'localhost',
        ace => xs$ace_type(privilege_list => xs$name_list('connect'),
                           principal_name => 'apex_050000',
                           principal_type => xs_acl.ptype_db));
END;
/

Other than that, it might depends on how you have configured apex in your db. Are you using apex in the cdb and are the apex objects linked up (thus: one apex install for all db's) or are you using different apex installations per pdb. I'm guessing it's just the single install. My guess (I'm no DBA) is that you'll have to grant it to the user in the root.