手动模拟获取latch

本文通过SQL命令演示了如何使用oradebug工具手动模拟获取Oracle中的latch,包括dump latches、peek和poke操作,详细解释了不同状态的变化,如latch从free状态变为busy状态的过程。
摘要由CSDN通过智能技术生成
手动模拟获取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)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值