SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled
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.
create role plustrace;
grant select on v_$statname to plustrace;
grant select on v_$mystat to plustrace;
grant plustrace to dba with admin option;
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;
SQL> grant select on v_$sesstat to plustrace;
SQL> set echo off
SQL>
SQL> grant plustrace to rhys;
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的更多相关文章
- 【小错误】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 ...
- 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 ...
- 【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 ...
- Cannot find the Session Identifier. Check PLUSTRACE role is enable
解决方法: SQL> conn / as sysdbaConnected.SQL> @$ORACLE_HOME/rdbms/admin/utlxplan.sql; Table create ...
- 使用普通用户set autotrace on报错SP2-0618: Cannot find the Session Identifier
普通用户使用 autotrace,出现如下报错: SQL> set autotrace on SP2-0618: Cannot find the Session Identifier. Che ...
- 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 ...
- 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 ...
- Oracle碎碎念~1
1. 设置SQL*Plus提示符 SQL> set sqlprompt "_user'@'_connect_identifier>" SYS@orcl> 为了对所 ...
- SQL*Plus环境下创建PLUSTRACE角色
普通用户在SQL*Plus中开启AUTOTRACE报告时,遇到SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is ...
随机推荐
- delphi 对TThread扩充TSimpleThread
对线程的使用,是每个开发者都应该熟练掌握的,也是进阶的重要一环. 可以这样说,没有线程,连界面假死的问题都解决不了,就更别谈并行处理来提高效率了. 本例对线程进行改进,打造一个基础的线程,以后线程应用 ...
- Android stagefright与opencore对比
[转载至其它博客] http://blog.csdn.net/djy1992/article/details/9339917 1引言 Android froyo版本多媒体引擎做了变动,新添加了st ...
- linux安装mongodb并启动
CentOS6.4 安装MongoDB 1.下载MongoDB(64位) http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.4.9.tg ...
- Linux下实现视频读取(二)---camera參数设定
Camera的可设置项极多,V4L2 支持了不少.但Sam之前对这些设置的使用方法和涵义都是在看videodev2.h中边看边理解.感觉很生涩. 直到写这篇blog时,才发现v4l2有专门的SPEC来 ...
- POJ 1703 Find them, Catch them (数据结构-并查集)
Find them, Catch them Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 31102 Accepted: ...
- 第四章SignalR自托管主机
第四章SignalR自托管主机 SignalR服务器通常在IIS的Asp.Net应用程序上承载,但它也可以使用自托管库来作为自托管的主机来运行(就像控制台应用程序或Windows服务那样)与Signa ...
- 如何启用Oracle EBS Form监控【Z】
前言: 有时候,因某些需要,必须知道Oracle的Form被使用的情况,以方面我们做出决策: 例如,如果某个Form被使用的次数非常多,那么,这个Form的相关SQL代码就应该优先处理,以减少服务器负 ...
- html combobox select控件设置默认选项
就想找个设置html combobox或者select默认选项的代码,百度搜了半小时不知所云的内容,其实很简单,代码如下 js的方式: var index = 你的下标 getElementById( ...
- 基于nginx+lua简单的灰度发布系统
upstream.conf upstream grey_1 { keepalive 1000; server localhost:8020; } upstream grey_2 { keepalive ...
- Linux简介(好!)
Linux操作系统介绍 来源:233网校论文中心[ 2009-12-02 14:23:00 ]阅读:1作者:王长青编辑:studa20 [摘 要]文章从Unix.Minix系统的产生引出了Linux操 ...