不使用 TNS 监听器连接到 Oracle 数据库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4358661/
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
Connect to Oracle database without using TNS Listener
提问by Ricardo Cardona Ramirez
Just out of curiosity, a few days ago we had a discussion about whether there is a way to connect to the DB without using TNS Listener, the connection must be made by any program SQLPlus. Net, ODBC, and so on.
只是出于好奇,前几天我们讨论了有没有不使用TNS Listener连接DB的方法,连接必须是任何程序SQLPlus。Net、ODBC 等。
采纳答案by Gary Myers
Basically only local connections can avoid the listener(ie you have to be already logged on to the machine that the database instance is running on).
基本上只有本地连接可以避免监听器(即您必须已经登录到运行数据库实例的机器)。
Rather than relying on a listener to fork out a process to act on behalf of the connection, this is done by the local process. Generally it means that the local user needs to be run as 'oracle' as well. Sort of equivalent to a console logic.
这不是依靠侦听器来派生出代表连接的进程,而是由本地进程完成的。通常这意味着本地用户也需要以“oracle”身份运行。有点相当于控制台逻辑。
回答by DCookie
It appears there isn't one magic bullet, but there are several ways.
似乎没有一种灵丹妙药,但有几种方法。
For ODBC, have a look at this SO question.
对于 ODBC,请查看这个 SO 问题。
There's a lot of good info at Connectionstrings.com/oracleas well.
Connectionstrings.com/oracle上也有很多很好的信息。
回答by George P. Milliken
You connect to Oracle via a client, such as sqplplus, or a java program (or tool) utilizing a protocol such as SQL*NET or JDBC (as examples) through the listener. The listener in turn forks a process on the target database (or assigns the connection to an existing process if you use shared servers).
您可以通过客户端(例如 sqplplus)或使用 SQL*NET 或 JDBC(作为示例)等协议的 Java 程序(或工具)通过侦听器连接到 Oracle。侦听器反过来在目标数据库上派生一个进程(或者,如果您使用共享服务器,则将连接分配给现有进程)。