• 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.
    
  • 相关阅读:
    Action返回类型
    低成本FPGA中实现动态相位调整
    SERDES高速系统(二)
    SERDES高速系统(一)
    Avalon总线概述
    FPGA热设计
    功耗的挑战
    特性阻抗介绍
    低阻抗电源分配系统
    非理想回路信号衰减
  • 原文地址:https://www.cnblogs.com/jyzhao/p/9967085.html
Copyright © 2020-2023  润新知