For v$ views you need to grant privilege to each v_$ directly
最近在看Thomas Kyte的<Expert Oracle.Database.Architecture.9i.and.10g>,在定製環境的時候,執行以下指令碼,出現問題: scott@SHENZHEN> grant select any table to scott;
scott@SHENZHEN> create or replace view stats
as select 'STAT...' || a.name name, b.value
from v$statname a, v$mystat b
where a.statistic# = b.statistic#
union all
select 'LATCH.' || name, gets
from v$latchlatch
union all
9 select 'STAT...Elapsed Time', hsecs from v$timer;
from v$statname a, v$mystat b
*
ERROR at line 3:
ORA-01031: insufficient privileges
[@more@]欲將這幾個動態效能檢視的select許可權單獨賦給Scott:
sys@SHENZHEN> grant select on v$mystat to scott;
grant select on v$mystat to scott
*
ERROR at line 1:
ORA-02030: can only select from fixed tables/views
查詢後發現,原來v$物件,並不是檢視,而是指向v_$檢視的同義詞,而檢視是基於真正的v$檢視建立的。
還有X$表,這一部分表是Oracle資料庫的執行基礎,在資料庫啟動時由Oracle應用程式動態建立。
這部分表對資料庫來說至關重要,所以Oracle不允許SYSDBA之外的使用者直接訪問,顯示授權不被允許。
將select許可權賦給4個v_$檢視
sys@SHENZHEN> grant select on v_$mystat to scott;
Grant succeeded.
sys@SHENZHEN> grant select on v_$statname to scott;
Grant succeeded.
sys@SHENZHEN> grant select on v_$latch to scott;
Grant succeeded.
sys@SHENZHEN> grant select on v_$timer to scott;
Grant succeeded.
scott@SHENZHEN> create or replace view stats
2 as select 'STAT...' || a.name name, b.value
3 from v$statname a, v$mystat b
4 where a.statistic# = b.statistic#
5 union all
6 select 'LATCH.' || name, gets
7 from v$latch
8 union all
9 select 'STAT...Elapsed Time', hsecs from v$timer;
View created.
問題解決!
Reference:
http://space.itpub.net/9252210/viewspace-591741
http://zhangsolomon.itpub.net/post/39913/488842
http://blog.csdn.net/yang073402/archive/2010/04/13/5482987.aspx
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12472709/viewspace-1035308/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Access denied; you need (at least one of) the PROCESS privilege(s)AST
- 小程式 · <input>報錯:<input v-model="item">: You are binding v-model directly...
- 系統許可權 GRANT ANY OBJECT PRIVILEGE的作用!Object
- [譯] You Might Not Need ES6
- 理解BERT Transformer:Attention is not all you need!ORM
- 目標檢測:Segmentation is All You Need ?Segmentation
- 8.1.1 V$ ViewsView
- You need tcl 8.5 or newer in order to run the Redis testRedis
- [翻譯]What You Need to Begin iOS ProgrammingiOS
- 經典譯文:Transformer--Attention Is All You NeedORM
- 擁有GRANT ANY OBJECT PRIVILEGE許可權時的許可權回收Object
- Oracle's V$ Views(轉)OracleView
- Everything you need to know about mobile app architectureAPP
- 【Oracle】v$表和v_$同義詞的訪問許可權Oracle訪問許可權
- Whats the difference between the v$sql* viewsSQLView
- Oracle 10G V$ViewsOracle 10gView
- ERROR 1410 (42000): You are not allowed to create a user with GRANTError
- 一文讀懂「Attention is All You Need」| 附程式碼實現
- You need to use a Theme.AppCompat theme (or descendant) with this activity.APP
- oracle動態檢視v$,v_$,gv$,gv_$與x$之間的關係Oracle
- 黑猴子的家:Redis 之 You need tcl 8.5 or newer in order to run the Redis testRedis
- [Paper Reading] KOSMOS: Language Is Not All You Need: Aligning Perception with Language Models
- grant with admin/grant option
- Mac 下的MySQL ERROR 1227(42000): Access denied; you need (at least one of)MacMySqlErrorAST
- 馬斯克開源的 grok-1 底層 Transformer 模型論文 《Attention is All You Need》馬斯克ORM模型
- 安裝rlwrap-0.37.tar.gz報錯You need the GNU readline library to buildUI
- Attention isn’t all you need!Mamba混合大模型開源:三倍Transformer吞吐量大模型ORM
- SCSS @eachCSS
- jQuery each()jQuery
- 更新jenkins外掛,報錯 Perhaps you need to run your container with "-Djava.awt.headless=true"?JenkinsAIJava
- sqlplus login -- SP2-0750: You may need to set ORACLE_HOME to your Oracle software directorySQLOracle
- $(selector).each()與$.each()方法的區別
- Server-side activities have been updated. You need to restart SharePoint Designer to use the updated version of activities.ServerIDEREST
- Unknown host ‘XXXX: nodename nor servname provided, or not known‘. You may need to adjust the proxyIDE
- DML ViewsView
- SQL__GRANTSQL
- mysql grant 命令MySql
- MySQL Grant命令MySql