使用 Oracle Client 连接到远程 Oracle 数据库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11977965/
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
Connecting to remote Oracle database using Oracle Client
提问by Kunal Uppal
I have to connect to a remote Oracle database. Connection will only work with a VPN access to the remote network. I have already setup the VPN, and that is working.
我必须连接到远程 Oracle 数据库。连接仅适用于对远程网络的 VPN 访问。我已经设置了 VPN,并且正在运行。
Remote team has passed TNS.ORA settings. I have hardly worked on configuring oracle and neither I am aware of the setup that I need to have on my machine. I just need to run few queries to test the data.
远程团队已通过 TNS.ORA 设置。我几乎没有配置过 oracle,我也不知道我的机器上需要进行哪些设置。我只需要运行几个查询来测试数据。
Can somebody guide me on the setup and the configuration I need to have on my windows 7 to connect to a remote Oracle database ?.
有人可以指导我进行 Windows 7 连接到远程 Oracle 数据库所需的设置和配置吗?
My first assumption was to download Oracle client. I downloaded Oracle Insta Client files, but I have no idea how to configure it to connect to a remote database. I couldn't even find any ORA file in the installed files of Insta client.
我的第一个假设是下载 Oracle 客户端。我下载了 Oracle Insta 客户端文件,但我不知道如何配置它以连接到远程数据库。我什至在 Insta 客户端的安装文件中找不到任何 ORA 文件。
采纳答案by steve
One you installed the instant client and installed it, you can conect to the remote database by using an easyconnect string. If you are in sqlplus you can do the following:
您安装了即时客户端并安装了它,您可以使用easyconnect 字符串连接到远程数据库。如果您在 sqlplus 中,您可以执行以下操作:
CONNECT username@[//]host[:port][/service_name][:server][/instance_name]
连接用户名@[//]host[:port][/service_name][:server][/instance_name]
Lets assume your remote host is remote1 and the service_name is test (This can be retrieved from the tnsnames.ora)
让我们假设您的远程主机是 remote1 并且 service_name 是 test (这可以从 tnsnames.ora 中检索)
connect username@//remote1/test
连接用户名@//remote1/test