Oracle/Oh Oracle

Hang Manager(HM)

darkturtle26 2022. 11. 19. 17:32

Oracle SR 진행 및 구글링 결과

 

1. 실시간 혹은 지난 시간에대한 hang 발생 시, 바로 확인 가능 

2. v$session 에 FINAL_BLOCKING_SESSION 을 통해서도 확인 가능 할듯 (11g 부터 지원 된다고함 ) 



1. Hang Manager(HM) Phases
HM은 각 Instance의 DIA0 process에서 실행되며, HM Operation은 크게 5 Phase로 구분됩니다.
DETECT Phase -> HA (Global Hang Analyze) Phase -> ANALYZE Phase -> VERIFY Phase 
-> VICTIM(victim selection and hang resolution) Phase

- Hang 가능성이 있는 Session을 각각의 Local Instance Session에서 scan (Interval은 대략 30초 정도)
- 이러한 Local Hang 정보를 HA단계에서 취합하여 전체적인 Hang tree 및 root hang session을 분석 합니다.
- 이후 verify 단계를 거처 해당 process 또는 Instance를 terminate 합니다.

2. Hang Manager(HM) 파라미터 
_hang_resolution_scope = PROCESS|INSTANCE|OFF [PROCESS 가 DEFAULT ] 

select a.ksppinm "Parameter", c.ksppstvl "Instance Value", ksppdesc "Desc"
from sys.x$ksppi a, sys.x$ksppcv b, sys.x$ksppsv c
where a.indx = b.indx and a.indx = c.indx
and substr(ksppinm,1,1)='_'
and a.ksppinm in ('_hang_resolution_scope');

-- 현재 상태 및 spfile 적용 할 겅우
alter system set "_hang_resolution_scope"=OFF scope=both sid='*';

-- 현재 상태만 변경 할 겅우
alter system set "_hang_resolution_scope"=OFF scope=memory sid='*';

-- rollback
alter system set "_hang_resolution_scope"=INSTANCE scope=both sid='*';


3. 참고 사항 
1. DB 및 ASM LEVEL 설정 가능 
2. RAC 에서만 작동함 [ CLUSTER_DATABASE = TRUE, Single 에서 도 Trace 가 떨어짐 ] 
3. User Process 에 대해서는 작동 하지 않음 

4. 
참고 링크
http://orclbykuber.blogspot.com/2016/01/oracle-hang-management.html
http://mydbspace.com/?p=100

5. 관련 파일
bdump 에서
tail -f `ls -lrt *dia*base*.trc | tail -n 1 | awk '{print $9}'`
vi `ls -lrt *dia*base*.trc | tail -n 1 | awk '{print $9}'`