[每日一题] OCP1z0-047 :2013-07-25 权限――角色与对象权限.............................................14
来源:互联网 发布:mysql decode 函数 编辑:程序博客网 时间:2024/05/17 01:42
有疑问可以去itpub讨论:http://www.itpub.net/thread-1804842-1-1.html
按题意,操作如下:
1、创建一个角色r1
sys@OCM> create role r1;
Role created.
2、角色r1可以查询和插入oe用户下的orders表
sys@OCM> grant select,insert on oe.orders to r1;
Grant succeeded.
3、把r1拥有的所有全权授权给scott用户
sys@OCM> grant r1 to scott;
Grant succeeded.
4、授予scott用户可以查oe用户下的orders表的权限
sys@OCM> grant select on oe.orders to scott;
Grant succeeded.
5、回收查oe用户下的orders表的权限
sys@OCM> revoke select on oe.orders from scott;
Revoke succeeded.
6、scott用户登录询查oe用户下的orders表
sys@OCM> conn scott/scott
Connected.scott@OCM> select * from oe.orders;
ORDER_IDORDER_DATE ORDER_MO CUSTOMER_ID ORDER_STATUS ORDER_TOTAL SALES_REP_ID PROMOTION_ID
--------------------------------------------------------------------------------------------- ----------- ------------ ----------- ------------ ------------
245817-AUG-07 05.34.12.234359 AM direct 101 0 78279.6 153
239720-NOV-07 06.41.54.696211 AM direct 102 1 42283.2 154
direct 105 2 7826 155
。。。。。。。。。。。省略。。。。。。。。。。。。。。。。。。。
245118-DEC-07 09.03.52.562632 AM direct 148 7 10474.6 154
direct 117 0 3878.4 163
245701-NOV-07 01.22.16.162632 PM direct 118 5 21586.2 159
105 rows selected.
用revoke命令回收了scott用户查oe用户下的orders表,但
Scott用户还是可以查出oe用户中的orders表记录。这是什么回事呢?
我们先来看角色r1的对象权限:
sys@OCM> select * from dba_tab_privs where grantee='R1';
GRANTEE OWNER TABLE_NAME GRANTOR PRIVILEGE GRA HIE
------------------------------------------------------------ ------------------------------------------------------------ ---------------------------------------- --- ---
R1 OE ORDERS OE SELECT NO NO
R1 OE ORDERS OE INSERT NO NO
说明R1角色拥用对oe用户下对orders表的查询和插入操作的权限。。。
查SCOTT用户所拥用的角色:
sys@OCM> select * from DBA_ROLE_PRIVS whereGRANTEE='SCOTT';
GRANTEE GRANTED_ROLE ADM DEF
------------------------------------------------------------ --- ---
SCOTT RESOURCE NO YES
SCOTT R1 NO YES
SCOTT CONNECT NO YES
可以看出SCOTT拥有R1角色,所以有查oe用户下orders表的权限。
如果回收scott用户下的R1角色,应该就能查oe用户下orders表的权限。
sys@OCM> revoke r1 from scott;
Revoke succeeded.
sys@OCM> conn scott/scott
Connected.
scott@OCM> select * from oe.orders;
select * from oe.orders
*
ERROR at line 1:
ORA-00942: table or view does not exist
这道题目是考用户的权限,角色和对象权限的分配及回收知识点。
参考:http://blog.csdn.net/guoyjoe/article/details/863593
希望大家一起补充知识点,找出每道题目的知识点,一起挖掘,分析,吃透。。。
正确答案是:A
QQ:252803295
学习交流QQ群:
DSI&Core Search Ⅰ 群:127149411(技术:已满)
DSI&Core Search Ⅱ 群:177089463(技术:未满)
DSI&Core Search Ⅲ 群:284596437(技术:未满)
DSI&Core Search Ⅳ 群:192136702(技术:未满)
DSI&Core Search Ⅴ 群:285030382(闲聊:未满)
MAIL:oracledba_cn@hotmail.com
BLOG: http://blog.csdn.net/guoyjoe
WEIBO:http://weibo.com/guoyJoe0218
ITPUB: http://www.itpub.net/space-uid-28460966.html
OCM: http://education.oracle.com/education/otn/YGuo.HTM
- [每日一题] OCP1z0-047 :2013-07-25 权限――角色与对象权限.............................................14
- [每日一题] OCP1z0-047 :2013-08-02 权限―――分配系统权限............................................22
- [每日一题] OCP1z0-047 :2013-08-23 SYNONYM(公有和私有同义词)――权限问题...................93
- [每日一题] OCP1z0-047 :2013-07-29 视图――别名..........................................................18
- [每日一题] OCP1z0-047 :2013-07-31 扩展GROUP BY分组――ROLLUP..............................20
- [每日一题] OCP1z0-047 :2013-08-05 SELECT语句――列的表达式.....................................25
- [每日一题] OCP1z0-047 :2013-07-16 主键与唯一索引.............................................................5
- [每日一题] OCP1z0-047 :2013-08-18 禁用启用约束――主键与外键 ..................................61
- [每日一题] OCP1z0-047 :2013-08-03 约束―――延迟约束....................................................23
- [每日一题] OCP1z0-047 :2013-08-06 外表部――相关描述......................................................26
- [每日一题] OCP1z0-047 :2013-08-17 EXTERNAL TABLE――加载数据 ............................56
- [每日一题] OCP1z0-047 :2013-08-20 GROUP BY扩展――GROUPING、ROLLUP.....................88
- [每日一题] OCP1z0-047 :2013-07-14 正则表达式...............................................................3
- [每日一题] OCP1z0-047 :2013-07-19 Rules of Precedence――括号的使用.................8
- [每日一题] OCP1z0-047 :2013-07-21 子查询――多字段的顺序..............................................10
- [每日一题] OCP1z0-047 :2013-07-27 外部表――不能被DML和建索引...................................16
- [每日一题] OCP1z0-047 :2013-07-28 多表插入――pivoting insert(旋转插入)....................17
- [每日一题] OCP1z0-047 :2013-07-30 表连接――内联视图当作表使用....................................19
- myeclipse激活码
- Joomla使用的一些基本的Php函数
- Mysql常用命令
- JS - RegExp 正则笔记
- asp.net 集成QQ2.0 登陆代码示例
- [每日一题] OCP1z0-047 :2013-07-25 权限――角色与对象权限.............................................14
- Objective-C内存管理原则
- Reflection反射
- arm+linux 裸机环境搭建之初试minicom+dnw烧写uboot
- 百度网站评测中心上线 提供评测及网站优化方案
- 4619——Warm up 2
- 初级程序员是需要导师的
- Codeforces Round #192 (Div. 2)
- 删除android模拟器中的程序