본문 바로가기
Dev/Oracle

[Oracle] TNS-12537: TNS:connection closed

by 흰바다제비 2022. 9. 1.
728x90

모든 에러는 alert log에 쌓이게 되는데, 로그를 확인해보니 다음과 같은 에러가 남았다.

(에러 로그 경로 : /oracle/app/oracle/diag/rdbms/orcl/ORCL/trace/alert_ORCL.log)

 

Fatal NI connect error 12537, connecting to:
 (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.1)(PORT=45454))

  VERSION INFORMATION:
        TNS for Linux: Version 19.0.0.0.0 - Production
        Oracle Bequeath NT Protocol Adapter for Linux: Version 19.0.0.0.0 - Production
        TCP/IP NT Protocol Adapter for Linux: Version 19.0.0.0.0 - Production
  Version 19.13.0.0.0
  Time: 20-AUG-2022 01:21:42
  Tracing not turned on.
  Tns error struct:
    ns main err code: 12537

TNS-12537: TNS:connection closed
    ns secondary err code: 12560
    nt main err code: 507

TNS-00507: Connection closed
    nt secondary err code: 0
    nt OS err code: 0
2022-08-20T01:21:42.451248+09:00
opiodr aborting process unknown ospid (6078) as a result of ORA-609
2022-08-20T01:21:42.488003+09:00
Errors in file /oracle/app/oracle/diag/rdbms/orcl/ORCL/trace/ORCL_ora_6078.trc:
ORA-00609: could not attach to incoming connection
ORA-12537: TNS:connection closed

 

ORA-12537은 커넥션이 종료되었음을 의미한다. 발생 원인은 아래와 같다.
1. 데이터베이스가 shutdown됨 (아마 새벽 백업을 진행하며 종료되었을 때 연결을 시도했을 것이다).
2. 클라이언트 연결에서 시간 초과(time-out)가 발생.
3. 방화벽이 유휴 연결(idle connection)을 닫을 때.
3. sqlnet.ora 또는 listener.ora의 구성 문제.
4. Windows의 Oracle TNS 클라이언트의 경로 이름이 너무 길 때

 

 

확인해보니 다른건 이상 없는 것 같고, 여기서 나에게 해당하는 원인은 2번 같다.

이 경우 해결 방법은 connection timeout 시간을 늘려주는 것.

 

sqlnet.ora 파일에 SQLNET.EXPIRE_TIME을 설정한다. 아래는 10분으로 설정해준 내용이다.

cat >> $ORACLE_HOME/network/admin/sqlnet.ora
SQLNET.EXPIRE_TIME=10

변경 사항을 적용하려면 세션을 다시 연결해야 하며 기존 연결에서는 작동하지 않는다.

 

 


발생 원인 원문

The ORA-12537 is an information message and means that the connection has been closed. This can be caused by a number of reasons:
1. Database is shut down (maybe for nightly backup), but connection to database was kept by client.
2. A time-out occurred on the client-connection.
3. When firewall closes idle connections.
3. A configuration problem in sqlnet.ora or listener.ora.
4. You have a path name that is too long for the Oracle TNS client on windows. (MetaLink Note:263489.1 )

 

What to do with ORA-12537: TNS: connection closed error

What to do with ORA-12537: TNS: connection closed error The ORA-12537 is an information message and means that the connection has been closed. This can be caused by a number of reasons: 1. Database is shut down (maybe for nightly backup), but connection to

www.oradev.com

 


해결 방법 참고

 

Oracle TNS-12535 and Dead Connection Detection

These days everything goes to the cloud or it has been collocated somewhere in a shared infrastructure. In this post I'll talk about sessions being disconnected from your databases, firewalls and dead connection detection. Changes We moved number of 11g da

sve.to

 

728x90

댓글