连接Oracle数据库报错:The Network Adapter could not establish the connection

连接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、确保所有环境路径的正确性

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值