PLSQL Developer问题——Dynamic performance Table not accessible

用PLSQL Developer,刚进入时,选择一个表,----->edit  data有个提示: Dynamic  performance  Table  not  accessible  Automatic  Statistics  disbled  this  seesion   you  can  Statistics in  the  preference  menu  ,obtain  select   priviliges  on  the  V$session , $sessstat  and  v$statname  table   我的用户是 resource角色, 为什么有这样提示,要如何改??

 

   这是PL/SQL DEVELOPER在执行SQL时会进行本SESSION统计信息收集的问题,根本原因是该用户对字典表没有权限,可以按上述改变PL/SQL设置,或者使用简单的授权语句:grant SELECT ANY DICTIONARY to username 当然还有你还有其他两种选择:

          1.让PL/SQL 不收集统计信息:在tools->preferences->Options中取消Automatic  Statistics  选项

          2.增加当前登录用户的权限开通PL/SQL 收集统计信息:

            开通权限的方法可以为

            grant select on V_$SESSION to DX;

            grant select on V_$SESSTAT to DX;

            grant select on V_$STATNAME to DX;

            也可以直接给DBA的权限给这个用户

            grant dba to DLYX;

           个人建议,如果是开发测试数据库,可以给用户加权限,开通收集统计信息。这样对于优化SQL性能比较方便,仅供参考。

=====================================================================            

      今天在使用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,那么强烈建议您认真的研究这些优秀高级工具的每一个细节,因为这样可以大大的提高您的工作效率。

 

 

附:有关动态性能表的说明

【1】Dynamic Performance Tables:用于记录当前数据库活动信息,反映数据库操作的实时状况(Dynamic Performance Tables 存放变化较频繁的信息,而DD则存放相对比较稳定的信息)。

【2】Dynamic Performance Tables是一组的虚拟表,它把内存中的信息控制文件(Control file)的信息以表的形式展示出来,内存是主要的信息来源。

【3】绝大多数的用户是不能访问动态性能表的,只用拥有DBA才能查询这些视图,比如:SYS账号。DBA可以对动态性能表进行查询,授予select权限,以及创建views(视图),但DBA也无法直接更改或删除views(所以这些views也称为fixed views),因为这些views不是真正的表,它们是由内存和控制文件的数据临时组成的,所以不能删/改,并且当数据库关闭时,Dynamic Performance Tables也不复存在。

【4】Dynamic Performance Tables基本上均以V$开头,具体有哪些Dynamic Performance Tables可以查询V$FIXED_TABLE。

【5】Dynamic Performance Tables可使我们了解如下信息:

    • 该对象是否处于联机状态并可用?
    • 该对象是否已打开?
    • 目前持有哪些锁?
    • 该会话是否处于活动状态?

Dynamic Performance Tables not accessible,Automatic Statistics disabled for this session 阅读详情

相关推荐

PL SQL 查询时 dynamic performance tables not accessible 错误

<br /><br />今天在使用PL/SQL Developer工具登陆一个新创建的用户进行查询时,报出以下错误(PL/SQL Developer版本:7.1.5 1403):<br />Dynamic Performance Tables not accessible,<br />Automatic Statistics disabled for this session<br /><br /><br />You can disable statistics in the preference menu

旺仔专栏 4358

Dynamic Performance Tables not accessible

相信很多使用plsql dev的朋友多遇到过类此如下面的提示: Dynamic Performance Tables not accessible, Automatic Statistics Disabled for this session   You can disable statistics in the pr

自强不息;厚德载物 1066

问题处理】PL/SQL Developer报错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 sessionYou can disable statistics in the preference menu, or obtain selectprivili

681

Dynamic Performance Tables not accessible问题解决

DynamicPerformanceTablesnotaccessible, Automatic Statistics Disabled for this session You can disable statistics in the preference menu,or obtanin select priviliges on the v$session,v$sesstat a...

chang_yushun的博客 5424

PL/SQL Developer报错Dynamic Performance Tables not accessible

转载地址:http://space.itpub.net/519536/viewspace-614671 今天,开发团队里的几位同事向我反映,在使用PL/SQL Developer工具登陆一个新创建的用户进行查询时,报出以下错误(PL/SQL Developer版本:7.1.5 1403): Dynamic Performance Tables not accessible, Automa

空灵的专栏 567

登录pl/sql报错Dynamic Performance Tables not accessible...的解决方法和原因

报错截图: 一种解决方案: utomatic statistics 含义:   When you execute a statement in a SQL Window or in a Test Window, PL/SQL Developer will automatically generate a statistic report of

mady0505的专栏 1051

dynamic performance tables not accessible

Dynamic Performance Tables not accessible, Automatic Statistics Disabled for this session You can disable statistics in the preference menu,or obtanin select priviliges on the v$session,v$sesstat...

Yang_Ever的专栏 147

Dynamic Performance Tables not accessible, Automatic Statistics Disabled for this session【ZZ】

原文:http://hi.baidu.com/wowodo/blog/item/b7f12834674bab3e5ab5f5d5.html Dynamic Performance Tables not accessible, Automatic Statistics Disabled for this session You can disable statistics in the prefe...

weixin_30471065的博客 79

Dynamic Performance Tables not accessible.......

Dynamic   Performance   Tables   not   accessible,     Automatic   Statistics   Disabled   for   this   session         You   can   disable   statistics   in   the   preference   menu,or   obtanin   s...

若水汪洋的java学习博客 124

Dynamic Performance Tables not accessible 问题

摘自:http://hi.baidu.com/wowodo/blog/item/b7f12834674bab3e5ab5f5d5.html   Dynamic Performance Tables not accessible, Automatic Statistics Disabled for this session You can disable statistics in the pref...

helloaq 346
上一篇: Oracle角色、权限、用户相关知识
下一篇: 查看oracle用户权限
firendsunbird
博客等级 码龄15年 8粉丝 101原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值