- 最后登录
- 2013-11-14
- 在线时间
- 104 小时
- 威望
- 999
- 金钱
- 271
- 注册时间
- 2013-1-9
- 阅读权限
- 70
- 帖子
- 63
- 精华
- 0
- 积分
- 999
- UID
- 855
|
14#
发表于 2013-3-31 12:19:33
dexter 发表于 2013-3-31 11:48
感谢您的回答,对于官方文档上说的Subtract this statistic from "parse count (total)" to determine th ...
应该是从10g以后,这个计算的情况就有变化啦。Oracle官方的文档应该是没有及时更新反映这些新的变化。另外Jonathan Lewis的一篇博客中评论部分也有读者反映到这个问题,可以参考一下。
Hi Jonathan,
Can be session cursor cache hits > parse count (total)? Why?
> @sid_parses 630
CURSOR_CACHE_HITS PARSE_CALLS HARD_PARSE CURSOR_CACHE_HITS SOFT_PARSES HARD_PARSES
----------------- ----------- ---------- ----------------- ----------- -----------
46250 35158 8064 131.55% -54.49% 22.94%
1 fila seleccionada.
> l
1 select
2 cursor_cache_hits,
3 parse_calls,
4 hard_parse,
5 to_char(100 * cursor_cache_hits / parse_calls, '999999999990.00' ) || '%' cursor_cache_hits,
6 to_char(100 * (parse_calls - cursor_cache_hits - hard_parse) / parse_calls, '999990.00' ) || '%' soft_parses,
7 to_char(100 * hard_parse / parse_calls, '999990.00' ) || '%' hard_parses
8 from
9 ( select value parse_calls from v$statname a, v$sesstat b where a.statistic# = b.statistic# and name = 'parse count (total)' and sid=:p1 ),
10 ( select value hard_parse from v$statname a, v$sesstat b where a.statistic# = b.statistic# and name = 'parse count (hard)' and sid=:p1 ),
11* ( select value cursor_cache_hits from v$statname a, v$sesstat b where a.statistic# = b.statistic# and name = 'session cursor cache hits' and sid=:p1)
(:p1 = 630 )
Is there anything wrong?
I got the query from Metalink:
SCRIPT – to Gauge the Impact of the SESSION_CACHED_CURSORS Parameter
Doc ID: Note:208918.1
Comment by Joaquín González — June 4, 2008 @ 5:03 pm UTC Jun 4,2008 | Reply
Joaquín,
Thanks for the note. I think you must be running 10.2. I hadn’t noticed it before but there seems to be a new code optimisation in 10.2 (possibly 10.1) that changes the way that some cursors can be cached.
After seeing your comment, I ran a couple of quick tests that show very different behaviour between 9.2 and 10.2 – but I haven’t yet pinned down what type of action leaves the cache hits greater than the parse calls. (I did notice, though, that a simple “startup force” left the statistics for the starting session in exactly this state). I guess a detailed examination of a 10046 trace file might reveal more of what’s going on.
This means, by the way, that comments I have made in other posts about substracting ‘session cursor cache hits’ from ‘parse count (total)’ are less useful 10g than they are for earlier versions.
Comment by Jonathan Lewis — June 10, 2008 @ 10:37 am UTC Jun 10,2008 | Reply
http://jonathanlewis.wordpress.com/2007/07/03/parse-calls/
|
|