PL SQL 查询时 dynamic performance tables not accessible 错误
今天在使用PL/SQL Developer工具登陆一个新创建的用户进行查询时,报出以下错误(PL/SQL Developer版本:7.1.5 1403): Dynamic Performance Tables not accessible, Automatic Statistics disabled for this session You can disable statistics in the pr
今天在使用PL/SQL Developer工具登陆一个新创建的用户进行查询时,报出以下错误(PL/SQL Developer版本:7.1.5 1403):
Dynamic Performance Tables not accessible,
Automatic Statistics disabled for this session
You can disable statistics in the preference menu, or obtain select
priviliges on the V$session,V$sesstat and V$statname tables
这个报错信息在不同的PL/SQL Developer版本都会出现,从上面详细的报错提示信息中我们可以判断得到,报错原因不在工具本身。
在此,详细记录一下这个小问题的三种处理方法。
1.第一种处理方法(不推荐)
就是在报错的Error对话框中将“Don't show this message again”选项选中,下次就不在提示这个错误了。
这种方法应该可以叫做“鸵鸟方式”的处理方法。没有从根本上解决这个问题。
2.第二种处理方法(可以采纳)
报错信息中描述的非常详细,原因是动态性能表没有权利被访问导致的问题,因此,我们通过把所需访问权限赋予给具体用户的方法来解决这个问题。
这里给出我能想到的三种具体处理方法。大家可以继续补充。
1)如果只是某一具体用户有权限查询这三个动态性能视图,可以如下进行操作
这里注意一下:我们授权的视图是V_$session不是V$session,因为V$session是同名不是具体的视图。否则您会收到下面这个错误。
sys@ora10g> grant select on V$session to user_sec;
grant select on V$session to user_sec
*
ERROR at line 1:
ORA-02030: can only select from fixed tables/views
正确的授权方法如下:
SQL> grant select on V_$session to user_sec;
SQL> grant select on V_$sesstat to user_sec;
SQL> grant select on V_$statname to user_sec;
2)可以使用下面这个“简单粗暴”的方法处理之。
SQL> grant SELECT ANY DICTIONARY to user_sec;
3)以上两种方法是针对特定用户的处理方法,如果想让所有用户(不局限在上面的user_sec用户)都能够查询这三个动态性能视图,可以通过将查询权限授权给public方法来实现,操作如下。这样就可以保证所有开发人员都不会再出现上述的报错信息了。
SQL> grant select on V_$session to public;
SQL> grant select on V_$sesstat to public;
SQL> grant select on V_$statname to public;
3.第三种方法(推荐)
彻底禁掉PL/SQL Developer的这个功能。
方法如下:
导航到Tools --> Preferences --> Options
找到“Automatic Statistics”选项,将其前面的小对勾去掉,然后点击“Apply”和“OK”保存退出。
4.小结
之所以书写这个文章,只是给出一个处理问题的一般方法,这就是:“充分挖掘具体报错信息,从各种表面现象入手,逐步深入,最终得到满意的处理结果。”
最后谈一下DBA与数据库管理开发工具(如PL/SQL Developer、Toad等等)的关系。
如果您是纯开发DBA,那么强烈建议您认真的研究这些优秀高级工具的每一个细节,因为这样可以大大的提高您的工作效率。
博文来源:http://space.itpub.net/519536/viewspace-614671

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

HQL and SQL are compared in the Hibernate framework: HQL (1. Object-oriented syntax, 2. Database-independent queries, 3. Type safety), while SQL directly operates the database (1. Database-independent standards, 2. Complex executable queries and data manipulation).

"Usage of Division Operation in OracleSQL" In OracleSQL, division operation is one of the common mathematical operations. During data query and processing, division operations can help us calculate the ratio between fields or derive the logical relationship between specific values. This article will introduce the usage of division operation in OracleSQL and provide specific code examples. 1. Two ways of division operations in OracleSQL In OracleSQL, division operations can be performed in two different ways.

Oracle and DB2 are two commonly used relational database management systems, each of which has its own unique SQL syntax and characteristics. This article will compare and differ between the SQL syntax of Oracle and DB2, and provide specific code examples. Database connection In Oracle, use the following statement to connect to the database: CONNECTusername/password@database. In DB2, the statement to connect to the database is as follows: CONNECTTOdataba

Download the latest version of 12306 ticket booking app. It is a travel ticket purchasing software that everyone is very satisfied with. It is very convenient to go wherever you want. There are many ticket sources provided in the software. You only need to pass real-name authentication to purchase tickets online. All users You can easily buy travel tickets and air tickets and enjoy different discounts. You can also start booking reservations in advance to grab tickets. You can book hotels or special car transfers. With it, you can go where you want to go and buy tickets with one click. Traveling is simpler and more convenient, making everyone's travel experience more comfortable. Now the editor details it online Provides 12306 users with a way to view historical ticket purchase records. 1. Open Railway 12306, click My in the lower right corner, and click My Order 2. Click Paid on the order page. 3. On the paid page

How to check my academic qualifications on Xuexin.com? You can check your academic qualifications on Xuexin.com, but many users don’t know how to check their academic qualifications on Xuexin.com. Next, the editor brings you a graphic tutorial on how to check your academic qualifications on Xuexin.com. Interested users come and take a look! Xuexin.com usage tutorial: How to check your academic qualifications on Xuexin.com 1. Xuexin.com entrance: https://www.chsi.com.cn/ 2. Website query: Step 1: Click on the Xuexin.com address above to enter the homepage Click [Education Query]; Step 2: On the latest webpage, click [Query] as shown by the arrow in the figure below; Step 3: Then click [Login Academic Credit File] on the new page; Step 4: On the login page Enter the information and click [Login];

Database technology competition: What are the differences between Oracle and SQL? In the database field, Oracle and SQL Server are two highly respected relational database management systems. Although they both belong to the category of relational databases, there are many differences between them. In this article, we will delve into the differences between Oracle and SQL Server, as well as their features and advantages in practical applications. First of all, there are differences in syntax between Oracle and SQL Server.

MySQL and PL/SQL are two different database management systems, representing the characteristics of relational databases and procedural languages respectively. This article will compare the similarities and differences between MySQL and PL/SQL, with specific code examples to illustrate. MySQL is a popular relational database management system that uses Structured Query Language (SQL) to manage and operate databases. PL/SQL is a procedural language unique to Oracle database and is used to write database objects such as stored procedures, triggers and functions. same

The difference between Oracle and SQL and analysis of application scenarios In the database field, Oracle and SQL are two frequently mentioned terms. Oracle is a relational database management system (RDBMS), and SQL (StructuredQueryLanguage) is a standardized language for managing relational databases. While they are somewhat related, there are also some significant differences. First of all, by definition, Oracle is a specific database management system, consisting of
