SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled

今天是2013-09-17,在今天学习sql执行计划的是发现如下问题:
问题描述:
在rhys用户下开启sql语句计划报如下错误:

SQL> set autotrace on
SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled
SP2-0611: Error enabling STATISTICS report
问题分析:
由于该rhys账户没有PLUSTRACE角色导致此问题的产生。
解决办法:
1)查看$ORACLE_HOME/sqlplus/admin下的plustrce.sql发现如下内容:
-- Copyright (c) Oracle Corporation 1995, 2002. All Rights Reserved.
--
-- NAME
-- plustrce.sql
--
-- DESCRIPTION
-- Creates a role with access to Dynamic Performance Tables
-- for the SQL*Plus SET AUTOTRACE ... STATISTICS command.
-- After this script has been run, each user requiring access to
-- the AUTOTRACE feature should be granted the PLUSTRACE role by
-- the DBA.
--
-- USAGE
-- sqlplus "sys/knl_test7 as sysdba" @plustrce
--
-- Catalog.sql must have been run before this file is run.
-- This file must be run while connected to a DBA schema.

set echo on
drop role plustrace;
create role plustrace;
grant select on v_$sesstat to plustrace;
grant select on v_$statname to plustrace;
grant select on v_$mystat to plustrace;
grant plustrace to dba with admin option;
set echo off
2)执行该sql创建plustrace角色。
SQL> @./plustrce.sql
SQL>
SQL> drop role plustrace;
drop role plustrace
*
ERROR at line 1:
ORA-01919: role 'PLUSTRACE' does not exist


SQL> create role plustrace;
Role created.
SQL>
SQL> grant select on v_$sesstat to plustrace;
Grant succeeded.
SQL> grant select on v_$statname to plustrace;
Grant succeeded.
SQL> grant select on v_$mystat to plustrace;
Grant succeeded.
SQL> grant plustrace to dba with admin option;
Grant succeeded.
SQL>

SQL> set echo off

SQL>


SQL> grant plustrace to rhys;
Grant succeeded.

3)登录rhys账户在此开启sql语句分析功能。


SQL> conn rhys/amy

Connected.

SQL> set autotrace on

SQL>

发现该问题得到解决。

~

SQL> r
  1  select ename,job,sal,dname from amy_emp,amy_dept where amy_emp.deptno=amy_dept.deptno
  2  and not exists
  3* (select * from amy_salgrade where amy_emp.sal between losal and hisal)

no rows selected

Execution Plan
----------------------------------------------------------
Plan hash value: 2345751609

----------------------------------------------------------------------------------------------
| Id  | Operation                    | Name          | Rows  | Bytes | Cost (%CPU)| Time     |
----------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT             |               |     1 |    42 |     9  (23)| 00:00:01 |
|   1 |  NESTED LOOPS                |               |     1 |    42 |     9  (23)| 00:00:01 |
|   2 |   NESTED LOOPS               |               |     1 |    42 |     9  (23)| 00:00:01 |
|   3 |    MERGE JOIN ANTI           |               |     1 |    29 |     8  (25)| 00:00:01 |
|   4 |     SORT JOIN                |               |    14 |   294 |     4  (25)| 00:00:01 |
|   5 |      TABLE ACCESS FULL       | AMY_EMP       |    14 |   294 |     3   (0)| 00:00:01 |
|*  6 |     FILTER                   |               |       |       |            |          |
|*  7 |      SORT JOIN               |               |     5 |    40 |     4  (25)| 00:00:01 |
|   8 |       TABLE ACCESS FULL      | AMY_SALGRADE  |     5 |    40 |     3   (0)| 00:00:01 |
|*  9 |    INDEX RANGE SCAN          | REVERSE_INDEX |     1 |       |     0   (0)| 00:00:01 |
|  10 |   TABLE ACCESS BY INDEX ROWID| AMY_DEPT      |     1 |    13 |     1   (0)| 00:00:01 |
----------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

6 - filter("AMY_EMP"."SAL"<="HISAL")
   7 - access(INTERNAL_FUNCTION("AMY_EMP"."SAL")>=INTERNAL_FUNCTION("LOSAL"))
       filter(INTERNAL_FUNCTION("AMY_EMP"."SAL")>=INTERNAL_FUNCTION("LOSAL"))
   9 - access("AMY_EMP"."DEPTNO"="AMY_DEPT"."DEPTNO")

