- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
2#
发表于 2012-1-8 21:12:58
ODM Data
Bug 3645969: V$SQL.OBJECT_STATUS COLUMN IS RETURNING A NOT DOCUMENTED VALUE
this document said
"PROBLEM:
--------
v$sql.object_status column can return a value that is not documented.
Documented values are VALID, INVALID.
But it can return:
'INVALID_UNAUTH' object status
That cursors all has 0 executions.
This SQL is actually spinning (100% CPU).
The understanding of this status may help solving the real problem.
DIAGNOSTIC ANALYSIS:
--------------------
The definition of GV$SQL contains:
Select ..
decode(kglobsta, 1, 'VALID', 2, 'VALID_AUTH_ERROR', 3, 'VALID_COMPILE_ERROR',
4, 'VALID_UNAUTH', 5, 'INVALID_UNAUTH', 6, 'INVALID'), ...
from x$kglcursor
..."
OBJECT_STATUS VARCHAR2(19) Status of the cursor:
VALID - Valid, authorized without errors
VALID_AUTH_ERROR - Valid, authorized with authorization errors
VALID_COMPILE_ERROR - Valid, authorized with compilation errors
VALID_UNAUTH - Valid, unauthorized
INVALID_UNAUTH - Invalid, unauthorized
INVALID - Invalid, unauthorized but keep the timestamp
Abstract: INCLUDE THE OBJECT STATUS OF THE CHILD CURSOR IN V$SQL AND GV$SQL
Problem:
The status of a cursor is availabile in X$KGLCURSOR but is not included in
V$SQL or GV$SQL. This
means it is not possible to use the latter views to access for eaxmple all
valid cursors, all
unauthorized cursors etc.
Versions:
oracle release 8.0 and 8i
Workaround:
The following view includes the status and also the child address:
create or replace view v$sql2 as
select
userenv('instance') INST_ID,
kglnaobj SQL_TEXT,
kglobhs0+kglobhs1+kglobhs2+kglobhs3+kglobhs4+kglobhs5+kglobhs6+kglobt16
SHARABLE_MEM,
kglobt08+kglobt11 PERSISTENT_MEM,
kglobt10 RUNTIME_MEM,
kglobt01 SORTS,
decode(kglobhs6,0,0,1) LOADED_VERSIONS,
decode(kglhdlmd,0,0,1) OPEN_VERSIONS,
kglhdlkc USERS_OPENING,
kglhdexc EXECUTIONS,
kglobpc6 USERS_EXECUTING,
kglhdldc LOADS,
substr(to_char(kglnatim,'YYYY-MM-DD/HH24:MI:SS'),1,19) FIRST_LOAD_TIME,
decode(kglobsta, 1, 'VALID
', 2, 'VALID_AUTH_ERROR'
,3 ,'VALID_COMPILE_ERROR
', 4, 'VALID_UNAUTH
', 5, 'INVALID_UNAUTH
', 6, 'INVALID'
, kglobsta) OBJECT_STATUS,
kglhdivc INVALIDATIONS,
kglobt12 PARSE_CALLS,
kglobt13 DISK_READS,
kglobt14 BUFFER_GETS,
kglobt15 ROWS_PROCESSED,
kglobt02 COMMAND_TYPE,
decode(kglobt32,
0, 'NONE',
1, 'ALL_ROWS',
2, 'FIRST_ROWS',
3, 'RULE',
4, 'CHOOSE',
'UNKNOWN') OPTIMIZER_MODE,
kglobtn0 OPTIMIZER_COST,
kglobt17 PARSING_USER_ID,
kglobt18 PARSING_SCHEMA_ID,
kglhdkmk KEPT_VERSIONS,
kglhdpar ADDRESS,
kglhdadr CHILD_ADDRESS,
kglobtp0 TYPE_CHK_HEAP,
kglnahsh HASH_VALUE,
kglobt09 CHILD_NUMBER,
kglobts0 MODULE,
kglobt19 MODULE_HASH,
kglobts1 ACTION,
kglobt20 ACTION_HASH,
kglobt21 SERIALIZABLE_ABORTS,
kglobts2 OUTLINE_CATEGORY
from x$kglcursor
where kglobt02 != 0
and kglhdadr != kglhdpar ;
grant select on v$sql2 to public;
drop public synonym v$sql2 ;
create public synonym v$sql2 for v$sql2 ;
Related Bug(s):
1376603, 1376567 |
|