首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >【OCP最新题库解析(052)--题36】USER1 grants SELECT, INSERT, and UPDATE p

【OCP最新题库解析(052)--题36】USER1 grants SELECT, INSERT, and UPDATE p

作者头像
小麦苗DBA宝典
发布2019-09-29 16:50:13
5070
发布2019-09-29 16:50:13
举报

Q

题目

USER1 grants SELECT, INSERT, and UPDATE privileges on USER1.EMP to USER2.

Sys executes this command:

SQL> REVOKE UPDATE ON user1.emp FROM user1;

What will be the outcome?

A. It will fail because USER1 is the owner of USER1.EMP.

B. It will succeed but neither USER1 nor USER2 will be able to perform SELECT, INSERT, or UPDATE on USER1.EMP.

C. It will succeed and only USER1 will be unable to perform SELECT, INSERT, or UPDATE on USER1.EMP.

D. It will succeed and neither USER1 nor USER2 will be able to perform INSERT or UPDATE on USER1.EMP, but both will be able to query USER1.EMP.

E. It will succeed and only USER2 will be unable to perform SELECT, INSERT, or UPDATE on USER1.EMP.

A

答案

Answer:A

不能回收用户对自己的表的权限。报错:ORA-01927: cannot REVOKE privileges you did not grant

SYS@OCPLHR1> create user user1 identified by lhr;

User created.

SYS@OCPLHR1> grant create session to user1;

Grant succeeded.

SYS@OCPLHR1> grant create table to user1;

Grant succeeded.

SYS@OCPLHR1> create user user2 identified by lhr;

User created.

SYS@OCPLHR1> grant create session to user2;

Grant succeeded.

SYS@OCPLHR1> conn user1/lhr

Connected.

USER1@OCPLHR1> create table user1.emp(id number);

Table created.

USER1@OCPLHR1> grant select ,insert, update on user1.emp to user2;

Grant succeeded.

SYS@OCPLHR1> REVOKE UPDATE ON user1.emp FROM user1;

REVOKE UPDATE ON user1.emp FROM user1

*

ERROR at line 1:

ORA-01927: cannot REVOKE privileges you did not grant

SYS@OCPLHR1>

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2018-07-14,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 DB宝 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • USER1 grants SELECT, INSERT, and UPDATE privileges on USER1.EMP to USER2.
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档