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用户就可以开启会话跟踪了。

     

  • 相关阅读:
    安卓数据存储(3):SQLite数据库存储
    安卓活动间的传值问题
    JavaScript、jQuery获取radio、checkbox选中的值
    无法连接到VSS资源数据库
    JQuery自定义搜索控件
    UIAlertView使用
    Xcode使用git管理版本
    达乐居视频网前台页面的总结
    Spark环境搭建遇到的问题
    在IE中启动火狐——自定义浏览器链接协议
  • 原文地址:https://www.cnblogs.com/tomatoes-/p/6221539.html
Copyright © 2011-2022 走看看