首页 > 技术文章 > DBMS_NETWORK_ACL_ADMIN (OCP 053 第七题)

CandiceW 2019-01-24 09:06 原文

You create an access control list(ACL)using the DBMS_NETWORK_ACL_ADMIN package

 

It is a list of users and network privileges stored in the XML file according to which a group
of users can connect to one or more hosts.

 

(The DBMS_NETWORK_ACL_ADMIN package provides the interface to administer the network Access Control
List(ACL).
Examples
Example1

Grant the connect and resolve privileges for hostwww.us.oracle.comto SCOTT.
BEGIN
DBMS_NETWORK_ACL_ADMIN.CREATE_ACL(acl=>'www.xml',
description=>'WWW ACL',
principal=>'SCOTT',
is_grant=>true,
privilege=>'connect');
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(acl=>'www.xml',
principal=>'SCOTT',
is_grant=>true,
privilege=>'resolve');
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL(acl=>'www.xml',
host=>'www.us.oracle.com');
END;
/
COMMIT;

 


Example 2

Grant the resolve privilege forwww.us.oracle.comto ADAMS.Since an ACL forwww.us.oracle.comexists
already,just add the privilege for ADAMS.
BEGIN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(acl=>'www.xml',
principal=>'ADAMS',
is_grant=>true,
privilege=>'resolve');
END;
/
COMMIT;

 


Example 3

Assign the ACLwww.xmlto www-proxy.us.oracle.com so that SCOTT and ADAMS can access
www-proxy.us.oracle.com also.
BEGIN
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL(acl=>'www.xml',
host=>'www-proxy.us.oracle.com');
END;
/
COMMIT;)

 

推荐阅读