ORA-01931: cannot grant UNLIMITED TABLESPACE to a role
The UNLIMITED TABLESPACE privileges cannot be granted to a role
今天在做role測試的時候,遇到一個問題,當把unlimited tablespace privileges grant to role的時候,遇到錯誤:
ORA-01931: cannot grant UNLIMITED TABLESPACE to a role
情景重現:
1.建立role-> HELLO
SQL> conn / as sysdba
Connected.
SQL> show parameter instance_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
instance_name string devdb1
SQL> CREATE ROLE "HELLO" NOT IDENTIFIED;
Role created.
2.給角色授權-> UNLIMITED TABLESPACE
SQL> GRANT UNLIMITED TABLESPACE TO "HELLO";
GRANT UNLIMITED TABLESPACE TO "HELLO"
*
ERROR at line 1:
ORA-01931: cannot grant UNLIMITED TABLESPACE to a role
3.原因
Text: cannot grant UNLIMITED TABLESPACE, REFERENCES, or INDEX to a role
Cause: The UNLIMITED TABLESPACE, REFERENCES, or INDEX or SYSDBA or SYSOPER privileges cannot be granted to a role.
Action: Grant these privileges directly to the user.
4.授權給使用者成功
SQL> grant unlimited tablespace to ecc_view;
Grant succeeded.
把問題進一步深入分析:
如果把resource 賦予一個role,然後把這個role授權給使用者,使用者仍然沒有UNLIMITED TABLESPACE的許可權
原因為:
When the RESOURCE role is granted directly to a user, the UNLIMITED TABLESPACE system privilege is included in the role. However, the UNLIMITED TABLESPACE privilege actually gives the user unlimited QUOTA on all tablespaces, which is a user attribute.
If the RESOURCE role is granted to another role, and that role granted to users,there is no way to propagate user attributes. Thus, the users will not have quota on any tablespaces. Unlimited tablespace system privilege cannot be granted directly to a role
(ORA-1931).
1.建立角色hello,授予resource許可權
SQL> conn / as sysdba
Connected.
SQL> create role hello;
Role created.
SQL> grant resource to hello;
Grant succeeded.
2.建立普通使用者test
SQL> create user test identified by ecc ;
User created.
3.普通使用者test授予connect, hello角色
SQL> grant connect , hello to test;
Grant succeeded.
4.test連線,在表空間無許可權建立物件,因為系統許可權沒有繼承resource的許可權
SQL> conn test/ecc@devdb1
Connected.
SQL> create table t1 (id varchar(10));
create table t1 (id varchar(10))
*
ERROR at line 1:
ORA-01950: no privileges on tablespace 'USERS'
5.把resources直接授權給使用者test
SQL> conn / as sysdba;
Connected.
SQL> grant resource to test;
Grant succeeded.
6. UNLIMITED TABLESPACE被授予使用者
SQL> conn test/ecc@devdb1
Connected.
SQL> create table t1 (id varchar(10));
Table created.
Subject: OERR: ORA 1931 cannot grant UNLIMITED TABLESPACE, REFERENCES, or INDEX to a role
Doc ID: 19219.1 Type: REFERENCE
Modified Date : 10-JUN-1999 Status: PUBLISHED
Subject: ORA-1950 When Creating an Object and Resource Role is Granted to the User
Doc ID: 1005485.6 Type: PROBLEM
Modified Date : 30-MAR-2009 Status: PUBLISHED
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9252210/viewspace-606022/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle unlimited tablespace 許可權的用途OracleMIT
- unlimited tablespace許可權的授予和回收MIT
- 11G的rsource角色與Unlimited TablespaceMIT
- unlimited tablespace許可權和quota 配額MIT
- 11.2.0.2版本修改回收UNLIMITED TABLESPACE功能MIT
- the --skip-grant-tables option so it cannot
- Unlimited Tablespace 許可權 及 “延遲段”特性MIT
- 表空間配額和UNLIMITED TABLESPACE許可權MIT
- 詳解Oracle的unlimited tablespace系統許可權OracleMIT
- 系統許可權UNLIMITED TABLESPACE為什麼如此特殊?MIT
- grant with admin/grant option
- ORA-39322: Cannot use transportable tablespace with timestamp with timezone...
- SP2-0618: Cannot find the Session Identifier.Check PLUSTRACE role is enabledSessionIDE
- SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabledSessionIDE
- SP2-0618: Cannot find the Session Identifier. Check PLUSTRACE role is enabledSessionIDE
- SQL__GRANTSQL
- mysql grant 命令MySql
- MySQL Grant命令MySql
- 從ORA-01950報錯聊起——令人困惑的Resource角色和隱含unlimited tablespace系統許可權MIT
- PostgreSQL Role ManagementSQL
- oracle set roleOracle
- Ctrete new role
- grant 操作硬解析
- 關於WITH GRANT OPTION
- Oracle Grant / REVOKE 正解Oracle
- oracle 11gR2,取消使用者unlimited tablespace 許可權,那麼表空間上的quota也會相應取消OracleMIT
- ORA-01552: cannot use system rollback segment for non-system tablespace 'USERS'錯誤解決
- Laravel workflow with database and roleLaravelDatabase
- Oracle OCP(30):ROLEOracle
- 聊聊Oracle Default RoleOracle
- 關於GRANT賦權時,WITH GRANT OPTION和WITH ADMIN OPTION的使用
- oracle grant 語句的GRANT privilige TO user IDENTIFIED BY password 語法OracleIDE
- tablespace 大檔案,undo,temp tablespace
- 認識SQL Server2000 Server Role 和 Database RoleSQLServerDatabase
- mysqld --skip-grant-tablesMySql
- Oracle/PLSQL: Grant/Revoke PrivilegesOracleSQL
- 專案管理軟體:pyká Unlimited for Mac專案管理MITMac
- WoW Gold: Baron Soosdon - UNLIMITED Escapism Vol 5GoMITAPI