TNS:无法解析指定的连接标识符

时间:2013-04-25 08:19:56

标签: oracle oracle11g oracleclient ora-12154

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

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

我看过所有这些帖子,

Sqlplus login error when using bash variables: SP2-0306: Invalid option

ora-12154 could not resolve... with oracle instant client

以及其他很多其他帖子,但没有一个是解决我的问题。

请求帮助

先谢谢

1 个答案:

答案 0 :(得分:-1)

您的听众配置不正确,我认为......

你能上传:

.- listener.ora?

.- netstat -na | grep 1521

这是我的&#34;服务&#34;

的输出之一

LSNRCTL&GT;服务

连接到(ADDRESS =(PROTOCOL = tcp)(HOST =)(PORT = 1521)) 服务摘要...... 服务&#34; eva&#34;有1个实例。   实例&#34; eva1&#34;,状态READY,有1个此服务的处理程序...     处理器(S):       &#34; DEDICATED&#34;成立:39拒绝:0状态:准备好

我的netstat

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

tcp 0 0 192.168.113.152:1521 0.0.0.0:* LISTEN

tcp 0 0 192.168.113.150:1521 0.0.0.0:* LISTEN