SP2-0618: 无法找到会话标识符。启用检查 PLUSTRACE 角色

用scott用户登录,想打开执行计划,报错

C:\Documents and Settings\Administrator>sqlplus scott/scott

SQL*Plus: Release 10.2.0.1.0 - Production on 星期一 5月 30 14:05:56 2011

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

连接到:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options

SQL> set autotrace on

SP2-0618: 无法找到会话标识符。启用检查 PLUSTRACE 角色

SP2-0611: 启用 STATISTICS 报告时出错。

解决方法:执行plustrce.sql脚本,建立plustrace角色,并赋权给public.

SQL> conn / as sysdba

已连接。

SQL> @utlxplan

SP2-0310: 无法打开文件 "utlxplan.sql"

SQL> @D:\oracle\product\10.2.0\db_1\sqlplus\admin\plustrce

SQL>

SQL> drop role plustrace;

drop role plustrace

          *

第 1 行出现错误:

ORA-01919: 角色 'PLUSTRACE' 不存在

SQL> create role plustrace;

角色已创建。

SQL>

SQL> grant select on v_$sesstat to plustrace;

授权成功。

SQL> grant select on v_$statname to plustrace;

授权成功。

SQL> grant select on v_$mystat to plustrace;

授权成功。

SQL> grant plustrace to dba with admin option;

授权成功。

SQL>

SQL> set echo off

SQL> grant plustrace to public

  2  ;

授权成功。

SQL> conn scott/scott

已连接。

SQL> set autotrace on          ------可以了

SQL> select  * from dept;

    DEPTNO DNAME          LOC

---------- -------------- -------------

        10 ACCOUNTING     NEW YORK

        20 RESEARCH       DALLAS

        30 SALES          CHICAGO

        40 OPERATIONS     BOSTON

执行计划

----------------------------------------------------------

Plan hash value: 3383998547

--------------------------------------------------------------------------

| Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |

--------------------------------------------------------------------------

|   0 | SELECT STATEMENT  |      |     4 |    80 |     3   (0)| 00:00:01 |

|   1 |  TABLE ACCESS FULL| DEPT |     4 |    80 |     3   (0)| 00:00:01 |

--------------------------------------------------------------------------

统计信息

----------------------------------------------------------

        192  recursive calls

          0  db block gets

         42  consistent gets

          0  physical reads

          0  redo size

        644  bytes sent via SQL*Net to client

        385  bytes received via SQL*Net from client

          2  SQL*Net roundtrips to/from client

          5  sorts (memory)

          0  sorts (disk)

          4  rows processed

==========================end==============

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值