环境:Oracle 10g,11g.

现象:在一次迁移测试中,发现有这样的角色赋权会报错不存在:

SYS@orcl> grant PLUSTRACE to jingyu;
grant PLUSTRACE to jingyu
*
ERROR at line 1:
ORA-01919: role 'PLUSTRACE' does not exist

查询发现这个角色是需要手工执行脚本创建,直接执行Oracle自带的SQL脚本@?/sqlplus/admin/plustrce.sql即可:

SYS@orcl> @?/sqlplus/admin/plustrce.sql
SYS@orcl>
SYS@orcl> drop role plustrace;
drop role plustrace
*
ERROR at line 1:
ORA-01919: role 'PLUSTRACE' does not exist SYS@orcl> create role plustrace; Role created. SYS@orcl>
SYS@orcl> grant select on v_$sesstat to plustrace; Grant succeeded. SYS@orcl> grant select on v_$statname to plustrace; Grant succeeded. SYS@orcl> grant select on v_$mystat to plustrace; Grant succeeded. SYS@orcl> grant plustrace to dba with admin option; Grant succeeded. SYS@orcl>
SYS@orcl> set echo off
SYS@orcl>

可以看到这个角色就是封装了对v_$sesstat,v_$statname,v_$mystat这几个视图的查询权限。

执行以后就可以直接赋予用户PLUSTRACE的角色了:

SYS@orcl> grant PLUSTRACE to jingyu;

Grant succeeded.

ORA-01919: role 'PLUSTRACE' does not exist的更多相关文章

  1. 诊断:ORA-01919: role ‘PLUSTRACE’ does not exist

    如下错误 SQL> grant plustrace to scott; grant plustrace to scott * ERROR at line 1: ORA-01919: role ' ...

  2. ORA-01919: role 'OLAPI_TRACE_USER' does not exist

    我在用数据泵导入数据的时候报的错 TEST_USER1@ORCL> conn / as sysdbaSYS@ORCL> grant plustrace to TEST_USER1; gra ...

  3. postgresql 使用pg_restore时显示role "root" does not exist的解决办法

    在docker里恢复bakcup格式的数据库,结果提示role "root" does not exist 解决方法: 切换用户: su - postgres 然后再次运行命令: ...

  4. ORA-01917: user or role 'PDB_DBA' does not exist

    在使用seed PDB创建新的PDB的时候,报了以下错误提示: SQL> create pluggable database pdb2 admin user admin1 identified ...

  5. psql: FATAL: role “postgres” does not exist

    I'm a postgres novice. I installed the postgres.app for mac. I was playing around with the psql comm ...

  6. psql: FATAL: role “postgres” does not exist 解决方案

    当时想做的事情,是运行一个创建数据库的脚本.找到的解决方案差不多和下面这个链接相同. http://stackoverflow.com/questions/15301826/psql-fatal-ro ...

  7. role 'PLUSTRACE' does not exist

    I have created a new user named watson and granted the related priviledges as following: SQL> cre ...

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

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

随机推荐

  1. [No0000155]为什么32位机器最大只能用到4GB内存

    在此之前先来了解一些计算机存储单位之间的关系以及计算机系统结构和PC硬件方面的一些知识. 一.计算机存储单位之间的关系 ,最小的存储单位. 个二进制位为一个字节(B),即1B = 8bit,最常用的单 ...

  2. [No0000121]Python教程4/9-输入和输出

    输出 用print()在括号中加上字符串,就可以向屏幕上输出指定的文字.比如输出'hello, world',用代码实现如下: >>> print('hello, world') p ...

  3. TensorRT 不支持Tensorflow的操作有如下

    tf.unpack, tf.slice, tf.tile, tf.expand_dims, tf.fill, tf.cast, tf.floor_div, tf.range 比较坑,所以你必须限制你的 ...

  4. java高级精讲之高并发抢红包~揭开Redis分布式集群与Lua神秘面纱

    java高级精讲之高并发抢红包~揭开Redis分布式集群与Lua神秘面纱 redis数据库 Redis企业集群高级应用精品教程[图灵学院] Redis权威指南 利用redis + lua解决抢红包高并 ...

  5. HTTP缓存机制及原理

    前言 Http 缓存机制作为 web 性能优化的重要手段,对于从事 Web 开发的同学们来说,应该是知识体系库中的一个基础环节,同时对于有志成为前端架构师的同学来说是必备的知识技能.但是对于很多前端同 ...

  6. 数学用语中的 透明 transitive property

    1.透明 https://en.wikipedia.org/wiki/Equivalence_relation In mathematics, an equivalence relation is a ...

  7. 双栈算术表达式求值算法 栈(Stack) - Java实现

    https://mp.weixin.qq.com/s/dg8mgd6CIQ7Tui1_fQwSBA https://github.com/toywei/DataStructure/tree/maste ...

  8. 查找->动态查找表->哈希表

    文字描述 哈希表定义 在前面讨论的各种查找算法中,都是建立在“比较”的基础上.记录的关键字和记录在结构中的相对位置不存在确定的关系,查找的效率依赖于查找过程中所进行的比较次数.而理想的情况是希望不经过 ...

  9. 添加linux系统调用的两种方式

    原文:https://blog.csdn.net/sdulibh/article/details/51889279 向linux内核添加系统调用,一是通过编译内核添加,二是通过内核模块的方式添加: 一 ...

  10. LDA学习小记

    看到一段对主题模型的总结,感觉很精辟: 如何找到文本隐含的主题呢?常用的方法一般都是基于统计学的生成方法.即假设以一定的概率选择了一个主题,然后以一定的概率选择当前主题的词.最后这些词组成了我们当前的 ...