zoukankan      html  css  js  c++  java
  • 【小错误】SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabled

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

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

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

    [oracle@host02 ~]$ cd /u01/app/oracle/product/11.2.0/db_1/sqlplus/admin/
    [oracle@host02 admin]$ ls
    glogin.sql  help  libsqlplus.def  plustrce.sql  pupbld.sql
    [oracle@host02 admin]$ pwd
    /u01/app/oracle/product/11.2.0/db_1/sqlplus/admin
    
    
    SYS@ORA11GR2>@/u01/app/oracle/product/11.2.0/db_1/sqlplus/admin/plustrce.sql
    SYS@ORA11GR2>
    SYS@ORA11GR2>drop role plustrace;
    drop role plustrace
              *
    ERROR at line 1:
    ORA-01919: role 'PLUSTRACE' does not exist
    
    
    SYS@ORA11GR2>create role plustrace;
    
    Role created.
    
    SYS@ORA11GR2>
    SYS@ORA11GR2>grant select on v_$sesstat to plustrace;
    
    Grant succeeded.
    
    SYS@ORA11GR2>grant select on v_$statname to plustrace;
    
    Grant succeeded.
    
    SYS@ORA11GR2>grant select on v_$mystat to plustrace;
    
    Grant succeeded.
    
    SYS@ORA11GR2>grant plustrace to dba with admin option;
    
    Grant succeeded.
    
    SYS@ORA11GR2>
    SYS@ORA11GR2>set echo off

    3.将plustrace角色给scott用户:

    SYS@ORA11GR2>grant plustrace to scott;
    
    Grant succeeded.
    
    SYS@ORA11GR2>conn scott/tiger
    Connected.
    
    Session altered.
    
    SCOTT@ORA11GR2>set auto on

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

     

  • 相关阅读:
    监督学习——决策树理论与实践(上):分类决策树
    监督学习——随机梯度下降算法(sgd)和批梯度下降算法(bgd)
    Protobuf 从入门到实战
    Android 广播机制
    Java 并发编程——volatile/synchronized
    Android 手势识别—缩放
    Jquery 使用和Jquery选择器
    初识jQuery
    正则表达式
    正则表达式
  • 原文地址:https://www.cnblogs.com/tomatoes-/p/6221539.html
Copyright © 2011-2022 走看看