Statistics
----------------------------------------------------------
          0  recursive calls
          0  db block gets
          4  consistent gets
          0  physical reads
          0  redo size
        530  bytes sent via SQL*Net to client
        512  bytes received via SQL*Net from client
          1  SQL*Net roundtrips to/from client
          2  sorts (memory)
          0  sorts (disk)
          0  rows processed

SQL>

 

SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled的更多相关文章

  1. 【小错误】SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled

    1.今天在scott用户下执行语句跟踪时报了如下错误: SCOTT@ORA11GR2>set autotrace on SP2: Cannot find the Session Identifi ...

  2. Oracle set autotrace 时提示:Cannot find the Session Identifier. Check PLUSTRACE role is enabled

    SQL> set autotrace Usage: SET AUTOT[RACE] {OFF | ON | TRACE[ONLY]} [EXP[LAIN]] [STAT[ISTICS]] SQL ...

  3. 【ORACLE错误】SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled

    执行set autotrace traceonly的时候,报错 SQL> set autotrace traceonly SP2-0618: Cannot find the Session Id ...

  4. Cannot find the Session Identifier. Check PLUSTRACE role is enable

    解决方法: SQL> conn / as sysdbaConnected.SQL> @$ORACLE_HOME/rdbms/admin/utlxplan.sql; Table create ...

  5. 使用普通用户set autotrace on报错SP2-0618: Cannot find the Session Identifier

    普通用户使用 autotrace,出现如下报错: SQL> set autotrace on SP2-0618: Cannot find the Session Identifier.  Che ...

  6. SP2-0618: Cannot find the Session Identifier.

    [oracle@trade1 ~]$ sqlplus  user1/user1 SQL*Plus: Release 11.2.0.3.0 Production on Tue Aug 6 14:31:1 ...

  7. Linux check whether hyperthreading is enabled or not

    There parameters need to be obained: no. of physical CPU; no. of cores on each CPU; no. of all threa ...

  8. Oracle碎碎念~1

    1. 设置SQL*Plus提示符 SQL> set sqlprompt "_user'@'_connect_identifier>" SYS@orcl> 为了对所 ...

  9. SQL*Plus环境下创建PLUSTRACE角色

    普通用户在SQL*Plus中开启AUTOTRACE报告时,遇到SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is ...

随机推荐

  1. Oracle EBS-SQL (PO-6):检查订单接收总数.sql

    SELECT sum(rcvt.quantity) 接收事务处理汇总数--已排除退货 --rsh.receipt_num                   收据号, --pov.vendor_nam ...

  2. ubuntu gnome vnc

    1,安装登陆管理器 --apt-get install gdm (还可以为kdm/xdm) lightdm,display manager

  3. 【思路解析】discuz 帖子设置封面 setthreadcover 表pre_forum_threadimage

    在Discuz 中有一项就是给帖子设置封面,很多情况下只能通过手动的方式去设置或者用提交POST请求的式去设置: 但是这都是调用DISCUZ的功能设置的: 有的时候并非万能的,也有用不到的时候:下面就 ...

  4. 全国计算机等级考试二级教程-C语言程序设计_第9章_数组

    四维数组,可用于航天卫星,三维+时间 #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<stdlib.h> ...

  5. ios 开发 常见问题解决 (持续更新)

    1.使用cocoaPods引用第三方类库,报错:file not found   . 解决方案:设置 Project->Info->Configurations之后  clear ,然后再 ...

  6. LightOJ 1085(树状数组+离散化+DP,线段树)

    All Possible Increasing Subsequences Time Limit:3000MS     Memory Limit:65536KB     64bit IO Format: ...

  7. HTML字符实体(Character Entities),转义字符串(Escape Sequence)【转】

    为什么要用转义字符串? HTML中<,>,&等有特殊含义(<,>,用于链接签,&用于转义),不能直接使用.这些符号是不显示在我们最终看到的网页里的,那如果我们希 ...

  8. jquery第四期:对象转换的小实例

    为了更清晰的看懂jquery对象是一个数组,我们这一期来改变每一个<li>中的值,在前面加上序号. 代码如下: <!DOCTYPE html PUBLIC "-//W3C/ ...

  9. Java学习笔记---继承和super的用法

    自从换了个视频教学,感觉比原来那个好多了,就是学校网速太渣,好多视频看一会卡半天,只能先看看已经下载的了. 不过也好,虽然不能从开始开始重新开,但是已经看过一次,在看一次也是好的,就当巩固学习了. 继 ...

  10. 动画原理——绘制正弦函数&环绕运动&椭圆运动

    书籍名称:HTML5-Animation-with-JavaScript 书籍源码:https://github.com/lamberta/html5-animation  1.正弦函数.x位置递增, ...