Oracle LRU Latch Ratio Report

This script displays current LRU latch ratios for cache buffer LRU chains. It queries the V$LATCH_CHILDREN view and calculates sleep-to-get ratios to help detect latch contention, which may indicate buffer cache performance issues.

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

Code

(23 lines)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
-- -----------------------------------------------------------------------------------
-- File Name    : https://oracle-base.com/dba/monitoring/lru_latch_ratio.sql
-- Author       : Tim Hall
-- Description  : Displays current LRU latch ratios.
-- Requirements : Access to the V$ views.
-- Call Syntax  : @lru_latch_hit_ratio
-- Last Modified: 15/07/2000
-- -----------------------------------------------------------------------------------
SET LINESIZE 500
SET PAGESIZE 1000
COLUMN "Ratio %" FORMAT 990.00
 
PROMPT
PROMPT Values greater than 3% indicate contention.

SELECT a.child#,
       (a.SLEEPS / a.GETS) * 100 "Ratio %"
FROM   v$latch_children a
WHERE  a.name      = 'cache buffers lru chain'
ORDER BY 1;


SET PAGESIZE 14

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!