通过socks代理连接oracle

发布于 2024-09-04 20:05:15 字数 191 浏览 2 评论 0原文

我的应用程序(linux和windows)通过OCI接口连接到oracle。是否可以通过socks代理连接oracle?或者其他类似的代理方法?简单的 ssh 隧道是不够的,因为我需要通过单个端口访问多个服务(包括 Oracle)。

编辑:我已尝试按照答案中的建议配置代理,但它不起作用。我找不到任何信息,表明oracle可以通过socks5代理工作。

My application (linux and windows) connects to oracle through OCI interface. Is it possible to connect to oracle through socks proxy? or some other similar proxy method? Simple ssh tunnel is not enough as I need to access multiple services (including oracle) through single port.

Edit: I have tried configuring the proxy as suggested in the answer, but it did not work. And I could not find anywhere information, that oracle can work through socks5 proxy.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

云裳 2024-09-11 20:05:15

我有同样的问题需要解决。无论如何,上面的解决方案不起作用。您需要告诉客户端仅使用代理进行连接初始化,但连接的目标应该是oracle数据库服务器IP和端口。其他论坛通过 tnsnames.ora 了解到没有这种可能性。但您应该能够使用连接管理器来实现这一点。还没有找到如何下载和安装它......

I got the same issue to get solved. Anyway the solution above cannot work. You need to tell the client to just USE the proxy for connection initialization, but the target to connect to is supposed to be the oracle database server IP and port. Other forums read there is no such possibility via tnsnames.ora. But you're supposed to be able to achieve that using the Connection Manager. Haven't found out yet how to even download and install it though...

森罗 2024-09-11 20:05:15

据我所知Oracle不支持socks代理。

为了解决这个问题,我做了以下操作:

  1. 安装 proxifier www.freecap.ru
  2. 从 freecap 启动 PL/SQL Developer

正如我所看到的 - 这种方法并不总是有效。
PL/SQL Developer 仅经过 3-4 次尝试才能连接到数据库。
但成功连接后 - 它似乎足够稳定,可以工作。

第二种选择 - 是使用基于 Java 的工具,例如 SQL Developer。
对于 Java,有开箱即用的 SOCKS5 系统选项。
-DsocksProxyHost=本地主机
-DsocksProxyPort=8081

java< 中有关于 SOCKS 的官方文档/a>

As I see Oracle doesn't support socks proxy.

To work around this for my self I did following:

  1. Install proxifier www.freecap.ru
  2. Start PL/SQL Developer from freecap

As I can see - this method not always work.
PL/SQL Developer was able to connect to database only on 3-4 try.
But after successful connect - it's seems stable enough for work.

Second option - is to use Java based tools like SQL Developer.
For Java there is system options for using SOCKS5 out of the box.
-DsocksProxyHost=localhost
-DsocksProxyPort=8081

there is official doc about SOCKS in java

感悟人生的甜 2024-09-11 20:05:15

是的,这是可能的。您的客户端 tnsnames.ora 文件(或 EZConnect 字符串)应将代理主机指定为数据库主机,并将代理侦听端口指定为端口。 SERVICE_NAME 或 SID 是代理另一端的 SQL*Net 侦听器所期望的任何内容。

[编辑]
如果您的代理主机正在 1522 上侦听和转发,您应该能够:

telnet proxyhost 1522

并看到:

Trying xx.xxx.xx.xxx...
Connected to proxyhost.domain.
Escape character is '^]'.

Yes, this is possible. Your client tnsnames.ora file (or EZConnect string) should specify the proxy host as the database host, and the proxy listening port as the port. The SERVICE_NAME or SID is whatever the SQL*Net listener on the other side of the proxy is expecting.

[Edit]
If your proxy host is listening and forwarding on 1522, you should be able to:

telnet proxyhost 1522

and see:

Trying xx.xxx.xx.xxx...
Connected to proxyhost.domain.
Escape character is '^]'.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文