你好,游客 登录 注册 搜索
背景:
阅读新闻

升级10205遭遇bug222316 之 ora-1031 VS dba_role_privs.default_role =N

[日期:2012-07-05] 来源:Linux社区  作者:myownstars [字体:大 中 小]
OS: HP
DB: 10204升级到10205
症状:
原本正常的操作升级后一直抱ora-1031错误,如insert into a as select * b;
对表b 的select权限赋予了角色r,然后r被grant给当前用户u,但是却报错没有操作权限,若直接grant select on b to u插入操作可执行成功;
又是开了SR,又是经过好几天的信息更新,中间MOS居然还提供了方案“You need to drop the invalid sys objects as mentioned in the doc :- Invalid x_$ Objects After Upgrade (Doc ID 361757.1) .””,看来SR的信息更新很重要,一定要准确和完整,否则坑人又坑己 。
最后终于找到了如下解决方案:
 
Problem Description:
====================
Database Administrator grants privledges to a role, then grants this role to a
user.  When THE user tries to execute those privileges through this role, it
fails. However, user can execute privileges directly.
 
 
Problem Explanation:
====================
 
In SYS.DBA_ROLE_PRIVS this role shows up but DEFAULT_ROLE column is set to 'N'
therefore role cannot be executed as it is not a default.
 
SYS.DBA_ROLE_PRIVS shows roles granted to users and roles:
 
SVRMGR> desc dba_role_privs;
 
Column Name                    Null?    Type
------------------------------ -------- ----
GRANTEE  VARCHAR2(30)
GRANTED_ROLE                                  NOT NULL VARCHAR2(30)
ADMIN_OPTION                   VARCHAR2(3)
DEFAULT_ROLE                   VARCHAR2(3)
 
SVRMGR> select * from dba_role_privs
     2> where GRANTEE='AL';
 
GRANTEE                        GRANTED_ROLE                 ADM DEF
------------------------------ ------------------------------ --- ---
AL                              ABC                            NO  NO
AL                                                  ABCD                                                NO  NO
AL                             CONNECT                                NO  YES
AL                             RESOURCE                              NO  NO
4 rows selected.
 
Therefore the only role user AL can execute is Connect and neither role ABC nor
ABCD cannot be executed.
 
 
Search Words:
=============
 
ORA-00942: table or view does not exist
ORA-01031: insufficient privileges
 
 
Solution Description:
=====================
Issue the following statement to make all the roles
granted to user as default roles :
 
ALTER USER_NAME DEFAULT ROLE ALL;
 
 
Solution Explanation:
=====================
If one of the roles was altered as default, that will be the only role showing
as default.  To be able to execute a role it needs to appear as default in
SYS.DBA_ROLE_PRIVS:
 
SVRMGR> connect system
Password:
Connected.
SVRMGR> alter user al default role all;
Statement processed.
SVRMGR> select * from dba_role_privs
     2> where GRANTEE='AL';
GRANTEE                                                GRANTED_ROLE                          ADM DEF
------------------------------ ------------------------------ --- ---
AL                            ABC                             NO  YES
AL                             ABCD                                                             NO  YES
AL                             CONNECT                        NO  YES
AL                             RESOURCE                       NO  YES
4 rows selected.
 
All roles show as default therefore all privileges that were granted to a role
can now be executed not only directlty.
 
Solution References:
====================
BUG 222316linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款