0

我花了 3 天时间试图弄清楚为什么我无法从客户端计算机连接到我的 Oracle 12 数据库。我已经阅读了很多文章和谷歌搜索,但还没有找到解决方案。我已经尝试了一切可能并且已经知道了。所以我希望有人能指出我正确的方向。

以下是一些细节:

  1. 安装了 Oracle 12c 的 Win7 x64。
  2. Windows Server 2012 R2(客户端,是的,这个设置并不理想。稍后会解释原因)。
  3. Windows Server 2012 R2(域控制器)
  4. 所有机器都是虚拟机并且是域的一部分。
  5. 所有虚拟机都在 ESXI 6.0 下运行

我可以毫无问题地执行以下操作:

  1. 登录到 oracle 服务器。

    ORCL 是我的 oracle 实例(全局数据库标识符)。

    6.1 运行tnsping orcl

    6.2 lsnrctl 状态(启动并运行)

    6.3 从Windows Services 管理单元停止并重新启动listner 服务。

    6.4 sqlplus 系统/xyz@orcl

     Connects w/o any problems.
    

    6.5 Oracle SQL Developer可以连接ORCL

    6.6可以ping客户端机器。

但是我不能执行以下操作:

  1. 登录到客户端机器

    7.1 将 tnsnames.ora 从 oracle 服务器复制到此客户端计算机并放置在应位于的 [ORACLE_HOME]\network\admin 下。将“localhost”替换为 oracle sserver IP。

    7.2 使用sqlplus system/xyz@orcl 或Oracle SQL Developer 连接

     I get TNS: no listener found.
    

    7.3 可以ping通oracle服务器。

    7.4 tnsping orcl(失败)

    7.4 已经禁用了 oracle 服务器上的所有防火墙(域、私有和公共)。防火墙或端口不应该有任何问题。

无论我做什么,我都无法从客户端机器连接。有人可以告诉我我做错了什么吗?附带说明一下,我无法在 Win2012R2 上安装 Oracle 12c。所以我安装在Win7x64上。但最终所有虚拟机都将在 Windows Server 2012R2 上运行。这个设置是我的家庭实验室。

谢谢!

4

1 回答 1

0

replaced "localhost" with the oracle sserver IP

It looks like the listener is only listening on localhost (127.0.0.1); you can confirm that with lsnrctl status, or with netstat -an | find "1521" (or your actual port number if you aren't using the default).

It isn't listening on the server's external IP address, so when you try to connect to post 1521 (or whatever you have configured) on that IP there is nothing there listening - which is why you get "no listener found".

You need to modify your listener.ora to either listen to both localhost and the server IP address, or to only listen to the external address. But the latter has side-effects - your existing connections and tnsnames.ora entries would need to change to refer to that address (or, even if it is static, a DNS name that resolves to that address), and your database may need to be modified so it knows the listener address to register against, via the LOCAL_LISTENER initialisation parameter. After changing the listener.ora you will need to bounce the listener, and you can then check netstat again.

于 2016-06-03T13:29:39.410 回答