Mac OSX 上的 Oracle 连接问题:“状态:失败 - 测试失败:Io 异常:网络适配器无法建立连接”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/86987/
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
Oracle connection problem on Mac OSX: "Status : Failure -Test failed: Io exception: The Network Adapter could not establish the connection"
提问by dreeves
I'm trying this with Oracle SQL Developer and am on an Intel MacBook Pro. But I believe this same error happens with other clients. I can ping the server hosting the database fine so it appears not to be an actual network problem.
我正在使用 Oracle SQL Developer 尝试此操作,并且使用的是 Intel MacBook Pro。但我相信其他客户也会发生同样的错误。我可以很好地 ping 托管数据库的服务器,因此它似乎不是实际的网络问题。
Also, I believe I'm filling in the connection info correctly. It's something like this:
另外,我相信我正确填写了连接信息。它是这样的:
host = foo1.com port = 1530 server = DEDICATED service_name = FOO type = session method = basic
采纳答案by dreeves
My problem turned out to be some kind of ACL problem. I needed to SSH tunnel in through a "blessed host". I put the following in my .ssh/config
我的问题原来是某种 ACL 问题。我需要通过“有福的主机”建立 SSH 隧道。我将以下内容放在我的 .ssh/config 中
Host=blessedhost
HostName=blessedhost.whatever.com
User=alice
Compression=yes
Protocol=2
LocalForward=2202 oraclemachine.whatever.com:1521
Host=foo
HostName=localhost
Port=2202
User=alice
Compression=yes
Protocol=2
(I don't think the second block is really necessary.) Then I change the host and port in the oracle connection info to localhost:2202.
(我不认为第二个块真的有必要。)然后我将 oracle 连接信息中的主机和端口更改为 localhost:2202。
回答by Hank Gay
That's the message you get when you don't have the right connection parameters. The SID, in particular, tends to trip up newcomers.
这就是当您没有正确的连接参数时收到的消息。特别是 SID 往往会绊倒新来者。
回答by Raimonds Simanovskis
If you want to connect to database on other host then you need to know
如果你想连接到其他主机上的数据库,那么你需要知道
- hostname
- port number (by default 1521)
- SID name
- 主机名
- 端口号(默认为 1521)
- SID 名称
if you get the connection error that you mentioned in your question then you have not specified correctly either hostname or port number. Try
如果您收到您在问题中提到的连接错误,那么您没有正确指定主机名或端口号。尝试
telnet hostname portnumber
from Terminal to verify if you can connect to portnumber (by default 1521) - if not then probably port number is incorrect.
从终端验证您是否可以连接到端口号(默认为 1521) - 如果不能,则端口号可能不正确。