我的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许多其他职位,但他们都不是解决我的问题。
请求帮忙提前
如果你的tns发生了什么ping orcl'? – ninesided 2013-04-25 09:18:35
另外,这可能更适合于dba.stackexchange.com – ninesided 2013-04-25 09:19:12
您说环境变量已设置,但它们是否全部导出,特别是'TNS_ADMIN'?您显示的'tnsnames.ora'位于Ubuntu服务器上的$ TNS_ADMIN'目录中,对吗? (只是检查...) – 2013-04-25 09:31:57