oracle出现The Network Adapter could not establish the connection的问题

原文链接:https://blog.csdn.net/wohuozheng/article/details/80525094

如果你确定你的监听,服务,使用sql developer能登陆上,但是使用程序连接服务器时出现java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection这个问题也许就是你监听文件product\11.2.0\dbhome_1\NETWORK\ADMIN的listener.ora中的localhost没有更改,这里改成你的数据库安装电脑的名字就行了

    
    
  1. # listener.ora Network Configuration File: d:\app\fhit\product\11.2.0\dbhome_1\network\admin\listener.ora
  2. # Generated by Oracle configuration tools.
  3. SID_LIST_LISTENER =
  4. (SID_LIST =
  5. (SID_DESC =
  6. (SID_NAME = CLRExtProc)
  7. (ORACLE_HOME = d:\app\fhit\product\11.2.0\dbhome_1)
  8. (PROGRAM = extproc)
  9. (ENVS = "EXTPROC_DLLS=ONLY:d:\app\fhit\product\11.2.0\dbhome_1\bin\oraclr11.dll")
  10. )
  11. )
  12. LISTENER =
  13. (DESCRIPTION_LIST =
  14. (DESCRIPTION =
  15. (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
  16. (ADDRESS = (PROTOCOL = TCP)(HOST = localhost 我这里就是改为fhit-pc)(PORT = 1521))
  17. )
  18. )
  19. ADR_BASE_LISTENER = d:\app\fhit

我碰到的还有个问题也说说吧,也是监听了,服务了都正常的情况下使用cmd进行plsql登录一直出现ORA-12560:TNS:协议适配器错误

但是使用oracle自带的那个sqlplus可以登录的话,那么就是你的oracle环境配置出错了,进入环境变量的path你也许会发现他是这样配置的d:\app\fhit\product\11.2.0\client_1\bin;d:\app\fhit\product\11.2.0\dbhome_1\bin;这是因为你安装11g的时候也许是先安装的oracle主程序,在安装的客户端程序这并不重要了,只需要把其位置互换就可以了d:\app\fhit\product\11.2.0\dbhome_1\bin;d:\app\fhit\product\11.2.0\client_1\bin。


如果你确定你的监听,服务,使用sql developer能登陆上,但是使用程序连接服务器时出现java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection这个问题也许就是你监听文件product\11.2.0\dbhome_1\NETWORK\ADMIN的listener.ora中的localhost没有更改,这里改成你的数据库安装电脑的名字就行了

  
  
  1. # listener.ora Network Configuration File: d:\app\fhit\product\11.2.0\dbhome_1\network\admin\listener.ora
  2. # Generated by Oracle configuration tools.
  3. SID_LIST_LISTENER =
  4. (SID_LIST =
  5. (SID_DESC =
  6. (SID_NAME = CLRExtProc)
  7. (ORACLE_HOME = d:\app\fhit\product\11.2.0\dbhome_1)
  8. (PROGRAM = extproc)
  9. (ENVS = "EXTPROC_DLLS=ONLY:d:\app\fhit\product\11.2.0\dbhome_1\bin\oraclr11.dll")
  10. )
  11. )
  12. LISTENER =
  13. (DESCRIPTION_LIST =
  14. (DESCRIPTION =
  15. (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
  16. (ADDRESS = (PROTOCOL = TCP)(HOST = localhost 我这里就是改为fhit-pc)(PORT = 1521))
  17. )
  18. )
  19. ADR_BASE_LISTENER = d:\app\fhit

我碰到的还有个问题也说说吧,也是监听了,服务了都正常的情况下使用cmd进行plsql登录一直出现ORA-12560:TNS:协议适配器错误

但是使用oracle自带的那个sqlplus可以登录的话,那么就是你的oracle环境配置出错了,进入环境变量的path你也许会发现他是这样配置的d:\app\fhit\product\11.2.0\client_1\bin;d:\app\fhit\product\11.2.0\dbhome_1\bin;这是因为你安装11g的时候也许是先安装的oracle主程序,在安装的客户端程序这并不重要了,只需要把其位置互换就可以了d:\app\fhit\product\11.2.0\dbhome_1\bin;d:\app\fhit\product\11.2.0\client_1\bin。


猜你喜欢

转载自blog.csdn.net/a2940093904/article/details/88866617