我的 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
实际上还有许多其他帖子,但没有一个可以解决我的问题。
请求帮助
提前致谢