Demonstrates how to grant connect privileges to any host for the APEX_050100
database user.
The following example demonstrates how to grant connect privileges to any host for the APEX_050100
database user. This example assumes you connected to the database where Oracle Application Express is installed as SYS
specifying the SYSDBA
role.
DECLARE ACL_PATH VARCHAR2(4000); BEGIN -- Look for the ACL currently assigned to '*' and give APEX_050100 -- the "connect" privilege if APEX_050100 does not have the privilege yet. SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS WHERE HOST = '*' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL; IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_050100', 'connect') IS NULL THEN DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH, 'APEX_050100', TRUE, 'connect'); END IF; EXCEPTION -- When no ACL has been assigned to '*'. WHEN NO_DATA_FOUND THEN DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('power_users.xml', 'ACL that lets power users to connect to everywhere', 'APEX_050100', TRUE, 'connect'); DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('power_users.xml','*'); END; / COMMIT;
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.
DECLARE ACL_PATH VARCHAR2(4000); BEGIN -- Look for the ACL currently assigned to 'localhost' and give APEX_050100 -- the "connect" privilege if APEX_050100 does not have the privilege yet. SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS WHERE HOST = 'localhost' AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL; IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, 'APEX_050100', 'connect') IS NULL THEN DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH, 'APEX_050100', TRUE, 'connect'); END IF; EXCEPTION -- When no ACL has been assigned to 'localhost'. WHEN NO_DATA_FOUND THEN DBMS_NETWORK_ACL_ADMIN.CREATE_ACL('local-access-users.xml', 'ACL that lets users to connect to localhost', 'APEX_050100', TRUE, 'connect'); DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL('local-access-users.xml','localhost'); END; / COMMIT;
No. | Subject |
---|---|
Notice | Certification Oracle SQL Developer |
» | 5.6.2 Granting Connect Privileges Prior to Oracle Database 12c |
113 | lsnrctl start |
112 | Network access denied by access control list (ACL) in Oracle Database 11g |
111 | email - PL/SQL |
110 | MODIFY |
109 | CREATE |
108 | PORT CHANGE 8080 --> 8081 |
107 | About AMAZON |
106 | BUXOMCURVY |
105 | WHDR(LAYOUT) CODE |
104 | CREATE?MODIFY |
103 | SEND GRID |
102 | MAILJET |
101 | DATA BASE LINK |
100 | dbms_network_acl_admin |
99 | Samsung-NP300E5E-DDR3 |
98 | Config |
97 | APEX_MAIL.SEND |
96 | grant execute on UTL_TCP |
95 | Email SMTP |