프린트 하기

OS환경 : Oracle Linux 8.1 (64bit)


DB 환경 : Oracle Database 19.3.0.0


에러 : TNS-12541: TNS:no listener,  TNS-12560: TNS:protocol adapter error,  TNS-00511: No listener

리스너 기동 시 에러 발생하면서 리스너가 느리게 기동됨
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
$ lsnrctl start
 
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 06-JAN-2020 23:54:19
 
Copyright (c) 19912019, Oracle.  All rights reserved.
 
Starting /ORA19/app/oracle/product/19.0.0/db_1/bin/tnslsnr: please wait...
 
TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /ORA19/app/oracle/product/19.0.0/db_1/network/admin/listener.ora
Log messages written to /ORA19/app/oracle/diag/tnslsnr/oel8/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oel8)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oel8)(PORT=1521)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                06-JAN-2020 23:54:40
Uptime                    0 days 0 hr. 0 min. 21 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /ORA19/app/oracle/product/19.0.0/db_1/network/admin/listener.ora
Listener Log File         /ORA19/app/oracle/diag/tnslsnr/oel8/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oel8)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully

리스너가 느리게 올라가며 TNS-12541, TNS-12560. TNS-00511 이 발생함



리스너 기동시 리스너 로그

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$ tail -300f /ORA19/app/oracle/diag/tnslsnr/oel8/listener/trace/listener.log
2020-01-06T23:54:40.834243+09:00
 
LISTENER for Linux: Version 19.0.0.0.0 - Production 
Version 19.3.0.0.0
 
System parameter file is /ORA19/app/oracle/product/19.0.0/db_1/network/admin/listener.ora
Log messages written to /ORA19/app/oracle/diag/tnslsnr/oel8/listener/alert/log.xml
Trace information written to /ORA19/app/oracle/diag/tnslsnr/oel8/listener/trace/ora_2742_140676369955904.trc
Trace level is currently 0
 
Started with pid=2742
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oel8)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listener completed notification to CRS on start
 
TIMESTAMP * CONNECT DATA [* PROTOCOL INFO] * EVENT [* SID] * RETURN CODE
2020-01-06T23:55:01.911943+09:00
WARNING: Subscription for node down event still pending
06-JAN-2020 23:55:01 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=oel8)(USER=oracle))(COMMAND=status)(ARGUMENTS=64)(SERVICE=LISTENER)(VERSION=318767104)) * status * 0



해결 방법 : /etc/hosts 파일 확인

이 문제의 대부분 원인은 /etc/hosts 파일의 오타나 미작성임

/etc/hosts 파일 확인

1
2
3
4
# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.169.137.50 oel8



현재 테스트 머신의 ip는 192.168.137.50 이며 hostname은 oel8임

하지만 /etc/hosts 에는 192.168.137.50이 아닌 192.169.137.50로 들어가있음



해당부분 정확하게 수정

1
2
3
4
# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.137.50 oel8



리스너 정지

1
2
3
4
5
6
7
8
$ lsnrctl stop
 
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 06-JAN-2020 23:59:37
 
Copyright (c) 19912019, Oracle.  All rights reserved.
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oel8)(PORT=1521)))
The command completed successfully



리스너 시작

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
$ lsnrctl start
 
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 06-JAN-2020 23:59:45
 
Copyright (c) 19912019, Oracle.  All rights reserved.
 
Starting /ORA19/app/oracle/product/19.0.0/db_1/bin/tnslsnr: please wait...
 
TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /ORA19/app/oracle/product/19.0.0/db_1/network/admin/listener.ora
Log messages written to /ORA19/app/oracle/diag/tnslsnr/oel8/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oel8)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oel8)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                06-JAN-2020 23:59:45
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /ORA19/app/oracle/product/19.0.0/db_1/network/admin/listener.ora
Listener Log File         /ORA19/app/oracle/diag/tnslsnr/oel8/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oel8)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully

리스너가 빠르게 올라가고 TNS 에러도 발생하지 않음



원인 : /etc/hosts 파일의 오타 문제




참조 :