zoukankan      html  css  js  c++  java
  • 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> set autotrace on
    SP2-0618: Cannot find the Session Identifier.  Check PLUSTRACE role is enabled
    SP2-0611: Error enabling STATISTICS report
    SQL> conn /as sysdba
    Connected.
    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> 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> grant plustrace to scott;
    
    Grant succeeded.
    
    SQL> conn scott/tiger
    Connected.
    
    SQL> set autotrace on
    SQL> select count(*) from emp;
    
      COUNT(*)
    ----------
        14
    
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 2937609675
    
    -------------------------------------------------------------------
    | Id  | Operation     | Name   | Rows  | Cost (%CPU)| Time      |
    -------------------------------------------------------------------
    |   0 | SELECT STATEMENT |      |    1 |    1   (0)| 00:00:01 |
    |   1 |  SORT AGGREGATE  |      |    1 |           |      |
    |   2 |   INDEX FULL SCAN| PK_EMP |    14 |    1   (0)| 00:00:01 |
    -------------------------------------------------------------------
    
    
    Statistics
    ----------------------------------------------------------
          1  recursive calls
          0  db block gets
          1  consistent gets
          1  physical reads
          0  redo size
        526  bytes sent via SQL*Net to client
        520  bytes received via SQL*Net from client
          2  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
          1  rows processed
    
    SQL> 
  • 相关阅读:
    C++指针和引用及区别
    C/C++中extern关键字总结
    php进阶面试题总结
    算法疑难(js实现)---11、字典树
    Trie|如何用字典树实现搜索引擎的关键词提示功能
    ExtJS表格——行号、复选框、选择模型
    Ext.js 中 25种类型的Ext.panel.Tool
    Ext NumberField使用
    [ext]form.submit()相关说明
    ExtJS 表单 submit时错误处理
  • 原文地址:https://www.cnblogs.com/yshyee/p/4294201.html
Copyright © 2011-2022 走看看