154. View the Exhibit and examine the privileges granted to the MGR_ROLE role.

OCP-1Z0-052-V8 02-154题

The user SKD has been granted the CONNECT and RESOURCE roles only. The database administrator

(DBA) grants MGR_ROLE to the user SKD by executing the command:

SQL> GRANT MGR_ROLE TO SKD WITH ADMIN OPTION;

Which statement is true about the user SKD after he/she is granted this role?

A.The user SKD can grant only the MGR_ROLE role to other users, but not the privileges in it.

B.The user SKD can revoke the MGR_ROLE only from the users for whom he/she is the grantor.

C.The user SKD can grant the privileges in the MGR_ROLE role to other users, but not with ADMIN

OPTION.

D.The user SKD can grant the privileges in the MGR_ROLE role to other users, but cannot revoke

privileges from them.

Answer: A  

答案解析:

实验验证:

[email protected]> create user SKD identified by SKD;


User created.


[email protected]> grant connect,resource to SKD;


Grant succeeded.


[email protected]> create role MGR_ROLE;


Role created.


[email protected]> grant create role to MGR_ROLE;


Grant succeeded.


[email protected]> grant create user to MGR_ROLE;


Grant succeeded.


[email protected]> grant select any table to MGR_ROLE;


Grant succeeded.

查dba_sys_privs、dba_role_privs,dba_tab_privs三个视图看用户到底有哪些权限

[email protected]>select * from dba_role_privs where  grantee='MGR_ROLE';


no rows selected


[email protected]> select * from role_sys_privs where role='MGR_ROLE'; 


ROLE                           PRIVILEGE                                ADM

------------------------------ ---------------------------------------- ---

MGR_ROLE                       SELECT ANY TABLE                         NO

MGR_ROLE                       CREATE ROLE                              NO

MGR_ROLE                       CREATE USER                              NO


[email protected]> select * from role_tab_privs where role='MGR_ROLE'; 


no rows selected


WITH ADMIN OPTION的意思是被授予该权限的用户有权将某个权限(如MGR_ROLE)授予其他用户或角色,取消是不级联的。


[email protected]> GRANT MGR_ROLE TO SKD WITH ADMIN OPTION;


Grant succeeded.


[email protected]> create user user1 identified by test1;


User created.


[email protected]> grant create session to user1;


Grant succeeded.


[email protected]> grant MGR_ROLE to user1;


Grant succeeded.


[email protected]> grant create user to user1;

grant create user to user1

*

ERROR at line 1:

ORA-01031: insufficient privileges

A正确,可以授权给MGR_ROLE给别的用户,但不能把MGR_ROLE里面的权限如create user授权给别的用户。

B错误,可以级联回收,可以回收不是SKD自己授予的。
C错,错误。The user SKD can grant the privileges in the MGR_ROLE role to other users。根据A答案,SKD不能将MGR_ROLE角色里的权限给别的用户。

D,也可以回收权限。

[email protected]> revoke MGR_ROLE from user1;


Revoke succeeded.




           

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow

相关文章:

  • 2021-07-03
  • 2021-09-25
  • 2021-04-01
  • 2021-08-14
  • 2021-12-08
  • 2021-04-17
  • 2021-08-14
  • 2021-04-22
猜你喜欢
  • 2021-08-10
  • 2021-10-27
  • 2021-11-02
  • 2021-08-30
  • 2021-04-13
  • 2021-04-27
  • 2021-10-21
相关资源
相似解决方案