Examine the facts about a database:session
1.USERS is the database default tablespace.ide
2.USER1,USER2,and USER3 have the CREATE SESSION privilege.測試
3.They also have UNLIMITED QUOTA on the default tablespace USERS.spa
4.They have no other privileges.ci
Examine these commands:it
SQL > conn / as sysdbaio
Connectedtable
SQL > GRANT CREATE TABLE TO user1 WITH ADMIN OPTION;class
Grant succeeded.權限
SQL > GRANT CREATE TABLE TO user2;
Grant succeeded.
SQL > GRANT CREATE TABLE TO user3 WITH ADMIN OPTION;
Grant succeeded.
Which two are true ?
A)If sys revokes CREATE TABLE from user1 , it is not revoked from USER2 and USER3.
B)Only sys can revoke CREATE TABLE from user1.
C)If sys revokes CREATE TABLE FROM user1 , it is revoked from user2 but not from user3.
D)Any user with CREATE TABLE WITH GRANT OPTION can revoke CREATE TABLE
from user1.
E)Only sys and USER1 can revoke CREATE TABLE from user3.
Answer: AE
趙:AD=>AE。注意與下題的區別是,USER2 和 USER3 的權限是由 SYS 直接受權的,而不是由 USER1受權的。注意 D 選項中是 WITH GRANT OPTION,而不是 WITH ADMIN OPTION。經測試,選 E。USER2不能收回 USER3 的權限。
SQL> conn user2/123456;
Connected.
SQL> revoke create table from user3;
revoke create table from user3
*
ERROR at line 1:
ORA-01031: insufficient privileges
with admin option:
使用 with admin option,被受權用戶可將所得到的權限再次授予其它用戶或角色,並且取消受權時不級聯。例如:
SQL>grant create session to user_a with admin option;
則用戶 user_a 用戶擁有了「create session」權限,而後用戶 user_a 操做:
SQL>grant create session to user_b;
則 user_b 也擁有了「create session」權限。
若是系統管理員要回收 user_a 的權限,則 user_b 的權限仍然保留,但管理員能夠顯式回收 user_b 的權限:
SQL>revoke create session from user_b;
with grant option:
使用 with grant option。被受權用戶可將所得到的權限再次授予其它用戶或角色,而且權限的取消是級聯的。級聯的意思是,若是 user_a 使用「with grant option」語句將權限又授予了 user_b,當管理員回收 user_a 的權限時,則 user_b 的權限也會被回收。但管理員不能夠顯式回收用戶 user_b 的權限。