Oracle Latch Holders Report

This script displays information about current latch holders in the database. It joins V$LATCH and V$LATCHHOLDER to show latch names, process/session identifiers, and wait statistics, helping DBAs investigate latch contention and concurrency issues.

oraclesqlperformance-tuningv1.0.0
0 stars0 downloads9 views0 comments
By OracleDba • Created

Code

(22 lines)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
-- -----------------------------------------------------------------------------------
-- File Name    : https://oracle-base.com/dba/monitoring/latch_holders.sql
-- Author       : Tim Hall
-- Description  : Displays information about all current latch holders.
-- Requirements : Access to the V$ views.
-- Call Syntax  : @latch_holders
-- Last Modified: 15-JUL-2000
-- -----------------------------------------------------------------------------------
SET LINESIZE 200

SELECT l.name "Latch Name",
       lh.pid "PID",
       lh.sid "SID",
       l.gets "Gets (Wait)",
       l.misses "Misses (Wait)",
       l.sleeps "Sleeps (Wait)",
       l.immediate_gets "Gets (No Wait)",
       l.immediate_misses "Misses (Wait)"
FROM   v$latch l,
       v$latchholder lh
WHERE  l.addr = lh.laddr
ORDER BY l.name;

General Comments(0)

Tip: Click on a line number in the code to add a line-specific comment

No general comments yet. Be the first to comment!