如何让普通用户可以对DBA_SOURCE视图进行闪回查询?
赋权:GRANT SELECT , FLASHBACK ON DBA_SOURCE TO LHR10;
或:GRANT DBA,SELECT_CATALOG_ROLE TO LHR10;
LHR@orclasm > DROP USER LHR10;
CREATE USER LHR10 IDENTIFIED BY LHR;
GRANT RESOURCE TO LHR10;
User dropped.
LHR@orclasm >
User created.
LHR@orclasm >
Grant succeeded.
LHR@orclasm > LHR@orclasm > LHR@orclasm > LHR@orclasm >
LHR@orclasm >
LHR@orclasm >
LHR@orclasm > CONN LHR10/LHR;
ERROR:
ORA-01045: user LHR10 lacks CREATE SESSION privilege; logon denied
Warning: You are no longer connected to ORACLE.
@ > CONN / AS SYSDBA
Connected.
SYS@orclasm > GRANT CONNECT,RESOURCE TO LHR10;
Grant succeeded.
SYS@orclasm > conn lhr10/LHR
Connected.
LHR10@orclasm >
LHR10@orclasm > select * from dba_source as of timestamp sysdate -1/24 where rownum<=1;
select * from dba_source as of timestamp sysdate -1/24 where rownum<=1
*
ERROR at line 1:
ORA-00942: table or view does not exist
LHR10@orclasm > GRANT SELECT ON DBA_SOURCE TO LHR10;
GRANT SELECT ON DBA_SOURCE TO LHR10
*
ERROR at line 1:
ORA-00942: table or view does not exist
LHR10@orclasm > CONN / AS SYSDBA
Connected.
SYS@orclasm > GRANT SELECT ON DBA_SOURCE TO LHR10;
Grant succeeded.
SYS@orclasm > conn lhr10/LHR
Connected.
LHR10@orclasm > select * from dba_source as of timestamp sysdate -1/24 where rownum<=1;
select * from dba_source as of timestamp sysdate -1/24 where rownum<=1
*
ERROR at line 1:
ORA-01031: insufficient privileges
LHR10@orclasm > CONN / AS SYSDBA
Connected.
SYS@orclasm > GRANT FLASHBACK ON DBA_SOURCE TO LHR10;
Grant succeeded.
SYS@orclasm > conn lhr10/LHR
Connected.
LHR10@orclasm > select * from dba_source as of timestamp sysdate -1/24 where rownum<=1;
OWNER NAME TYPE
------------------------------ ------------------------------ ------------
LINE
----------
TEXT
--------------------------------------------------------------------------------
SYS AGGXMLIMP TYPE
1
type AggXMLImp
LHR10@orclasm > CONN / AS SYSDBA
Connected.
SYS@orclasm > REVOKE FLASHBACK ON DBA_SOURCE FROM LHR10;
Revoke succeeded.
SYS@orclasm > conn lhr10/LHR
Connected.
LHR10@orclasm >
LHR10@orclasm > select * from dba_source as of timestamp sysdate -1/24 where rownum<=1;
select * from dba_source as of timestamp sysdate -1/24 where rownum<=1
*
ERROR at line 1:
ORA-01031: insufficient privileges
LHR10@orclasm > CONN / AS SYSDBA
Connected.
SYS@orclasm >
SYS@orclasm > GRANT SELECT_CATALOG_ROLE TO LHR10;
Grant succeeded.
SYS@orclasm > conn lhr10/LHR
Connected.
LHR10@orclasm > select * from dba_source as of timestamp sysdate -1/24 where rownum<=1;
select * from dba_source as of timestamp sysdate -1/24 where rownum<=1
*
ERROR at line 1:
ORA-01031: insufficient privileges
LHR10@orclasm > CONN / as sysdba
Connected.
SYS@orclasm > grant dba to lhr10;
Grant succeeded.
SYS@orclasm > conn lhr10/LHR
Connected.
LHR10@orclasm > select * from dba_source as of timestamp sysdate -1/24 where rownum<=1;
OWNER NAME TYPE
------------------------------ ------------------------------ ------------
LINE
----------
TEXT
--------------------------------------------------------------------------------
SYS AGGXMLIMP TYPE
1
type AggXMLImp
About Me
.............................................................................................................................................● 本文作者:小麦苗,部分内容整理自网络,若有侵权请联系小麦苗删除
● 本文在itpub(http://blog.itpub.net/26736162/abstract/1/)、博客园(http://www.cnblogs.com/lhrbest)和个人微信公众号(xiaomaimiaolhr)上有同步更新
● 本文itpub地址:http://blog.itpub.net/26736162/abstract/1/
● 本文博客园地址:http://www.cnblogs.com/lhrbest
● 本文pdf版、个人简介及小麦苗云盘地址:http://blog.itpub.net/26736162/viewspace-1624453/
● 数据库笔试面试题库及解答:http://blog.itpub.net/26736162/viewspace-2134706/
● DBA宝典今日头条号地址:http://www.toutiao.com/c/user/6401772890/#mid=1564638659405826
.............................................................................................................................................
● QQ群号:230161599(满)、618766405
● 微信群:可加我微信,我拉大家进群,非诚勿扰
● 联系我请加QQ好友(646634621),注明添加缘由
● 于 2017-09-01 09:00 ~ 2017-09-30 22:00 在魔都完成
● 文章内容来源于小麦苗的学习笔记,部分整理自网络,若有侵权或不当之处还请谅解
● 版权所有,欢迎分享本文,转载请保留出处
.............................................................................................................................................
● 小麦苗的微店:https://weidian.com/s/793741433?wfr=c&ifr=shopdetail
● 小麦苗出版的数据库类丛书:http://blog.itpub.net/26736162/viewspace-2142121/
.............................................................................................................................................
使用微信客户端扫描下面的二维码来关注小麦苗的微信公众号(xiaomaimiaolhr)及QQ群(DBA宝典),学习最实用的数据库技术。
小麦苗的微信公众号 小麦苗的DBA宝典QQ群1 小麦苗的DBA宝典QQ群2 小麦苗的微店
.............................................................................................................................................