角色权限和对象权限互不影响

以前对角色权限和对象权限有一点概念,但对互相的权限是否影响并不十分清楚,通过这个实验,可以明白两者关系。

SQL> create user oe identified by oe;
SQL> grant connect,resource to oe;
SQL> conn oe/oe@xgc
SQL> create table orders(id number);
SQL> insert into orders values(1);
SQL> insert into orders values(2);
SQL> commit;

SQL> conn scott/tiger@xgc
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 
Connected as scott
SQL> select * from oe.orders;

select * from oe.orders
ORA-00942: 表或视图不存在


create role r1;
grant select, insert on oe.orders to r1;
grant r1 to scott;
grant select on oe.orders to scott;
revoke select on oe.orders from scott;

SQL> insert into oe.orders values(3);
SQL> insert into oe.orders values(4);
SQL> commit;
SQL> commit;

SQL> select * from oe.orders;


        ID
----------
         1
         2
         3
         4


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30146442/viewspace-2125183/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/30146442/viewspace-2125183/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值