1.今天在scott用户下执行语句跟踪时报了如下错误:

  1. SCOTT@ORA11GR2>set autotrace on
  2. SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled
  3. SP2-0611: Error enabling STATISTICS report

2.通过上述问题分析,是由于scott用户没有PLUSTRACE角色,执行PLUSTRACE角色:

  1. [oracle@host02 ~]$ cd /u01/app/oracle/product/11.2.0/db_1/sqlplus/admin/
  2. [oracle@host02 admin]$ ls
  3. glogin.sql help libsqlplus.def plustrce.sql pupbld.sql
  4. [oracle@host02 admin]$ pwd
  5. /u01/app/oracle/product/11.2.0/db_1/sqlplus/admin
  6.  
  7. SYS@ORA11GR2>@/u01/app/oracle/product/11.2.0/db_1/sqlplus/admin/plustrce.sql
  8. SYS@ORA11GR2>
  9. SYS@ORA11GR2>drop role plustrace;
  10. drop role plustrace
  11. *
  12. ERROR at line 1:
  13. ORA-01919: role 'PLUSTRACE' does not exist
  14.  
  15. SYS@ORA11GR2>create role plustrace;
  16.  
  17. Role created.
  18.  
  19. SYS@ORA11GR2>
  20. SYS@ORA11GR2>grant select on v_$sesstat to plustrace;
  21.  
  22. Grant succeeded.
  23.  
  24. SYS@ORA11GR2>grant select on v_$statname to plustrace;
  25.  
  26. Grant succeeded.
  27.  
  28. SYS@ORA11GR2>grant select on v_$mystat to plustrace;
  29.  
  30. Grant succeeded.
  31.  
  32. SYS@ORA11GR2>grant plustrace to dba with admin option;
  33.  
  34. Grant succeeded.
  35.  
  36. SYS@ORA11GR2>
  37. SYS@ORA11GR2>set echo off

3.将plustrace角色给scott用户:

  1. SYS@ORA11GR2>grant plustrace to scott;
  2.  
  3. Grant succeeded.
  4.  
  5. SYS@ORA11GR2>conn scott/tiger
  6. Connected.
  7.  
  8. Session altered.
  9.  
  10. SCOTT@ORA11GR2>set auto on

这样scott用户就可以开启会话跟踪了。

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

  1. 【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 ...

  2. 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 ...

  3. 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 ...

  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. 记在thinkPHP中一个创建模型的小错误

    在创建好模型以后,访问说没有该方法,如图 看代码 class ManagerModel { //put your code here function checkDenglu($name,$pwd){ ...

  8. 简明Python中的一个小错误

    最近在学Python,先看的是<Python基础教程>,后来经别人推荐,感觉网络上的<简明Python教程>也挺好的,在里面发现一个小错误. 网址如下:http://sebug ...

  9. Unity 安卓Jar包的小错误

    好久没写博客了,也就意味着好久没有学习了,近几天在搞Unity接入有米的SDk遇到了一点小错误,今天早上解决了,和大家分享下! 1,我们的目的是在在U3D中调用Android产生的Jar包,首先在Ec ...

随机推荐

  1. oracle-trasnlate函数

    1.translate函数语法 TRANSLATE(string,from_str,to_str) 2.作用有两个: 1)可以替换string中的对应字符,from_str和to_str会做字符的一一 ...

  2. EXCEL导入(反射)

    import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import ja ...

  3. HttpClient封装工具类

    import java.io.IOException; import java.net.URI; import java.util.ArrayList; import java.util.List; ...

  4. 激!QTREE系列

    我现在才开始刷 QTREE 是不是太弱了?算了不管他…… QTREE: 树链剖分裸题(据说 lct 会超时……该说是真不愧有 spoj 的气息吗?) #include <cstdio> # ...

  5. HashMap 与 HashTable的区别

    1.HashTable的方法是同步的,HashMap未经同步,所以在多线程场合要手动同步HashMap这个区别就像Vector和ArrayList一样.可以用synchronized实现HashMap ...

  6. VS中的路径宏 vc++中OutDir、ProjectDir、SolutionDir各种路径

    原文链接:http://www.cnblogs.com/lidabo/archive/2012/05/29/2524170.html 说明 $(RemoteMachine) 设置为“调试”属性页上“远 ...

  7. Oracle定时计划快速使用

    Oracle定时计划快速使用 前言: SQL Server中有相关的定时计划,可以直接打开sql server 的任务管理器进行配置,可以方便.快速实现定时执行相应任务.相应的Oracle也有对应的定 ...

  8. ES6特性

    一.ES6特性: let, const, class, extends, super, arrow functions, template string, destructuring, default ...

  9. mybatis实战教程(mybatis in action)之二:以接口的方式编程

    前面一章,已经搭建好了eclipse,mybatis,mysql的环境,并且实现了一个简单的查询.请注意,这种方式是用SqlSession实例来直接执行已映射的SQL语句:session.select ...

  10. Android framework完整源码下载

    包括cpp等native代码.可zip打包下载. https://github.com/android/platform_frameworks_base/branches/stale Android线 ...