PL/SQL connection query data error when dynamic performance Tables not accessible

Source: Internet
Author: User

First, the cause of the prompt
Plsql Dev collects user statistics while the user is running, but because the user you are currently logged on does not have access to the V$session,v$sesstat and V$statname view, the current user's statistics cannot be collected, and the Plsql The automatic statistics is configured in the Dev tool to conflict, so this hint appears and the test verifies that:

[[email protected] ~]$ sqlplus/  asSYSDBA SQL*Plus:release11.2.0.3.0Production onThu NovTen Geneva: to: $  .Copyright (c)1982, ., Oracle. Allrights reserved. Connected to: OracleDatabase11g Enterprise Edition Release11.2.0.3.0 -Production withThe partitioning, OLAP, Data Mining and RealApplication Testing Options SYS@XFF>Create UserCHF identified byXifenfei;Usercreated. SYS@XFF>Grant CreateSession,resource toCHF;Grantsucceeded. SYS@XFF>CONN CHF/XIFENFEICONNECTED.CHF@XFF>Select *  fromSession_privs; PRIVILEGE----------------------------------------CREATEsessionunlimited tablespaceCREATE TABLECREATECLUSTERCREATESEQUENCECREATE PROCEDURECREATE TRIGGERCREATETYPECREATEOPERATORCREATEIndextypeTenrows selected. CHF@XFF>SELECTtable_name fromuser_tab_privs; no rows selected

Create a CHF user, authorize Create Session,resource, no V$session,v$sesstat and v$statname view access, log in with Plsql Dev and query the User_tables table (no prompt at logon , only the user will be prompted when the query is executed or the related class is performed)

Second, solve the problem
Depending on the warning, there are two ways to resolve this warning
1. Turn off Plsql dev stats function
Remove the hook from the automatic statistics before the tools->preferences->options, save
2, authorized access to access the relevant views of the user
Authorized access to V_$session,v_$sesstat,v_$statname, note that the v$ view cannot be authorized directly

Chf@XFF>Conn/  asSysdbaconnected.sys@XFF>Grant Select  onV_$session toCHF;Grantsucceeded. SYS@XFF>Grant Select  onV_$sesstat toCHF;Grantsucceeded. SYS@XFF>Grant Select  onV_$statname toCHF;Grantsucceeded. SYS@XFF>CONN CHF/xifenfeiconnected. CHF@XFF>SELECTtable_name fromUser_tab_privs; TABLE_NAME------------------------------V_$sessionv_$sesstatv_$statname

Reprint Address: http://www.xifenfei.com/1822.html

PL/SQL connection query data error when dynamic performance Tables not accessible

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.