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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值