[oracle@oracle ~]$ lsnrctl status
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 14-AUG-2022 10:56:00
Copyright (c)1991, 2019, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.125)(PORT=1521)))
TNS-12543: TNS:destination host unreachable
TNS-12560: TNS:protocol adapter error
TNS-00513: Destination host unreachable
Linux Error: 113: No route to host#无法监听oracle数据库
解决方案
1、修改hosts
echo"当前IP地址 oracle.com">> /etc/hosts
2、修改oracle 服务器地址
[oracle@oracle ~]$ netmgr #netmgr配置监听
将oracle服务器地址和监听地址,修改成你当前的地址段
点击保存
[oracle@oracle ~]$ lsnrctl status
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 14-AUG-2022 11:08:40
Copyright (c)1991, 2019, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.2.125)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 14-AUG-2022 10:27:23
Uptime 0 days 0 hr. 41 min. 17 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/ora19c/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.2.125)(PORT=1521)))
The listener supports no services
The command completed successfully
#oracle监听启动成功
如遇以下问题,可以尝试检查oracle监听是否启动
[oracle@oracle ~]$ lsnrctl status
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 14-AUG-2022 10:25:32
Copyright (c)1991, 2019, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.2.125)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
[oracle@oracle ~]$ ps -ef |grep tns
root 3520 09:50 ? 00:00:00 [netns]
oracle 56572989010:27 pts/1 00:00:00 grep --color=auto tns
[oracle@oracle ~]$ lsnrctl start **#重启oracle监听即可**
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 14-AUG-2022 10:27:23
Copyright (c)1991, 2019, Oracle. All rights reserved.
Starting /u01/app/oracle/product/ora19c/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /u01/app/oracle/product/ora19c/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.2.125)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.2.125)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 14-AUG-2022 10:27:23
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/ora19c/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.2.125)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@oracle ~]$ lsnrctl status
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 14-AUG-2022 11:14:04
Copyright (c)1991, 2019, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.2.125)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date 14-AUG-2022 10:27:23
Uptime 0 days 0 hr. 46 min. 41 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/ora19c/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/oracle/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.2.125)(PORT=1521)))
The listener supports no services
The command completed successfully