프린트 하기

내맘대로긍정이 알려주는

Oracle 23ai 신기능
무료 세미나 발표자료

다운로드 trending_flat
2024
10.12
14:00

OS환경 : Oracle Linux6.8(64bit)


DB 환경 : Oracle Database 11.2.0.4


에러 : sqlplus 접속시 hang

1
2
3
4
5
6
7
$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Mon Dec 17 11:00:12 2018
 
Copyright (c) 19822013, Oracle.  All rights reserved.
.
.
(반응없이 Hang)



해결 방법 : sqlplus -prelim / as sysdba 으로 접속하여 shutdown abort 해준다.

접속이 안된다는 이상이 있다고 연락을 받고 확인을 하려 할 때 maximum processes 값을 초과하여 접속을 할 수 없을 경우가 있을 수 있다.

또는 shared pool의 부족 등의 이유도 있을 수 있다.

 

이때 선택하는 방법은 pmon을 kill하고 startup 하는 비상 조치를 취할 수 있는데 

문제는 이 경우 추후 원인을 찾지 못할 수도 있고 이 조치를 취하면 안되는 즉, DB를 내리면 안되는 경우도 있을 수 있다.

 

그래서 -prelim 옵션이 존재함(preliminary connect)

(오라클 메뉴얼에서 검색으로도 찾을 수 없음)


일반적으로 db에 접속하는 과정은 

1. 정상 상태에서 sysdba 접속시 새 프로세스를 시작하고, 

2. 새 프로세스가 SGA에 접속하고, 

3. SGA내에 프로세스와 세션 상태 정보를 넣기 위한 메모리를 할당받아 남긴다.

 

하지만 prelim 옵션은 마지막 과정이 없다.

그래서 Lock이나 latch나 mutext를 사용하는 작업을 할 수는 없다.

(prelim 접속시 shutdown 명령도 abort만 가능함) 



테스트

sqlplus 접속

1
2
3
4
$ sqlplus -prelim / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Mon Dec 17 11:02:46 2018
 
Copyright (c) 19822013, Oracle.  All rights reserved.


일반 명령어 입력시도 하지만 실패

1
2
3
4
5
6
7
SQL> select 1 from dual;                        
select 1 from dual
*
ERROR at line 1:
ORA-01012not logged on
Process ID: 0
Session ID: 0 Serial number: 0


oradebug로 로깅

1
2
3
4
5
6
7
8
9
SQL> oradebug setmypid
Statement processed.
 
SQL> oradebug unlimit
 
Statement processed.
 
SQL> oradebug hanganalyze 12
Statement processed.


shutdown abort 시도

1
2
SQL> shutdown abort
ORACLE instance shut down.

명령어가 잘사용됨



RAC일 경우 옵션이 다르게 있음

1
2
3
4
5
6
7
8
9
10
11
SQL> oradebug setmypid
Statement processed.
 
SQL> oradebug unlimit
Statement processed.
 
SQL> oradebug -g all hanganalyze 3
Hang Analysis in /oracle/app/oracle/diag/rdbms/orcldb/ORCLDB1/trace/ORCLDB1_diag_29516.trc
 
SQL> oradebug -g all dump systemstate 266
Statement processed.


※해당 기능을 사용한 케이스의 링크

http://arup.blogspot.kr/2008/08/diagnosing-library-cache-latch.html



원인 : maximum processes 값 초과




참조 : http://neo-orcl.tistory.com/114