1. 程式人生 > >OCP考試第7題

OCP考試第7題

7. You need to configure fine-grained(細粒度) access control(訪問控制) to external network resources from within(從....裡面) your database.

你需要配置從資料庫裡面配置細粒度訪問外部訪問網路資源

You create an access control list (ACL) using the DBMS_NETWORK_ACL_ADMIN package. Which statement is true regarding the ACL created?

你通過DBMS_NETWORK_ACL_ADMIN包建立了一個ACL。哪句話關於ACL建立是正確的?

A. It is a list of remote database links stored in the XML file that are available to the users of the database.

這是存在XML檔案中供給資料庫使用者使用的遠端資料庫連結串列。

B. 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.

它是儲存在XML檔案中的使用者和網路特權的列表,根據該列表,一組使用者可以連線到一個或多個主機。

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

它是儲存在資料字典中的使用者和網路特權的列表,根據該列表,一組使用者可以連線到一個或多個主機。

D. It is the list of the host names or the IP addresses stored in the data dictionary that can connect to your database through PL/SQL network utility packages such as UTL_TCP.

它是儲存在資料字典中的主機名或IP地址的列表,可以通過PL/SQL網路實用程式包(如UTL_TCP)連線到資料庫。

 

 

知識點:ACL

Grant the connect and resolve privileges for host www.us.oracle.com to 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;
通過以下語句可以查詢
  SELECT host, lower_port, upper_port, acl,
     DECODE(
         DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE_ACLID(aclid, 'SCOTT', 'connect'),
            1, 'GRANTED', 0, 'DENIED', null) privilege
     FROM dba_network_acls
    WHERE host IN
      (SELECT * FROM
         TABLE(DBMS_NETWORK_ACL_UTILITY.DOMAINS('www.us.oracle.com')))
   ORDER BY DBMS_NETWORK_ACL_UTLITITY.DOMAIN_LEVEL(host) desc, lower_port, 
                                               upper_port;

查詢結果如下:

   HOST                 LOWER_PORT UPPER_PORT         ACL          PRIVILEGE
   -------------------- ---------- ---------- -------------------- ---------
   www.us.oracle.com            80         80 /sys/acls/www.xml    GRANTED
   www.us.oracle.com          3000       3999 /sys/acls/www.xml    GRANTED
   www.us.oracle.com                          /sys/acls/www.xml    GRANTED
   *.oracle.com                               /sys/acls/all.xml
   *                                          /sys/acls/all.xml

答案:B  可以看到查詢結果是xml檔案。