- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
2#
发表于 2012-8-6 17:29:34
SQL> conn system/oracle
Connected.
SQL>
SQL>
SQL> alter session set events '10046 trace name context forever,level 12 : 1031 trace name errorstack level 3';
Session altered.
SQL> create or replace view stats
2 as select 'STAT...'||a.name name,b.value
3 from v$statname a,v$mystat b
4 where a.statistic#=b.statistic#
5 union all
6 select 'LATCH.'|| name,gets
7 from v$latch;
from v$statname a,v$mystat b
*
ERROR at line 3:
ORA-01031: insufficient privileges
ORA-01031: insufficient privileges
----- Current SQL Statement for this session (sql_id=5tsgtgwm3d7mj) -----
create or replace view stats
as select 'STAT...'||a.name name,b.value
from v$statname a,v$mystat b
where a.statistic#=b.statistic#
union all
select 'LATCH.'|| name,gets
from v$latch
----- Call Stack Trace -----
calling call entry argument values in hex
location type point (? means dubious value)
-------------------- -------- -------------------- ----------------------------
skdstdst()+36 call kgdsdst() 000000000 ? 000000000 ?
7FFFF2D70C28 ? 000000001 ?
000000001 ? 000000002 ?
ksedst1()+98 call skdstdst() 000000000 ? 000000000 ?
7FFFF2D70C28 ? 000000001 ?
000000000 ? 000000002 ?
ksedst()+34 call ksedst1() 000000000 ? 000000001 ?
7FFFF2D70C28 ? 000000001 ?
000000000 ? 000000002 ?
dbkedDefDump()+2741 call ksedst() 000000000 ? 000000001 ?
7FFFF2D70C28 ? 000000001 ?
000000000 ? 000000002 ?
ksedmp()+36 call dbkedDefDump() 000000003 ? 000000000 ?
7FFFF2D70C28 ? 000000001 ?
000000000 ? 000000002 ?
dbkdaKsdActDriver() call ksedmp() 000000003 ? 000000000 ?
+1960 7FFFF2D70C28 ? 000000001 ?
000000000 ? 000000002 ?
dbgdaExecuteAction( call dbkdaKsdActDriver() 2B4AD69C7710 ? 7FFFF2D778B0 ?
)+1065 7FFFF2D70C28 ? 000000001 ?
000000000 ? 000000002 ?
dbgdaRunAction()+81 call dbgdaExecuteAction( 2B4AD69C7710 ? 00A0A8360 ?
0 ) 0020C0003 ? 7FFFF2D778B0 ?
000000001 ? 000000002 ?
dbgdRunActions()+59 call dbgdaRunAction() 2B4AD69C7710 ? 000000005 ?
0020C0003 ? 7FFFF2D778B0 ?
000000001 ? 000000002 ?
dbgdProcessEventAct call dbgdRunActions() 2B4AD69C7710 ? 000000005 ?
ions()+651 0020C0003 ? 7FFFF2D778B0 ?
000000001 ? 000000002 ?
dbgdChkEventKgErr() call dbgdProcessEventAct 2B4AD69C7710 ? 00BAF3FA0 ?
+1653 ions() 2B4AD6F1F698 ? 7FFFF2D778B0 ?
000000001 ? 000000002 ?
dbkdChkEventRdbmsEr call dbgdChkEventKgErr() 2B4AD69C7710 ? 00BAF3FA0 ?
r()+56 7FFFF2D6D460 ? 7FFFF2D778B0 ?
000000001 ? 000000002 ?
ksfpec()+61 call dbkdChkEventRdbmsEr 7FFFF2D6D460 ? 00BAF3FA0 ?
r() 7FFFF2D6D460 ? 7FFFF2D778B0 ?
000000001 ? 000000002 ?
dbgePostErrorKGE()+ call ksfpec() 7FFFF2D6D460 ? 7FFFF2D6D460 ?
1129 7FFFF2D6D460 ? 7FFFF2D778B0 ?
SQL> alter system set O7_DICTIONARY_ACCESSIBILITY=TRUE scope=spfile;
System altered.
SQL> startup force;
ORACLE instance started.
Total System Global Area 3140026368 bytes
Fixed Size 2232472 bytes
Variable Size 1795166056 bytes
Database Buffers 1325400064 bytes
Redo Buffers 17227776 bytes
Database mounted.
Database opened.
SQL> conn system/oracle
Connected.
SQL> create or replace view stats
2 as select 'STAT...'||a.name name,b.value
3 from v$statname a,v$mystat b
4 where a.statistic#=b.statistic#
5 union all
6 select 'LATCH.'|| name,gets
7 from v$latch;
View created.
SQL> alter system set O7_DICTIONARY_ACCESSIBILITY=false scope=spfile;
System altered.
SQL> startup force;
ORA-01031: insufficient privileges
SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@nas lib]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Mon Aug 6 10:20:14 2012
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> startup force;
ORACLE instance started.
Total System Global Area 3140026368 bytes
Fixed Size 2232472 bytes
Variable Size 1795166056 bytes
Database Buffers 1325400064 bytes
Redo Buffers 17227776 bytes
Database mounted.
Database opened.
SQL>
SQL>
SQL>
SQL> create user testpriv identified by oracle;
User created.
SQL> grant dba to testpriv;
Grant succeeded.
SQL> grant SELECT ANY DICTIONARY to testpriv;
Grant succeeded.
SQL> conn testpriv/oracle
Connected.
SQL> create or replace view stats
2 as select 'STAT...'||a.name name,b.value
3 from v$statname a,v$mystat b
4 where a.statistic#=b.statistic#
5 union all
6 select 'LATCH.'|| name,gets
7 from v$latch;
View created.
SQL> create user testpriv1 identified by oracle;
User created.
SQL> grant dba to testpriv1;
Grant succeeded.
SQL> show parameter O7
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
O7_DICTIONARY_ACCESSIBILITY boolean FALSE
SQL> conn testpriv1/oracle
Connected.
SQL>
SQL> create or replace view stats
2 as select 'STAT...'||a.name name,b.value
3 from v$statname a,v$mystat b
4 where a.statistic#=b.statistic#
5 union all
6 select 'LATCH.'|| name,gets
7 from v$latch;
from v$statname a,v$mystat b
*
ERROR at line 3:
ORA-01031: insufficient privileges
SQL> select * from session_privs where PRIVILEGE like '%DICTIONARY%';
PRIVILEGE
----------------------------------------
SELECT ANY DICTIONARY
ANALYZE ANY DICTIONARY
SQL> create or replace view stats
2 as select 'STAT...'||a.name name,b.value
3 from v$statname a,v$mystat b
4 where a.statistic#=b.statistic#
5 union all
6 select 'LATCH.'|| name,gets
7 from v$latch;
from v$statname a,v$mystat b
*
ERROR at line 3:
ORA-01031: insufficient privileges
SQL> conn / as sysdba
Connected.
SQL> grant SELECT ANY DICTIONARY to testpriv1;
Grant succeeded.
SQL> conn testpriv1/oracle
Connected.
SQL> create or replace view stats
2 as select 'STAT...'||a.name name,b.value
3 from v$statname a,v$mystat b
4 where a.statistic#=b.statistic#
5 union all
6 select 'LATCH.'|| name,gets
7 from v$latch;
View created.
SQL> select * from session_privs where PRIVILEGE like '%DICTIONARY%';
PRIVILEGE
----------------------------------------
SELECT ANY DICTIONARY
ANALYZE ANY DICTIONARY
这是 SELECT ANY DICTIONARY的一个问题, 原因是 SELECT ANY DICTIONARY权限是通过DBA角色隐式授予用户的,而非 显示地 GRANT SELECT ANY DICTIONARY给用户的
ORA-01031 SELECT ANY DICTIONARY System Privilege Granted Through Role Does Not Allow View Creation [ID 342489.1] 转到底部
修改时间:2010-9-8类型:PROBLEM状态:PUBLISHED优先级:3
注释 (0)
In this Document
Symptoms
Cause
Solution
References
Applies to:
Oracle Server - Enterprise Edition - Version: 9.2.0.1 to 11.2.0.1 - Release: 9.2 to 11.2
Information in this document applies to any platform.
Checked for relevance on 08-Sep-2010
Symptoms
The system privilege SELECT ANY DICTIONARY is granted to USER1 through DBA role.
USER1 attempts to create a view based upon SYS.OBJ$ table, but fails with ORA-1031 error :
SQL> create user USER1 identified by user1;
User created.
SQL> grant dba to USER1;
Grant succeeded.
SQL> connect USER1/user1
Connected.
SQL> create or replace view zz as select * from sys.obj$;
create or replace view zz as select * from sys.obj$
*
ERROR at line 1:
ORA-01031: insufficient privileges
Cause
The SELECT ANY DICTIONARY is granted through a role and not directly.
Solution
1. Set O7_DICTIONARY_ACCESSIBILITY to TRUE
or
2. Grant both SELECT ANY DICTIONARY and one of the following system privileges :
SELECT ANY TABLE
INSERT ANY TABLE
UPDATE ANY TABLE
COMMENT ANY TABLE
LOCK ANY TABLE
DELETE ANY TABLE
SQL> connect / as sysdba
Connected.
SQL> grant SELECT ANY DICTIONARY to USER1;
Grant succeeded.
SQL> connect USER1/user1
Connected.
SQL> create or replace view zz as select * from sys.obj$;
View created.
or
3. Grant the object privilege on the base table.
ORA-01031 SELECT ANY DICTIONARY System Privilege Granted Through Role Does Not Allow View Creation |
|