问题说明

今天在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. [转帖]Linux cut命令

    https://www.runoob.com/linux/linux-comm-cut.html#:~:text=Linux%20cut%E5%91%BD%E4%BB%A4%201%20-b%20%E ...

  2. [转帖]Linux常用的一些命令,看你知道多少?

    https://zhuanlan.zhihu.com/p/115279009 Linux中命令有很多,而Linux系统中使用命令也是它的一大特点.在Linux系统中使用命令处理问题灵活,高效,所以熟知 ...

  3. [转帖]模拟enq: TX - row lock contention争用

    https://www.modb.pro/db/623036 enq: TX - row lock contention它表示一个事务正在等待另一个事务释放被锁定的行.这种等待事件通常发生在并发访问数 ...

  4. [转帖]CPU计算性能speccpu2006的测试方法及工具下载

    https://www.yii666.com/blog/335517.html CPU计算性能speccpu2006的测试方法及工具下载 简介 测试原理 目录结构 测试方法 基准测试项解析 测试结果 ...

  5. [转贴]使用dbstart 和dbshut 脚本来自动化启动和关闭数据库

    使用dbstart 和dbshut 脚本来自动化启动和关闭数据库 https://www.cnblogs.com/snowers/p/3285281.htmldbshut 和 dbstart 使用db ...

  6. SQLSERVER 标准版与企业版的版本标识区别

    1.  windows 标准版  sqlserver 标准版 2. Windows 数据中心版 sqlserver 企业版 3. Win10 之后 服务器版本缩减的很厉害 只有两个版本了 如图示 4. ...

  7. vite按需加载element-plus,减少项目体积,你必须学会

    1.在项目中安装 $ npm install element-plus --save $ yarn add element-plus $ pnpm install element-plus 2.安装对 ...

  8. .netcore项目发布到IIS全流程

    一.环境准备 保证电脑上有.net core runtime下载地址:https://dotnet.microsoft.com/download/dotnet-core/current/runtime ...

  9. gRPC基本教程

    原文在这里. 本教程为Go程序员提供了使用gRPC的基本介绍. 通过跟随本示例,你将学会如何: 在.proto文件中定义一个服务. 使用协议缓冲编译器生成服务器和客户端代码. 使用Go gRPC AP ...

  10. 使用C#做为游戏开发的服务器语言方案

    Scut开源服务器 开源C#/Python/Lua 手游服务器 主页:http://www.scutgame.com/index.html 开源:https://github.com/ScutGame ...