OCP-1Z0-052-V8.02-156题

156. Examine the following steps performed on a database instance:

1: The DBA grants the CREATE TABLE system privilege to the SKD user with ADMIN OPTION.

2: The SKD user creates a table.

3: The SKD user grants the CREATE TABLE system privilege to the HR user.

4: The HR user creates a table.

5: The DBA revokes the CREATE TABLE system privilege from SKD.

Which statement is true after step 5 is performed?

A.The table created by SKD is not accessible and SKD cannot create new tables.

B.The tables created by SKD and HR remain, but both cannot create new tables.

C.The table created by HR remains and HR still has the CREATE TABLE system privilege.

D.The table created by HR remains and HR can grant the CREATE TABLE system privilege to other

users.

Answer: C  

 

现象重现:

1、创建两个用户skd和rh(hr数据库里本来就有,故此区别),并授予create session权限,即连接的权限。

 

sys@TEST0910> create user skd identified by skd;
 
User created.
sys@TEST0910> grant create session to skd;
 
Grant succeeded.
 
sys@TEST0910> create user rh identified by rh;
 
User created.
 
sys@TEST0910> grant create session to rh;
 
Grant succeeded.
 
2、DBA 授权skd的create table的权限,skd连接,并创建一张表t1。
sys@TEST0910> grant create table to skd with admin option;
 
Grant succeeded.
sys@TEST0910> conn skd/skd
Connected.
skd@TEST0910> create table t1(id number);
 
Table created.
 
3、skd将create table授权给rh,rh创建一张表t2.
skd@TEST0910> grant create table to rh;
 
Grant succeeded.
 
skd@TEST0910> conn rh/rh
Connected.
rh@TEST0910> create table t2(id number);
 
Table created.
 
4、DBA将skd的create table收回。
rh@TEST0910> conn /as sysdba
Connected.
sys@TEST0910> revoke create table from skd;
 
Revoke succeeded.
 
A答案:skd用户可以访问原来创建的表,但是不能创建新的表。
skd@TEST0910> select * from t1;
 
no rows selected
 
skd@TEST0910> create table t3(id number);
create table t3(id number)
*
ERROR at line 1:
ORA-01031: insufficient privileges
 
skd@TEST0910> select * from session_privs;
 
PRIVILEGE
----------------------------------------
CREATE SESSION
 

B答案,skd和rh用户的表都会保留,skd不能创建新表,如A答案解析,但是rh用户可以创建新表。DBA只是把skd的创建表权限收回,Oracle系统权限不具有级联收回的功能

skd@TEST0910> conn rh/rh
Connected.
rh@TEST0910> select * from t2;
 
no rows selected
rh@TEST0910> create table t4(id number);
 
Table created.

 

rh@TEST0910> select * from session_privs;
 
PRIVILEGE
----------------------------------------
CREATE SESSION
CREATE TABLE
 
C答案,如B答案解析,rh的表保留,rh用户也可以创建新表
 
D,因为没有级联授权,故rh不能授权给其他人。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值