免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2755 | 回复: 8
打印 上一主题 下一主题

查询提示错误,却又出结果 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-07-30 09:17 |只看该作者 |倒序浏览
用scott用户在pl/sql dev下 连接oracle 10g,点击写个任意的sql语句f8后给出下面的提示“
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
”但是结果却可以出来,这个3个标(视图)在那个用户下,该怎么授权可以解决这个问题

   英语要学好啊

[ 本帖最后由 chi7na 于 2008-7-30 17:00 编辑 ]

招聘 : Linux运维
论坛徽章:
0
2 [报告]
发表于 2008-07-30 09:51 |只看该作者
Dynamic Performance Tables not accessible,
Automatic Statistics disabled for this session

提示很明显啊

论坛徽章:
0
3 [报告]
发表于 2008-07-30 10:11 |只看该作者
grant select on v$session to 你的用户名;
grant select on v$sesstat to 你的用户名;
grant select on v$statname to 你的用户名;

论坛徽章:
0
4 [报告]
发表于 2008-07-31 10:21 |只看该作者
按照3楼的说法,提示找不到 v$session, v$sesstat and v$statname 这3张表,我用的是sys as dba

[ 本帖最后由 chi7na 于 2008-7-31 16:28 编辑 ]

论坛徽章:
0
5 [报告]
发表于 2008-07-31 16:22 |只看该作者
v$session, v$sesstat and v$statname


你的登录用户应该是sys

conn / as sysdba

grant select on v$session to 你的用户名;
grant select on v$sesstat to 你的用户名;
grant select on v$statname to 你的用户名;

论坛徽章:
0
6 [报告]
发表于 2008-08-01 08:33 |只看该作者
sqlplus sys/ as dba
SQL >grant select on v$session to scott;
  
grant select on v$session to scott;
                           *
ERROR at line 1 :
ORA-02030: can only select from fixed table/views
SQL >

论坛徽章:
0
7 [报告]
发表于 2008-08-01 09:18 |只看该作者
step 1:
SQL> alter system set o7_dictionary_accessibility=true scope=spfile;
重启oracle使之生效

step 2:
SQL> grant create any table to 用户;

step3:
SQL> grant select any table to 用户;




操作例子:

  1  create user TT
  2  identified by TT
  3* default tablespace TBS
SQL> /

用户已创建

SQL> grant create session to TT
  2  ;

授权成功。

SQL> grant create any table to TT;

授权成功。

SQL> alter system set o7_dictionary_accessibility=true scope=spfile;

系统已更改。

SQL> grant select any table to TT;

授权成功。

SQL> show parameter o7

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
O7_DICTIONARY_ACCESSIBILITY          boolean     FALSE
SQL> shutdown immediate
数据库已经关闭。
已经卸载数据库。
ORACLE 例程已经关闭。
SQL> startup
ORACLE 例程已经启动。

Total System Global Area  135338868 bytes
Fixed Size                   453492 bytes
Variable Size             109051904 bytes
Database Buffers           25165824 bytes
Redo Buffers                 667648 bytes
数据库装载完毕。
数据库已经打开。
SQL> show parameter o7

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
O7_DICTIONARY_ACCESSIBILITY          boolean     TRUE
SQL>

论坛徽章:
0
8 [报告]
发表于 2008-08-01 19:03 |只看该作者
楼主问题解决了吗?

论坛徽章:
0
9 [报告]
发表于 2008-08-02 11:00 |只看该作者
问题按照7楼的说法,已经解决了,能给个简单的说明吗
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP