2013-04-25 65 views
4

我的Windows 7機器上安裝了oracle服務器11g。我必須從遠程機器安裝此服務器。遠程機器是一個64位系統,使用Ubuntu 12.10。要訪問服務器,我安裝了Oracle即時客戶端並配置了eveything。TNS:無法解析指定的連接標識

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 [email protected]命令我得到

[email protected]:~/app/ravi/product/11.2.0/dbhome_1/bin$ sqlplus [email protected] 

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

和INFACT許多其他職位,但他們都不是解決我的問題。

請求幫忙提前

+2

如果你的tns發生了什麼ping orcl'? – ninesided 2013-04-25 09:18:35

+1

另外,這可能更適合於dba.stackexchange.com – ninesided 2013-04-25 09:19:12

+0

您說環境變量已設置,但它們是否全部導出,特別是'TNS_ADMIN'?您顯示的'tnsnames.ora'位於Ubuntu服務器上的$ TNS_ADMIN'目錄中,對嗎? (只是檢查...) – 2013-04-25 09:31:57

回答

-1

你的聽衆

由於配置不正確,我想......

你能上傳:

.-的listener.ora?

.-的netstat -na | grep的1521

這是我的 「服務」

LSNRCTL輸出之一>服務

連接到(ADDRESS =(PROTOCOL = TCP)(HOST = )(PORT = 1521)) 服務摘要... 服務「eva」有1個實例。 實例 「EVA1」,狀態READY,爲這些服務1個處理器(S)... 處理器(S): 「專用」 成立:39拒絕:0狀態:準備

而且我的netstat

甲骨文@ 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

+0

這個錯誤與監聽配置完全無關 – miracle173 2017-09-18 05:01:27