Page tree
Skip to end of metadata
Go to start of metadata
--查看所有的ACL规则
select * from dba_network_acls ; 
--查看所有的ACL规则的权限
select * from dba_network_acl_privileges ;

--创建ACL规则并授权
BEGIN
  DBMS_NETWORK_ACL_ADMIN.create_acl (
    acl          => 'ldap_acl_file.xml',
    description  => 'ACL to grant access to LDAP server',
    principal    => 'APEX_190200', --授予该用户ACL权限,如果使用apex内嵌LDAP认证则这里设置为APEX_190200,如果自己编写认证过程,则自主选择用户
    is_grant     => TRUE,
    privilege    => 'connect',
    start_date   => SYSTIMESTAMP,
    end_date     => NULL);
 
  DBMS_NETWORK_ACL_ADMIN.assign_acl (
    acl         => 'ldap_acl_file.xml',
    host        => '*',
    lower_port  => 389,
    upper_port  => 389);
 
  DBMS_NETWORK_ACL_ADMIN.assign_acl (
    acl         => 'ldap_acl_file.xml',
    host        => '*',
    lower_port  => 686,
    upper_port  => 686);
 
  COMMIT;
END;
/
 
 
--删除acl如下
BEGIN
    dbms_network_acl_admin.drop_acl(acl => 'ldap_acl_file.xml');
END;
/


--分配acl规则
BEGIN 
  DBMS_NETWORK_ACL_ADMIN.assign_acl (
    acl         => 'wf_acl_file.xml',
    host        => 'localhost',
    lower_port  => 8081,
    upper_port  => 8081); 
  COMMIT;
END;
/

--移除acl规则
BEGIN 
  DBMS_NETWORK_ACL_ADMIN.unassign_acl (
    acl         => 'wf_acl_file.xml',
    host        => '192.168.56.135',
    lower_port  => 8081,
    upper_port  => 8081); 
  COMMIT;
END;
/
  • No labels