【问题标题】:create role ORACLE创建角色 ORACLE
【发布时间】:2020-08-20 03:40:44
【问题描述】:

我尝试创建新角色:

create role newRole;

我得到错误:

第 1 行的错误: ORA-01031: 权限不足

我检查 session_privs:

select * from session_privs;

PRIVILEGE
----------------------------------------
CREATE SESSION
CREATE ROLE

我不知道为什么我不能创建角色。有人遇到过这个问题吗?

【问题讨论】:

  • 可能是用户在您创建角色的表空间上没有配额/权限(默认表空间,或您为此特定用户设置为默认的表空间)
  • @AlexLarionov 角色不是在表空间中创建,而是在数据字典中。唯一的prerequisiteYou must have the CREATE ROLE system privilege

标签: sql oracle roles


【解决方案1】:

无法在 11.2 XE 中重现。这里是一个简单的验证

  • 首先创建具有两个权限的测试用户

  • 与此用户的连接已完成,ROLE 的创建没有问题

.

d:\>sqlplus sys as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Di Mai 5 17:20:57 2020

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Enter password:

Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

SQL> create user prd identified by vod;

User created.

SQL> grant create session to prd;

Grant succeeded.

SQL> grant create role to prd;

Grant succeeded.

SQL> connect prd/vod
Connected.
SQL> select privilege from session_privs;

PRIVILEGE
----------------------------------------
CREATE SESSION
CREATE ROLE

SQL> create role newRole;

Role created.

所以很可能背后有一些琐碎的解释。您已按预期与其他用户/在其他数据库中连接...

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-09-04
    • 1970-01-01
    • 1970-01-01
    • 2015-12-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多