开启Oracle ACL权限

开启Oracle ACL权限

执行以下语句

BEGIN
  DBMS_NETWORK_ACL_ADMIN.create_acl (
    acl          => 'open_acl_file.xml', 
    description  => 'Open ACL File',
    principal    => '目标Oracle账号',
    is_grant     => TRUE, 
    privilege    => 'connect',
    start_date   => SYSTIMESTAMP,
    end_date     => NULL);

  DBMS_NETWORK_ACL_ADMIN.assign_acl (
    acl         => 'open_acl_file.xml',
    host        => '*', 
    lower_port  => 1,
    upper_port  => 9999); 

  COMMIT;
END;
/

这个权限比较大:因为host是*,端口不限。在正式使用时,可以缩小权限。比如第二段改成:

dbms_network_acl_admin.assign_acl(acl => 'open_acl_file.xml',
    host=> ' 具体IP地址 ',
    lower_port => 8080,
    upper_port => 8080);
END

你可能感兴趣的:(数据库)