连接Oracle数据库报错:
IO Error: The Network Adapter could not establish the connection
The Network Adapter could not establish the connection
The Network Adapter could not establish the connection
Connection refused: connect, socket connect lapse 1003 ms. /192.168.1.104 1521 0 1 true
Connection refused: connect, socket connect lapse 1003 ms. /192.168.1.104 1521 0 1 true
Connection refused: connect
Connection refused: connect
在cmd输入lsnrctl查看监听
C:\Windows\System32>lsnrctl
LSNRCTL for 64-bit Windows: Version 12.2.0.1.0 - Production on 04-11月-2019 13:56:32
Copyright (c) 1991, 2016, Oracle. All rights reserved.
欢迎来到LSNRCTL, 请键入"help"以获得信息。
LSNRCTL> status
正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DESKTOP-210GC98)(PORT=1521)))
TNS-12541: TNS: 无监听程序
TNS-12560: TNS: 协议适配器错误
TNS-00511: 无监听程序
64-bit Windows Error: 61: Unknown error
正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
TNS-12541: TNS: 无监听程序
TNS-12560: TNS: 协议适配器错误
TNS-00511: 无监听程序
64-bit Windows Error: 61: Unknown error
正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.104)(PORT=1521)))
TNS-12541: TNS: 无监听程序
TNS-12560: TNS: 协议适配器错误
TNS-00511: 无监听程序
64-bit Windows Error: 61: Unknown error
LSNRCTL> start
启动tnslsnr: 请稍候...
TNSLSNR for 64-bit Windows: Version 12.2.0.1.0 - Production
系统参数文件为F:\app\Administrator\virtual\product\12.2.0\dbhome_1\network\admin\listener.ora
写入F:\app\Administrator\virtual\product\12.2.0\dbhome_1\log\diag\tnslsnr\DESKTOP-210GC98\listener\alert\log.xml的日志信息
监听: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=DESKTOP-210GC98)(PORT=1521)))
监听: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
监听: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.104)(PORT=1521)))
正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DESKTOP-210GC98)(PORT=1521)))
LISTENER 的 STATUS
------------------------
别名 LISTENER
版本 TNSLSNR for 64-bit Windows: Version 12.2.0.1.0 - Production
启动日期 04-11月-2019 13:56:50
正常运行时间 0 天 0 小时 0 分 4 秒
跟踪级别 off
安全性 ON: Local OS Authentication
SNMP OFF
监听程序参数文件 F:\app\Administrator\virtual\product\12.2.0\dbhome_1\network\admin\listener.ora
监听程序日志文件 F:\app\Administrator\virtual\product\12.2.0\dbhome_1\log\diag\tnslsnr\DESKTOP-210GC98\listener\alert\log.xml
监听端点概要...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=DESKTOP-210GC98)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.104)(PORT=1521)))
服务摘要..
服务 "CLRExtProc" 包含 1 个实例。
实例 "CLRExtProc", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
服务 "ORCL" 包含 1 个实例。
实例 "ORCL", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
命令执行成功
LSNRCTL>
1、 查看tnsnames.ora和listener.ora里的IP是否是对的
2、修改后启动需要等一分钟
3、确保所有环境路径的正确性