• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

手动模拟获取latch

mysql 搞代码 4年前 (2022-01-09) 25次浏览 已收录 0个评论

手动模拟获取latch 随意dump一个latches结构文件: SQL oradebug dump latches 10 ORA-00074: no process has been specified SQL oradebug setmypid Statement processed. SQL oradebug dump latches 10 Statement processed. SQL oradebug tracefile_name /o

手动模拟获取latch

随意dump一个latches结构文件:
SQL> oradebug dump latches 10
ORA-00074: no process has been specified
SQL> oradebug setmypid
Statement processed.
SQL> oradebug dump latches 10
Statement processed.
SQL> oradebug tracefile_name
/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_5564.trc

找到文件并随便找一个latch地址查看:
我们这里找的是地址为0x60019d98的一个active checkpoint queue,当前状态为free:
60019d98 active checkpoint queue latch level=5
Location from where latch is held: kcbk.h LINE:2222 ID:kcbbacq: scan active checkpoints:
Context saved from call: 0
state=free [value=0] wlstate=free [value=0]
gotten 2345 times wait, failed first 0 sleeps 0
gotten 0 times nowait, failed: 0

通过oradebug验证:
SQL> oradebug peek 0x60019d98 8
[060019D98, 060019DA0) = 00000000 00000000
该latch的当前值为0,确为free状态,我将它值修改为1:
SQL> oradebug poke 0

本文来源gao!daima.com搞$代!码#网#

x60019d98 2 1
BEFORE: [060019D98, 060019D9C) = 00000000
AFTER: [060019D98, 060019D9C) = 00000001
再次dump一个latches结构文件,并找到上述latch的信息:
60019d98 active checkpoint queue latch level=5
Location from where latch is held: kcbk.h LINE:2222 ID:kcbbacq: scan active checkpoints:
Context saved from call: 0
state=busy [holder orapid=1] wlstate=free [value=0]
waiters [orapid (seconds since: put on list, posted, alive check)]:
10 (30, 1402142587, 30)
waiter count=1
gotten 2607 times wait, failed first 0 sleeps 0
gotten 0 times nowait, failed: 0
此时状态为busy。


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:手动模拟获取latch
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址