Manual simulation to get latch
Arbitrarily dump a latches structure file:
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
Find the file and find a latch address to view:
We're looking for an active checkpoint queue with an address of 0x60019d98, and the current state is 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
Verify with Oradebug:
sql> Oradebug Peek 0x60019d98 8
[060019d98, 060019da0) = 00000000 00000000
The current value of the latch is 0, which is the Free State, and I change it to 1:
Sql> Oradebug Poke 0x60019d98 2 1
Before: [060019d98, 060019d9c) = 00000000
After: [060019d98, 060019d9c) = 00000001
Dump a latches structure file again and find the above latch information:
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
State of busy.
Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.
Manual simulation to get latch