执行set autotrace traceonly的时候,报错

SQL> set autotrace traceonly
SP2-0618: Cannot find the Session Identifier.  Check PLUSTRACE role is enabled
SP2-0611: Error enabling STATISTICS report

切换到sysdba下,授予权限

SQL> conn / as sysdba
Connected.
SQL> grant plustrace to scott;
grant plustrace to scott
      *
ERROR at line 1:
ORA-01919: role 'PLUSTRACE' does not exist

执行脚本:

SQL> @$ORACLE_HOME/sqlplus/admin/plustrce.sql

执行完后

查看该sql脚本的内容:

-----------------------------------------------------------------------------------------------------------

[oracle@zhang admin]$ more 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 "/ 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.


set echo on


drop role plustrace;
create role plustrace;


grant select on v_$sesstat to plustrace;
grant select on v_$statname to plustrace;
grant select on v_$mystat to plustrace;
grant plustrace to dba with admin option;


set echo off

------------------------------------------------------------------------------------------------

手动执行下面的sql,可以手动生成role

SQL> drop role plustrace;


Role dropped.


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 traceonly

成功,没有报错了

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

  1. 【小错误】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 ...

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

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

  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. Oracle 错误总结及问题解决 ORA

    参考地址 ORA-00001: 违反唯一约束条件 (.)错误说明:当在唯一索引所对应的列上键入重复值时,会触发此异常.ORA-00017: 请求会话以设置跟踪事件ORA-00018: 超出最大会话数O ...

  8. Oracle 错误收集

    Oracle 错误大全 ORA-00001: 违反唯一约束条件 (.)ORA-00017: 请求会话以设置跟踪事件ORA-00018: 超出最大会话数ORA-00019: 超出最大会话许可数ORA-0 ...

  9. oracle导入数据库报错:IMP-00019: 由于 ORACLE 错误 12899 而拒绝行 IMP-00003: 遇到 ORACLE 错误 12899

    主要是字符集 成 导入的Oracle服务器的字符集 对应不上. 以下方案为是修改服务器的字符集.    这样会影响之前的Oracle其他数据库的数据显示(正式服务器慎用) 个人认为应该修改导出文件的字 ...

随机推荐

  1. 什么叫做ECS云服务器?

    什么是ECS云服务器,阿里ECS云服务器与虚拟主机的区别是什么.以前,ECS云服务器还不带"云"字,只是叫做"服务器",毫无疑问"ECS云服务器&qu ...

  2. 简单的一段css代码让全站变灰,网站哀悼代码

    为表达全国各族人民对抗击新冠肺炎疫情斗争牺牲烈士和逝世通报的深切哀悼,国务院今天发布公告,决定2020年4月4日举行全国性哀悼活动.在此期间,全国和驻外使馆下半旗致哀,全国停止公共娱乐活动,4月4日1 ...

  3. SpringBoot魔法堂:应用热部署实践与原理浅析

    前言 后端开发的同学想必每天都在重复经历着修改代码.执行代码编译,等待--重启Tomcat服务,等待--最后测试发现还是有bug,然后上述流程再来一遍(我听不见)

  4. PHP字符串你不知道的事

    PHP常见的定义字符串的方式有那些? 1.单引号 在单引号中,任何特殊字符都会按原样输出[除\.\'将会被转义输出],不是什么都不解析的,这是很多人的误解 echo 'this is a var!'. ...

  5. java.lang.NoClassDefFoundError: org/I0Itec/zkclient/IZkStateListener

    spark streaming 读 kafka 报错 java.lang.NoClassDefFoundError: org/I0Itec/zkclient/IZkStateListener java ...

  6. SpringBoot从入门到精通教程(七)

    今天,我们继续讲SpringBoot整合Redis ,也就缓存,它将与我们的Springboot整合 Redis 简介 Redis 是当前比较热门的NOSQL系统之一,它是一个开源的使用ANSI c语 ...

  7. Epson 打印机计数器清零

    错误提示:废墨垫需要维护.请联系爱普生认证服务机构. 一.下载打印机清零软件 软件名称:EPSON Adjustment Program 二.USB线连接打印机 清零前请取消打印任务,打印机用USB线 ...

  8. 进入mysql数据库修改密码

    mysql -hlocalhost -uroot -p #修改密码mysql> set password for root@localhost = password('root');#启动数据库 ...

  9. sklearn中的SGDClassifier

    常用于大规模稀疏机器学习问题上 1.优点: 高效 简单 2.可以选择损失函数 loss="hinge": (soft-margin)线性SVM. loss="modifi ...

  10. Element UI组件说明

    -<el-card>-查询及展示列表页面-[v-show]属性控制显示隐藏-<el-card class="box-card" >-多标签页面-<el ...