4

我的 Windows 7 机器上安装了 oracle 服务器 11g。我必须从远程机器安装此服务器。远程机器是 64 位系统,Ubuntu 12.10。为了访问服务器,我安装了 Oracle 即时客户端并配置了一切。

ORACLE_HOME、TNS_ADMIN、PATH、LD_LIBRARY_PATH 都已设置,并指向正确的位置。

我的 tnsname.ora 文件:

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ravi)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl.xxx.com)
    )
  )

我的 sqlnet.ora 文件

SQLNET.AUTHENTICATION_SERVICES= (NTS)

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

我在服务器上的 tnslistener 已启动并正在运行。

LSNRCTL> services
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
  Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0
         LOCAL SERVER
Service "orcl.xxx.com" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:221 refused:0 state:ready
         LOCAL SERVER
Service "orclXDB.xxx.com" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
    Handler(s):
      "D000" established:0 refused:0 current:0 max:1022 state:ready
         DISPATCHER <machine: ravi, pid: 4844>
         (ADDRESS=(PROTOCOL=tcp)(HOST=ravi.xxx.com)(PORT=49239))
The command completed successfully

即使设置了所有这些,我也无法连接到服务器。

当我发出sqlplus user1@orcl命令时,我得到

ravi@ubuntu:~/app/ravi/product/11.2.0/dbhome_1/bin$ sqlplus user1@orcl

SQL*Plus: Release 11.2.0.1.0 Production on Thu Apr 25 01:17:01 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Enter password: 
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified

这些帖子我都看过了

使用 bash 变量时 Sqlplus 登录错误:SP2-0306: Invalid option

oracle 即时客户端无法解析 ora-12154...

实际上还有许多其他帖子,但没有一个可以解决我的问题。

请求帮助

提前致谢

4

1 回答 1

-1

你的监听器配置不正确,我认为......

能否上传:

.- listener.ora ?

.- netstat -na|grep 1521

这是我的“服务”输出之一

LSNRCTL> 服务

连接到 (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) 服务摘要...服务“eva”有 1 个实例。实例“eva1”,状态 READY,有 1 个用于此服务的处理程序...处理程序:“DEDICATED”建立:39 拒绝:0 状态:准备好

还有我的 netstat

[oracle@laborac1 ~]$ netstat -na|grep 1521

tcp 0 0 192.168.113.152:1521 0.0.0.0:* 听

tcp 0 0 192.168.113.150:1521 0.0.0.0:* 听

于 2015-08-07T11:44:50.580 回答