重庆思庄Oracle、Redhat认证学习论坛

标题: TNS-12542: TNS:address already in use [打印本页]

作者: 郑全    时间: 2021-11-3 09:44
标题: TNS-12542: TNS:address already in use
早上起来,用户说数据库连不上,发现U01磁盘空间慢了,处理后,发现还是连接不上,

如下
ora.LISTENER.lsnr
               ONLINE  INTERMEDIATE ythpt01                  Not All Endpoints Re
                                                             gistered,STABLE
               ONLINE  INTERMEDIATE ythpt02                  Not All Endpoints Re
                                                             gistered,STABLE


ora.LISTENER_SCAN1.lsnr
      1        ONLINE  INTERMEDIATE ythpt01                  Not All Endpoints Re
                                                             gistered,STABLE


[grid@ythpt01 ~]$ lsnrctl status LISTENER_SCAN1

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 03-NOV-2021 09:16:24

Copyright (c) 1991, 2020, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_SCAN1
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                03-NOV-2021 08:45:47
Uptime                    0 days 0 hr. 30 min. 36 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/19.0.0.0/grid/network/admin/listener.ora
Listener Log File         /u01/app/grid/diag/tnslsnr/ythpt01/listener_scan1/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_SCAN1)))
The listener supports no services
The command completed successfully


看监听日志:

Error listening on: (ADDRESS=(PROTOCOL=TCP)(RATE_LIMIT=YES)(HOST=203.1.1.51)(PORT=1521)(IP=FIRST))
Error listening on: (ADDRESS=(PROTOCOL=TCP)(RATE_LIMIT=YES)(HOST=203.1.1.53)(PORT=1521))
03-NOV-2021 09:08:03 * (ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)) * service_register * LsnrAgt * 12542
TNS-12542: TNS:address already in use
TNS-12560: TNS:protocol adapter error
  TNS-00512: Address already in use
   Linux Error: 98: Address already in use
    TNS-12542: TNS:address already in use
     TNS-12560: TNS:protocol adapter error
      TNS-00512: Address already in use
       Linux Error: 98: Address already in use


[oracle@ythpt01 ~]$ ps -ef|grep tns
root       425     2  0 08:41 ?        00:00:00 [netns]
oracle    1027 76460  0 09:25 pts/0    00:00:00 grep --color=auto tns
oracle   19015     1  0 08:44 ?        00:00:00 /u01/app/oracle/product/19.0.0.0/dbhome_1/bin/tnslsnr LISTENER -inherit
grid     23485     1  0 08:45 ?        00:00:00 /u01/app/19.0.0.0/grid/bin/tnslsnr ASMNET1LSNR_ASM -no_crs_notify -inherit
grid     24189     1  0 08:45 ?        00:00:00 /u01/app/19.0.0.0/grid/bin/tnslsnr LISTENER_SCAN1 -no_crs_notify -inherit
grid     34130     1  0 09:13 ?        00:00:00 /u01/app/19.0.0.0/grid/bin/tnslsnr LISTENER -no_crs_notify -inherit


杀掉oracle_home监听后,监听日志中正常了。

kill -9 19015

[root@ythpt01 ~]# ps -ef|grep tns
root       425     2  0 08:41 ?        00:00:00 [netns]
root      3143 12854  0 09:25 pts/0    00:00:00 grep --color=auto tns
grid     23485     1  0 08:45 ?        00:00:00 /u01/app/19.0.0.0/grid/bin/tnslsnr ASMNET1LSNR_ASM -no_crs_notify -inherit
grid     24189     1  0 08:45 ?        00:00:00 /u01/app/19.0.0.0/grid/bin/tnslsnr LISTENER_SCAN1 -no_crs_notify -inherit
grid     34130     1  0 09:13 ?        00:00:00 /u01/app/19.0.0.0/grid/bin/tnslsnr LISTENER -no_crs_notify -inherit


[oracle@ythpt01 ~]$ lsnrctl status

LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 03-NOV-2021 09:29:18

Copyright (c) 1991, 2020, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                03-NOV-2021 09:13:08
Uptime                    0 days 0 hr. 16 min. 10 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/19.0.0.0/grid/network/admin/listener.ora
Listener Log File         /u01/app/grid/diag/tnslsnr/ythpt01/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=203.1.1.50)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=203.1.1.52)(PORT=1521)))
Services Summary...
Service "+APX" has 1 instance(s).
  Instance "+APX1", status READY, has 1 handler(s) for this service...
Service "+ASM" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "+ASM_DATA" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "+ASM_RECO" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...

Service "ythptdb" has 1 instance(s).
  Instance "ythptdb1", status READY, has 1 handler(s) for this service...
Service "ythptdbXDB" has 1 instance(s).
  Instance "ythptdb1", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@ythpt01 ~]$



就是有人把数据库路径的监听给打开了导致。







欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2