GV$로 인스턴스별 클러스터 전체 wait event(gc 대기) 분석
OracleRAC 및 Grid명령어
-- Cluster-class waits per instance (since startup):
SELECT inst_id, event, total_waits,
ROUND(time_waited_micro/1e6) AS time_waited_s,
ROUND(time_waited_micro/NULLIF(total_waits,0)/1000, 2) AS avg_ms
FROM gv$system_event
WHERE wait_class = 'Cluster'
ORDER BY time_waited_micro DESC
FETCH FIRST 15 ROWS ONLY;
-- Sessions waiting right now, by instance and event:
SELECT inst_id, event, COUNT(*) AS sessions
FROM gv$session
WHERE wait_class <> 'Idle' AND state = 'WAITING'
GROUP BY inst_id, event
ORDER BY sessions DESC;
-- ASH for the last 15 minutes: which instance is waiting on gc
SELECT inst_id, event, COUNT(*) AS samples
FROM gv$active_session_history
WHERE sample_time > SYSTIMESTAMP - INTERVAL '15' MINUTE
AND wait_class = 'Cluster'
GROUP BY inst_id, event
ORDER BY samples DESC
FETCH FIRST 10 ROWS ONLY;하는 일
GV$ 뷰로 모든 인스턴스의 Cluster 클래스 대기(gc cr/current block 2-way/3-way, gc buffer busy, gc cr request)와 평균 지연을 하나의 쿼리로 보여 준다.
사용 시점
사용자가 RAC에서 느려짐을 보고할 때, 문제가 interconnect/global cache에서 오는지와 어느 인스턴스에 집중되는지 판별하기 위해.
주의
gv$active_session_history는 Diagnostics Pack 라이선스가 필요하다. avg_ms가 몇 ms를 넘으면 먼저 interconnect(MTU, 패킷 손실, netstat -s)와 LMS CPU를 점검한다. gc buffer busy는 대개 애플리케이션 hot block(시퀀스, right-hand 인덱스)을 가리킨다.