Plsql developer "Dynamic execution table is inaccessible, automatic statistics of this session is forbidden" solution

Source: Internet
Author: User

Using Plsql, the first time you perform a select operation on a table, you are prompted to "dynamic execution table is inaccessible, automatic statistics for this session are forbidden", such as:


The problem is that the current connection user does not have SELECT permission for the table v$session,v$sesstat,v$statname under the SYS user because the dynamic performance table-related permissions are not authorized to the current user.

Processing method:

  1. First processing method (not recommended)

This is the error in the error dialog box "Don t show this message again" option is selected, the next time will not be prompted this mistake. This method should be called the "ostrich Way" processing method. There is no fundamental solution to this problem.

  2. Second method of treatment (can be adopted)

The error message is described in very detailed, because the dynamic performance table is not caused by access to the problem, so we have to sysdba as a login to give the required access to specific users of the method to solve the problem.

  1) if only a specific user has permission to query these three dynamic performance views, you can do the following
Note here: The view that we authorize is v_$session not v$session, because v$session is not a specific view with the same name. Otherwise you will receive the following error.
[Email protected]> 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
The correct authorization method is as follows:
Grant SELECT on V_$session to User_sec;
Grant SELECT on V_$sesstat to User_sec;
Grant SELECT on V_$statname to User_sec;
Description: User_sec is a specific user name that is authorized.

  2) You can use the "simple Brute" method below to deal with it.

Grant SELECT any DICTIONARY to user_sec;

  3) The above two methods are specific to the user's processing method, if you want all users (not limited to the above USER_SEC users) can query these three dynamic performance views, can be implemented by authorizing the query permissions to the public method, the operation is as follows.

This will ensure that all developers will not have the above error message.
Grant SELECT on V_$session to public;
Grant SELECT on V_$sesstat to public;
Grant SELECT on V_$statname to public;

  3. Third method (recommended)

Completely disable the function of PL/SQL developer.
Here's how: navigate to Tools-Preferences (preferences)-options
Find the "Automatic Statistics (auto stats)" option, remove the small checkmark in front of it, then click "Apply" and "OK" to save the exit.

Plsql developer "Dynamic execution table is inaccessible, automatic statistics of this session is forbidden" solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.