执行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. 【ubantu下安装python3.6】

    Ubuntu16.04默认安装了Python2.7和3.5 请注意,系统自带的python千万不能卸载! 输入命令python

  2. 使用Jmeter测试thrift接口

    术语描述 jmeter:一款性能压力测试工具,支持多种协议,java .http 等,但是不支持thrift thrift:跨语言的RPC调用框架,提供编译器,可以将thrift接口生成不同语言的接口 ...

  3. Azure Databricks 第一篇:创建工作区、集群和Notebook

    Azure Databricks是一个可扩展的数据分析平台,基于Apache Spark.Azure Databricks 工作区(Workspace)是一个交互式的环境,工作区把对象(noteboo ...

  4. centos8中的MySQL卸载和安装

    centos8中的MySQL卸载和安装 前言 前几天在自己的服务器上安装了一个NDB集群[而且还没有成功] 放弃治疗后用一台没有mysql的服务器实现了单机版本的集群. 本来以为这事到这就结束了,结果 ...

  5. Spring Cloud 2020.0.0正式发布,再见了Netflix

    目录 ✍前言 版本约定 ✍正文 Spring Cloud版本管理 与Spring Boot版本对应关系 当前支持的版本 阻断式升级(不向下兼容) 1.再见了,Netflix Netflix组件替代方案 ...

  6. 回顾 2020 年 GitHub 的大事件,你知道多少?

    作者:HelloGitHub-小鱼干 这里是 HelloGitHub 出品的年度盘点系列,本期我们将盘点 GitHub 在 2020 发生的大事件,回顾一下今年 GitHub 给我们带来了那些惊喜.故 ...

  7. [实用指南]如何使您的旧代码库(遗留代码)符合MISRA C 2012编码规范?

    重用旧代码是现实,但是在安全关键型软件项目中重用旧代码并实现MISRA C 2012的完全合规性是艰巨的任务. 最初的MISRA原则是为了在开发代码时应用而创建的,即使文档本身也有警告: " ...

  8. Excel-VLOOKUP函数组合应用④

    问题场景 查找匹配并返回多列数据,例如:将某个部门所涉及的相关列的数据从[全员数据源]中整理出来,并按照一定顺序,然后发送给各部门的负责人. 场景 从[全员数据源]中共23列数据,整理出[测试部门人员 ...

  9. c#——ToString()的各种用法

    ToString()的各种用法 string str = ""; str = 123456.ToString("N"); //生成 12,3456.00 str ...

  10. idea中surround with

    idea中的surround with是把选中的代码块装进一些带有{}的语句中,比如if,try,for等等 快捷键是ctrl+alt+t,先选中代码,再按快捷键,如图