环境: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. centos 安装docker-compose

    #查看docker compose版本 docker-compose version #查看pip版本 pip -v #上一条语句没有显示版本信息则运行下面语句安装 python-pip yum -y ...

  2. Catch That Cow POJ - 3278 bfs map超时,短路判断顺序。

    题意:可以把n边为n+1,n-1,n*2问从n到k的最少变化次数. 坑:标题写了.有点不会写bfs了... ac代码 #define _CRT_SECURE_NO_WARNINGS #include& ...

  3. CSS3 ::selection 选择器

    ::selection { color:#ff0000; } ::-moz-selection { color:#ff0000; }详见 http://www.css88.com/archives/5 ...

  4. win server 2008添加磁盘-脱机转换为联机状态方法

    解决方案如下: 1.运行:cmd2.输入:DISKPART3.DISKPART> san4.DISKPART> san policy=onlineall5.DISKPART>list ...

  5. Fiddler笔记一移动端连接

    一.下载Fiddler 百度搜索”fiddler 下载“ ,安装最新版本   二.Fiddler手机抓包原理 在本机开启了一个http的代理服务器,然后它会转发所有的http请求和响应. Fiddle ...

  6. Struts2中.properties文件放置路径(classpath)

    一.web应用的classpath简介   classpath路径,即WEB-INF下面的classes目录,所有src目录下面的java.xml.properties等文件编译后都会在此. Stru ...

  7. bug:*** Collection <__NSArrayM: 0x1c444d440> was mutated while being enumerated.

    崩溃提示:Terminating app due to uncaught exception 'NSGenericException', reason: '*** Collection <CAL ...

  8. 获取连接的用户ip

    public static string GetUserIP() { string result = String.Empty; result = HttpContext.Current.Reques ...

  9. php 关于时间函数

    1. 设置时区 date_default_timezone_set() 和 putenv() 让时间安全地设置就,输入如下代码: date_default_timezone_set('UTC'); / ...

  10. SSH的三种端口转发

    1.本地转发 本地转发,顾名思义就是把本地主机端口转发到远程主机端口. ssh -L 本地主机端口:远程主机:远程主机端口 举例:ssh -L 50000:www.google.com:80 user ...