- 最后登录
- 2018-9-14
- 在线时间
- 103 小时
- 威望
- 0
- 金钱
- 1829
- 注册时间
- 2012-12-17
- 阅读权限
- 10
- 帖子
- 139
- 精华
- 1
- 积分
- 0
- UID
- 820
|
1#
发表于 2013-8-28 13:55:28
|
查看: 2634 |
回复: 1
http://www.askmaclean.com/archives/oracle-latch%E9%97%A9%E5%8E%9F%E7%90%86%E7%A4%BA%E6%84%8F%E5%9B%BE.html
刘大的这个帖子里面写的脚本,表示v$latch.gets是在willing-to-wait模式下取得成功之后才会加1
reference里面是写说Number of times the latch was requested in willing-to-wait mode,并没有说是成功取得latch才加1;
所以有点疑惑- Function Get_Latch(latch_name,mode)
- {
- If Mode eq ‘immediate’ {
- If Fast_Get(latch_name) {
- return TRUE
- Else {
- return FALSE
- }
- }
- Else {
- [color=Red] If Fast_Get(latch_name)
- Then {
- v$latch.gets++
- return TRUE
- }[/color]
- Else {
- v$latch.misses++
- for try = 0 .. large_number
- {
- if Spin_Get(latch_name)
- Then {
- return TRUE
- }
- Else {
- T0 = time
- Sleep(try)
- T1=time
- Register_Event("latch free",T1-T0)
- }
- } -- spin/sleep loop
- }
- }
- }
复制代码 |
|