问题说明

今天在centos7虚拟机中运行java程序,程序启动需要连接主机的oracle,报错:
The Network Adapter could not establish the connection
errorCode 17002, state 08006

意思就是网络问题无法连接!

问题排查

虚拟机中用telnet测试了一下主机的1521端口不通。

然后查看listener.ora的配置发现HOST配的是localhost

listener.ora的host不能是localhost,而应该是计算机名,否则不能用ip地址进行连接。
因为主机名基于NetBios和DNS协议,当监听配置文件里填的不是IP地址时,会尝试用NetBios或DNS进行解析以得到对应的IP。
所以填了localhost就只能是本地应用可以连接了!

问题解决

将listener.ora中的HOST改为计算机名,例如我的:

然后重启监听程序:

lsnrctl stop
lsnrctl start

虚拟机再去telnet发现通了!

The Network Adapter could not establish the connection errorCode 17002, state 08006的更多相关文章

  1. The Network Adapter could not establish the connection问题研究

    最近一个项目会报上述错误,但也不是经常发生,所以很难跟踪,影响不是很大,但每次看到日志中这个错误就会不舒服,还是要想办法解决才是. 错误提示信息很明确是网络适配器不能创建连接. 查了很多资料,并且Or ...

  2. Io 异常: The Network Adapter could not establish the connection 解决方法

    1.IP错误: 在设置URL时错误,例如:jdbc:oracle:thin:@192.168.1.80:1521:orcl 数据库服务器是否正确:ping 服务器IP是否通畅.ping不通则将URL更 ...

  3. 数据库连接报错之IO异常(The Network Adapter could not establish the connection)

    Io 异常: The Network Adapter could not establish the connection 有以下四个原因: 1.oracle配置 listener.ora 和tnsn ...

  4. Io 异常: The Network Adapter could not establish the connection

    新接触一个项目,导入源码,在本地启动的时候后台报了一个错误: Could not discover the dialect to use. java.sql.SQLException: Io 异常: ...

  5. IO 异常:The Network Adapter could not establish the connection 怎么解决

    IO 异常:The Network Adapter could not establish the connection 怎么解决

  6. weblogic报错----Received exception while creating connection for pool "TDMSKD": The Network Adapter could not establish the connection

    <2017-8-16 上午08时58分37秒 CST> <Info> <WebLogicServer> <BEA-000377> <Startin ...

  7. Oracle安装后遇到错误:The Network Adapter could not establish the connection

    http://note.youdao.com/noteshare?id=e6baee7ea7b7f60d7a265124e2bdd46c&sub=988945C6DDE843D5A7D6588 ...

  8. sqldeveloper建立新的连接是出现Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection

    Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection解决办法: ...

  9. Io 异常: The Network Adapter could not establish the connection解决方案

    Io 异常: The Network Adapter could not establish the connection解决方案 2016年06月04日 13:30:21 阅读数:46589 Io ...

  10. sql developer链接不上oracle 报 The Network Adapter could not establish the connection

    安装时候报 : Oracle 支持在具有 DHCP 分配的公共 IP 地址的系统上进行安装.但应使用静态 IP 地址来配置系统的主网络接口, 以便 Oracle 软件正常工作.有关在配置有 DHCP ...

随机推荐

  1. Go-类型推导

  2. [转帖]elasticsearch 8.0 linux安装部署

    1. 下载安装包 https://www.elastic.co/cn/downloads/elasticsearch 选择下载linux版本,elasticsearch-8.0.0-linux-x86 ...

  3. [转帖]《Linux性能优化实战》笔记(20)—— 使用 tcpdump 和 Wireshark 分析网络流量

    tcpdump 和 Wireshark 是最常用的网络抓包和分析工具,更是分析网络性能必不可少的利器. tcpdump 仅支持命令行格式使用,常用在服务器中抓取和分析网络包.Wireshark 除了可 ...

  4. [转帖]《Linux性能优化实战》笔记(21)—— 网络性能优化思路

    一. 确定优化目标 优化前,我会先问问自己,网络性能优化的目标是什么?实际上,虽然网络性能优化的整体目标,是降低网络延迟(如 RTT)和提高吞吐量(如BPS 和 PPS),但具体到不同应用中,每个指标 ...

  5. [转帖]以 PostgreSql 为例,说明生产级别数据库安装要考虑哪些问题?

    https://xie.infoq.cn/article/487b467b952683e6dd27d9061 我让公司的小伙伴写一个生产级别的 PostgreSQL 的安装文档,结果他和我说:&quo ...

  6. [转帖]wmic命令介绍

    https://www.jianshu.com/p/3e1a5a8fa23b How to Get Your System Serial Number PS C:\windows\system32&g ...

  7. [转帖]关于Linux操作系统中LUN的队列深度(queue_depth)

    Linux中的queue_depth(队列深度),可以用lsscsi查看. 不过今天在我的vm 虚拟机环境中(无外界存储),是没有lsscsi命令. 不过,从网上,搜到了如下的信息: $ lsscsi ...

  8. Oracle数据库无法启动的简单处理

    1. 最近一台测试机器上面的Oracle数据库启动不起来了. 提示信息是UNDOTBS2的表空间找不到. 2. 然后可以使用 startup mount 简单开起来 但是发现还是无法使用. 3.本来想 ...

  9. Redis Cluster in K3S

    Redis Cluster in K3S 学习资料 https://www.cnblogs.com/cheyunhua/p/15619317.html https://blog.csdn.net/cq ...

  10. 感受 Vue3 的魔法力量

    ​ 作者:京东科技 牛至伟 近半年有幸参与了一个创新项目,由于没有任何历史包袱,所以选择了Vue3技术栈,总体来说感受如下: • setup语法糖<script setup lang=" ...