반응형
※ 이 글은 Oracle Database 11g Release 11.2.0.4.0 - 64bit 버전을 기준으로 작성된 글입니다.
ERROR NAME
ORA-12541 : TNS: no listener
Fatal NI connect error 12541.
SYMPTOMS
Oracle Listener가 제대로 동작하지 않을 경우 발생함.
- listener.ora 설정 오류
- listener.log 파일의 용량 초과
오라클 리스너 (Oracle Listener)
- 사용자(Client)가 오라클 서버로 접속하기 위해 통신을 중재하는 네트워크 관리자
- 따라서, 오라클 서버로 들어오는 모든 네트워크 연결은 리스너를 통해 연결됨
HOW TO SOLVE
따라서, 다음과 같이 조치하면 된다. 조치 방법은 세 가지다.
- Oracle Listener 재시작
- listener.ora 설정 파일 수정
- listener.log 로그 파일 용량 비우기
1. Oracle Listener 재시작
su - grid
lsnrctl status
lsnrctl start
- listener는 grid 계정으로 명령 실행해줘야 함. 아래는 Listener가 정상적으로 동작하는 경우
root@b3d01:/root# su - grid
[+ASM1]grid@b3d01:/home/grid> lsnrctl
LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 04-AUG-2022 15:53:41
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Welcome to LSNRCTL, type "help" for information.
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.1.0 - Production
Start Date 12-MAR-2022 00:24:05
Uptime 145 days 15 hr. 29 min. 39 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/12.1.0.1/grid/network/admin/listener.ora
Listener Log File /u01/app/grid/diag/tnslsnr/b3d01/listener/alert/log.xm l
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
...
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "KIS01_DGMGRL" has 1 instance(s).
Instance "KIS011", status UNKNOWN, has 1 handler(s) for this service...
Service "KIS02_DGMGRL" has 1 instance(s).
Instance "KIS021", status UNKNOWN, has 1 handler(s) for this service...
Service "SYS$SYS.SCHEDULER$_EVENT_QUEUE.KIS03" has 1 instance(s).
Instance "KIS031", status READY, has 1 handler(s) for this service...
The command completed successfully
LSNRCTL> start
2. listener.ora 설정 파일 수정
cd $TNS_ADMIN
vi listener.ora
- $TNS_ADMIN 은 Oracle DB 버전에 따라 경로가 다름. 보통 Oracle 계정의 기본 환경변수로 등록되어 있음
- 예시 : $TNS_ADMIN : /u01/app/oracle/product/10.2.0/db/network/admin/
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = xxx.xxx.xxx.xxx )(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
- LISTENER > HOST 부분 (xxx.xxx.xxx.xxx) 에 접속하고자 하는 client IP 입력 또는 수정.
3. listener.log 로그 파일 용량 비우기
listener.log 파일 용량이 4Gbyte를 넘는 경우 오류가 종종 발생함.
따라서, listener.log 파일을 삭제하면 됨. (삭제해도 이후에 자동으로 다시 재생성 됨)
su - oracle
vi .bash_profile
oracle 계정으로 접속한 후 .bash_profile 수정
[oracle@orcl ~]$ vi .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db
export ORACLE_SID=orcl
PATH=$ORACLE_HOME/bin:$PATH
export PATH
- 중간쯤에, export ORACLE_HOME 의 경로를 $TNS_ADMIN 경로로 수정해주면 됨
- export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db/network/admin
참고문헌
1. ORA-12541: TNS: no listener in Oracle Database || ORA 12541 || TNS: no listener || Oracle Listener
https://www.youtube.com/watch?v=1zYquO2T5-A
반응형
'운영(Ops) 이야기 > TroubleShooting' 카테고리의 다른 글
[Oracle] ORA-12154 : TNS: could not resolve the connect identifier specified 오류 해결 방법 (0) | 2022.08.03 |
---|