IO 错误:网络适配器无法与 Oracle 11gR2 建立连接。与 SQL 开发人员联系

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24289096/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-01 02:04:16  来源:igfitidea点击:

IO Error: The Network Adapter could not establish the connection - with Oracle 11gR2. Connecting with SQL developer

sqloracleoracle11gdatabase-connectionredhat

提问by Joshua Huber

I have installed Oracle 11g ON a RedHat6 linux instance, by following all the steps mentioned in "http://technologylair.net/2013/08/oracle-11g-installation-linux/#comment-50" I am trying to connect to the database from a remote machine using the sql developer. But always ending up with - "IO Error: The Network Adapter could not establish the connection".

我已经按照“ http://technologylair.net/2013/08/oracle-11g-installation-linux/#comment-50”中提到的所有步骤在 RedHat6 linux 实例上安装了 Oracle 11g我正在尝试连接到使用 sql 开发人员从远程机器获取数据库。但总是以 - “ IO Error: The Network Adapter could not establish the connection”结尾。

The parameters i am using are

我使用的参数是

Username: sys as sysdba 
Password: <oracle password> 
Hostname: IP address of the server on which Oracle SQL is installed. 
Port: 1521 
SID: testdb

I have also created a listener.ora file at location - "/oracle/product/11.2.0/db_1/network/admin", as it was not present before. Whose contents are -

我还在“/oracle/product/11.2.0/db_1/network/admin”位置创建了一个 listener.ora 文件,因为它以前不存在。谁的内容是——

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /u01/oracle/product/11.2.0/db_1)
      (PROGRAM = extproc)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_TESTDB))
      (ADDRESS = (PROTOCOL = TCP)(HOST = 173.39.238.15)(PORT = 1521))
    )
  )

DEFAULT_SERVICE_LISTENER = (TESTDB)

I have posted this question on dba.stackexchange too. but i need to get this resolved as soon as possible. and need help. Hence posting it here too.

我也在 dba.stackexchange 上发布了这个问题。但我需要尽快解决这个问题。并需要帮助。因此也把它贴在这里。

Can you please tell me what i might be doing wrong.

你能告诉我我可能做错了什么吗?

Thanks.

谢谢。

EDITthe out put of "lsnrctl status"

编辑“lsnrctl status”的输出

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_TESTDB))) TNS-12541: TNS:no listener TNS-12560: TNS:protocol adapter error
TNS-00511: No listener Linux Error: 2: No such file or directory Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=173.39.238.15)(PORT=1521))) TNS-12541: TNS:no listener TNS-12560: TNS:protocol adapter error
TNS-00511: No listener Linux Error: 111: Connection refused

连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_TESTDB))) TNS-12541: TNS:no listener TNS-12560: TNS:protocol adapter error
TNS-00511: No listener Linux Error: 2: No such文件或目录连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=173.39.238.15)(PORT=1521))) TNS-12541: TNS:no listener TNS-12560: TNS:protocol adapter error
TNS-00511 :没有监听器 Linux 错误:111:连接被拒绝

回答by Joshua Huber

Looks like your listener is not running. On the DB server, ps -ef | grep lsnrto see if there's a PID running tnslsnr. If not, then you need to start the listener with lsnrctl start.

看起来您的侦听器没有运行。在数据库服务器上,ps -ef | grep lsnr查看是否有 PID running tnslsnr。如果没有,那么您需要使用lsnrctl start.

回答by nasowah

If you confirm from ps eaf | grep lsnrand its working, then run below probably a firewall is blocking your connection.

如果您确认ps eaf | grep lsnr其正常工作,则在下面运行可能是防火墙阻止了您的连接。

telnet hostname/IP 1521
Trying hostname/IP ...
telnet: connect to address hostname/IP: Connection refused
telnet: Unable to connect to remote host

If that is the case, then you need to get that checked.

如果是这种情况,那么您需要进行检查。

Regards,

问候,