当前位置:网站首页>ORA-02030: can only select from fixed tables/views
ORA-02030: can only select from fixed tables/views
2022-07-06 12:17:00 【wx5caecf2ed0645】
Sometimes some ordinary users are granted query system objects ( for example dynamic performance views) You will encounter “ORA-02030: can only select from fixed tables/views”, As shown below :
SQL> grant select on v$session to test;
- 1.
grant select on v$session to test
- 1.
*
- 1.
ERROR at line 1:
- 1.
ORA-02030: can only select from fixed tables/views
- 1.
About ORA-02030 Errors are described below , That is, for fixed tables or fixed views It can only be carried out SELECT Inquire about , Can't do SELECT Any operation other than
[[email protected] ~]$ oerr ora 2030
02030, 00000, "can only select from fixed tables/views"
// *Cause: An attempt is being made to perform an operation other than
// a retrieval from a fixed table/view.
// *Action: You may only select rows from fixed tables/views.
About V$ Views The introduction is as follows :
V$ Views
The actual dynamic performance views are identified by the prefix V_$. Public synonyms for these views have the prefix V$. Database administrators and other users should access only the V$ objects, not the V_$ objects.
The dynamic performance views are used by Oracle Enterprise Manager, which is the primary interface for accessing information about system performance. After an instance is started, the V$ views that read from memory are accessible. Views that read data from disk require that the database be mounted, and some require that the database be open.
We found that V$SESSION,V$DBLINK All are fixed views, and v$ The views we often check are v_$ Synonyms for the beginning view .
SQL> SELECT * FROM V$FIXED_TABLE WHERE NAME IN( 'V$SESSION','V$DBLINK');
- 1.
- 1.
NAME OBJECT_ID TYPE TABLE_NUM
- 1.
------------------------------ ---------- ----- ----------
- 1.
V$SESSION 4294950919 VIEW 65537
- 1.
V$DBLINK 4294951157 VIEW 65537
- 1.
- 1.
SQL>
- 1.
SQL> COL OWNER FOR A12;
- 1.
SQL> COL OBJECT_NAME FOR A32;
- 1.
SQL> COL OBJECT_TYPE FOR A32;
- 1.
SQL> SELECT OWNER, OBJECT_NAME ,OBJECT_TYPE
- 1.
2 FROM DBA_OBJECTS
- 1.
3 WHERE OBJECT_NAME='V$SESSION';
- 1.
- 1.
OWNER OBJECT_NAME OBJECT_TYPE
- 1.
------------ -------------------------------- --------------------------------
- 1.
PUBLIC V$SESSION SYNONYM
- 1.
- 1.
SQL>
- 1.
SQL> COL TABLE_OWNER FOR A12;
- 1.
SQL> COL SYNONYM_NAME FOR A20;
- 1.
SQL> COL TABLE_NAME FOR A16;
- 1.
SQL> COL DB_LINK FOR A8;
- 1.
SQL> SELECT * FROM DBA_SYNONYMS WHERE SYNONYM_NAME='V$SESSION';
- 1.
- 1.
OWNER SYNONYM_NAME TABLE_OWNER TABLE_NAME DB_LINK
- 1.
------------ -------------------- ------------ ---------------- --------
- 1.
PUBLIC V$SESSION SYS V_$SESSION
- 1.
So to authorize, you should execute the following SQL sentence
SQL>
- 1.
SQL> GRANT SELECT ON V_$SESSION TO TEST;
- 1.
- 1.
Grant succeeded.
- 1.
If you encounter such an error , Directly find the view or base table corresponding to the corresponding synonym , And then authorize , As shown below :
SQL> show user;
- 1.
USER is "SYS"
- 1.
SQL> grant select on v$dblink to test;
- 1.
grant select on v$dblink to test
- 1.
*
- 1.
ERROR at line 1:
- 1.
ORA-02030: can only select from fixed tables/views
- 1.
- 1.
- 1.
SQL> COL OWNER FOR A12;
- 1.
SQL> COL OBJECT_NAME FOR A32;
- 1.
SQL> COL OBJECT_TYPE FOR A32;
- 1.
SQL> SELECT OWNER, OBJECT_NAME ,OBJECT_TYPE
- 1.
2 FROM DBA_OBJECTS
- 1.
3 WHERE OBJECT_NAME=UPPER('v$dblink');
- 1.
- 1.
OWNER OBJECT_NAME OBJECT_TYPE
- 1.
------------ -------------------------------- --------------------------------
- 1.
PUBLIC V$DBLINK SYNONYM
- 1.
- 1.
SQL> COL TABLE_OWNER FOR A12;
- 1.
SQL> COL SYNONYM_NAME FOR A20;
- 1.
SQL> COL TABLE_NAME FOR A16;
- 1.
SQL> COL DB_LINK FOR A8;
- 1.
SQL> SELECT * FROM DBA_SYNONYMS WHERE SYNONYM_NAME='V$DBLINK';
- 1.
- 1.
OWNER SYNONYM_NAME TABLE_OWNER TABLE_NAME DB_LINK
- 1.
------------ -------------------- ------------ ---------------- --------
- 1.
PUBLIC V$DBLINK SYS V_$DBLINK
- 1.
- 1.
SQL> grant select on v_$dblink to test;
- 1.
- 1.
Grant succeeded.
- 1.
- 1.
SQL>
- 1.
边栏推荐
- 关键字 inline (内联函数)用法解析【C语言】
- js题目:输入数组,最大的与第一个元素交换,最小的与最后一个元素交换,输出数组。
- 【ESP32学习-2】esp32地址映射
- Esp8266 connects to onenet cloud platform (mqtt) through Arduino IDE
- Pytorch: tensor operation (I) contiguous
- Gallery's image browsing and component learning
- Basic operations of databases and tables ----- creating data tables
- There are three iPhone se 2022 models in the Eurasian Economic Commission database
- Kaggle competition two Sigma connect: rental listing inquiries
- Embedded startup process
猜你喜欢

Time slice polling scheduling of RT thread threads

Arduino JSON data information parsing

js题目:输入数组,最大的与第一个元素交换,最小的与最后一个元素交换,输出数组。

MP3mini播放模块arduino<DFRobotDFPlayerMini.h>函数详解

Detailed explanation of 5g working principle (explanation & illustration)

Unit test - unittest framework

Redis 缓存更新策略,缓存穿透、雪崩、击穿问题

Fashion-Gen: The Generative Fashion Dataset and Challenge 论文解读&数据集介绍

Custom view puzzle getcolor r.color The color obtained by colorprimary is incorrect

arduino UNO R3的寄存器写法(1)-----引脚电平状态变化
随机推荐
Working principle of genius telephone watch Z3
[golang] leetcode intermediate - fill in the next right node pointer of each node & the k-smallest element in the binary search tree
荣耀Magic 3Pro 充电架构分析
Page performance optimization of video scene
Navigator object (determine browser type)
Symbolic representation of functions in deep learning papers
Pytoch temperature prediction
JS object and event learning notes
MySQL time, time zone, auto fill 0
Bubble sort [C language]
C语言函数之可变参数原理:va_start、va_arg及va_end
ES6语法总结--下篇(进阶篇 ES6~ES11)
ES6语法总结--上篇(基础篇)
Basic operations of databases and tables ----- classification of data
Important methods of array and string
Cannot change version of project facet Dynamic Web Module to 2.3.
Custom view puzzle getcolor r.color The color obtained by colorprimary is incorrect
Inline detailed explanation [C language]
嵌入式启动流程
记一次云服务器被密码爆破的经历——关小黑屋、改密码、改端口