创建角色ORACLE

问题描述 投票:0回答:1

我尝试创建新角色:

create role newRole;

我收到错误:

第1行出现错误:ORA-01031:特权不足

我检查session_privs:

select * from session_privs;

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

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

sql oracle roles
1个回答
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.

因此很可能在后面进行了一些琐碎的解释。您已按预期与其他用户/在其他数据库中建立连接...

© www.soinside.com 2019 - 2024. All rights reserved.