环境: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. PL-SLAM

    双目 1.PL-SLAM: a Stereo SLAM System through the Combination of Points and Line Segments ubuntu14.04配置 ...

  2. [No0000BB]ReSharper操作指南4/16-配置ReSharper代码快修与导航

    代码问题的快速修复 ReSharper可以帮助您立即修复设计时检测到的大部分代码问题.就像按Alt+Enter突出显示的代码问题一样简单,并选择合适的方法来解决问题或改进次优代码. GIF 应用快速修 ...

  3. seaborn画热力图注意的几点问题

    最近在使用注意力机制实现文本分类,我们需要观察每一个样本中,模型的重心放在哪里了,就是观察到权重最大的token.这时我们需要使用热力图进行可视化. 我这里用到:seaborn seaborn.hea ...

  4. flex-shrink (适用于弹性盒模型容器子元素)

    设置或检索弹性盒的收缩比率(根据弹性盒子元素所设置的收缩因子作为比率来收缩空间.) 语法 flex-shrink: <number> (default 1) flex-shrink的默认值 ...

  5. samba速度调优

    本来windows上传到板子上的速度很慢 增加 socket options = TCP_NODELAY 明显上传下载速度都快了 参考: https://superuser.com/questions ...

  6. PHP 正则表达式---匹配模式

    1.PHP 正则表达式 正则表达式贪婪匹配,非贪婪匹配. 默认是贪婪匹配, 例如 ①.贪婪匹配, $str = ' 香肠 月饼 '; preg_match('/ (.)</td>/',$s ...

  7. Linux下的几种IPC方式及其C语言实现

    写在前面:本博客为本人原创,严禁任何形式的转载!本博客只允许放在博客园(.cnblogs.com),如果您在其他网站看到这篇博文,请通过下面这个唯一的合法链接转到原文! 本博客全网唯一合法URL:ht ...

  8. [daily][gnucash] 复式记账

    管理, 是成就人生的第一步. 管钱,是第一步中的第一小步. 选了又选,终于选了一个软件,gnucash, 但是, 他有点专业, 用之前需要搞懂一下会计概念. 即: 复式记账 gnucash手册的这一章 ...

  9. [skill] 补码

    转载,写的很好!额,我的数学. 原文:https://www.douban.com/note/223507364/ 关于补码,看过一些书籍和网文,基本都是在“求反加一”的方法.步骤上反复强调,而对于补 ...

  10. TableView刷新跳动问题

    https://juejin.im/post/5aca1a04f265da2391486533 解决办法: 将估算高度设置为0即可: tableView.estimatedRowHeight = 0; ...