zoukankan      html  css  js  c++  java
  • ORA-01919: role 'PLUSTRACE' does not exist

    环境: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.
    
  • 相关阅读:
    python三大神器
    centos安装fish shell
    linux查看日志
    web攻击
    web安全之XSS
    JSONP && CORS
    css 定位
    MIT-线性代数笔记(1-6)
    es6 Object.assign
    ECMAScript 6 笔记(六)
  • 原文地址:https://www.cnblogs.com/jyzhao/p/9967085.html
Copyright © 2011-2022 走看看