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

  • 2019 年 10 月 10 日
  • 笔记

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>