Oracle中对象权限与系统权限revoke

实验:

1、以sys登陆,创建用户test1, test2;

2、授予test1系统权限(带admin option)-connect,授予test1对象权限(带grant option)-select;

3、以test1登陆,分别把connect, select授予test2;

4、以sys登陆,从test1中revoke之前所授予的connect, select权限;

5、以test2登陆,发现connect可以,select不行。

结论:系统权限不能级联收回,对象权限可以

SQL> create user test1 identified by test1;

用户已创建。

SQL> create user test2 identified by test2;

用户已创建。

SQL> grant connect to test1 with admin option;

授权成功。

SQL> grant select on scott.emp to test1 with grant option;

授权成功。


SQL> conn test1/test1;
已连接。
SQL>
SQL> grant select on scott.emp to test2;


SQL> conn test1/test1
已连接。
SQL> grant connect to test2;

授权成功。


SQL> conn / as sysdba;
已连接。
SQL> revoke connect from test1;

撤销成功。

SQL> revoke select on scott.emp from test1;

撤销成功。

SQL> conn test2/test2;
已连接。


SQL> select count(*) from scott.emp;
select count(*) from scott.emp
                           *

第 1 行出现错误:
ORA-00942: 表或视图不存在

 


 

 

原文地址:https://www.cnblogs.com/toughhou/p/3778820.html