执行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. node目录

    1 [了解nodejs] 1.1 [node简介] 1.2 [node的特点] 1.3 [如何安装] 1.4 [如何运行] 2 [es6--基本语法] 2.1 [变量的解构赋值] 2.2 [解构赋值] ...

  2. 移动端 canvas基础1

    一.canvas画布 Canvas是HTML5中新出的一个元素,开发者可以通过JS脚本动态绘制图像. #1. 创建canvas画布 在页面中创建canvas标签,并设置其id和宽高 (不要通过css设 ...

  3. 详细讲解docker容器和镜像的区别

    当我对Docker技术还是一知半解的时候,我发现理解Docker的命令非常困难.于是,我花了几周的时间来学习Docker的工作原理,更确切地说,是关于Docker统一文件系统(the union fi ...

  4. 如何用Python判断一个文件是否被占用?

    本文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,如有问题请及时联系我们以作处理 今天有同学问,用os模块的access()能否判断一个文件是否被占用?直觉上,这是行不通的,因为ac ...

  5. Swift3.0学习之基础部分

    1.常量和变量 常量和变量把一个名字(比如 maximumNumberOfLoginAttempts 或者 welcomeMessage )和一个指定类型的值(比如数字 10 或者字符串 " ...

  6. C# 托管与非托管类型 堆和栈 值类型与引用类型 装箱与拆箱

    一.托管类型与非托管类型 1.托管类型 托管类型包括 引用类型 以及 包含有引用类型或托管类型成员的结构. 引用类型 含引用类型或托管类型成员(字段.自动实现 get 访问器的属性)的结构 // 托管 ...

  7. 请收好 Linux 网络命令集锦

    看着kali linux上百个网络命令,我陷入了沉思.专业的网络命令实在是太多了,如果要罗列,上千个也是有的.个人不是渗透测试工作者,大部分功能只知皮毛.所以本文是非常浅显的技术总结,仅聚焦工作中常用 ...

  8. Java equals方法学习

    通过某个特征值来判断两个对象是否"等价",当这两个对象等价时,判断结果为true,否则结果为false. Object类(Java的"对象世界"的根)中实现的e ...

  9. 根据租户id获取部门树状结构有父子结构的数据list

    /** * 根据租户id获取部门树状结构 * @param tenantId * @return */ @GetMapping("getDeptTreeList") public ...

  10. Net Core(Net5) 部署到不同操作系统遇到问题的解决方法

    Net Core(Net5) 部署到不同操作系统的解决方法 目录 Net Core(Net5) 部署到不同操作系统的解决方法 1 系统版本升级补丁 1.1应用程序部署时VC无法安装,导致应用程序缺少配 ...