【发布时间】:2014-02-03 12:06:38
【问题描述】:
我是 oracle dba 的新手,所以需要可以满足我的想法的帮助。我已经在 OS OEL 5.7 的虚拟机上安装了我的 oracle 11gr2 数据库,并且想用 toad32bit 连接我的这个远程数据库。所以我确实按照一些有用的链接下载并安装了 win32_11gR2_client on OS windows 7 64bit。除了尽我所能按照说明进行操作外,我的客户端无法连接到我的远程 oracle 数据库。在客户端使用 cmd 进行 tnsping sidname 始终没有出现错误的 tns 侦听器,如上所述
简要说明 LINUX机器:
listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = testhost.testdomain.com)(PORT = 1521))
)
)
ADR_BASE_LISTENER = /u01/app/oracle
tnsnames.ora
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = testhost.testdomain.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl.testdomain.com)
)
)
sqlnet.ora
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
ADR_BASE = /u01/app/oracle
lsnrctl 状态监听器
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 03-FEB-2014 15:08:43
Uptime 0 days 1 hr. 32 min. 59 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/testhost/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=testhost.testdomain.com)(PORT=1521)))
Services Summary...
Service "orcl.testdomain.com" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB.testdomain.com" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
lsnrctl 服务监听器
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
Services Summary...
Service "orcl.testdomain.com" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
Service "orclXDB.testdomain.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: testhost.testdomain.com, pid: 5349>
(ADDRESS=(PROTOCOL=tcp)(HOST=testhost.testdomain.com)(PORT=13094))
The command completed successfully
WINDOWS 7 客户端说明 C:\oracle\product\11.2.0\client_1\network\admin ENV TNS_ADMIN=C:\oracle\product\11.2.0\client_1\network\admin
注意:在 WINDOWS 服务上不存在任何与 Oracle 相关的服务(意味着不存在)
我的客户 tnsnames.ora
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = testhost.testdomain.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl.testdomain.com)
)
)
C:\Users\farhan>tnsping orcl(结果是)
Used parameter files:
C:\oracle\product\11.2.0\client_1\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDTESS_LIST = (ADDRESS - (PROTOCOL = TCP (HOST =
testhost.testdomain.com)(PORT = 1521))) (CONNECT_DATA= (SERVER = DEDICATIED) (SERVICE_NAME
= orcl) (INSCTANCE_NAME = orcl) (GLOBAL_NAME = orcl.testdomain.com)(RDB_DATABSE = orcl)) (TYPE_OF_SERVICE = dedicaated))
TNS-12541 : TNS:no listener
cat /etc/hosts(结果是)
# Do not remove the following line, or various programs
# that require network functionality will fail.
#127.0.0.1 testhost.testdomain.com testhost localhost.localdomain localhost
127.0.0.1 localhost.localdomain localhost
#10.10.1.114 testhost.testdomain.com testhost
192.168.0.103 testhost.testdomain.com testhost
::1 localhost6.localdomain6 localhost6
对于我要求发布的进一步说明
# netstat -an | grep 1521 | grep tcp | grep LISTEN
tcp 0 0 0.0.0.0:1521 0.0.0.0:* LISTEN
[root@testhost ~]# grep testhost /etc/hosts
#127.0.0.1 testhost.testdomain.com testhost localhost.localdomain localhost
#10.10.1.114 testhost.testdomain.com testhost
192.168.0.103 testhost.testdomain.com testhost
[root@testhost ~]# dig +short testhost.testdomain.com
174.137.125.92
【问题讨论】:
-
对不起,我按照您的指示编辑了我的帖子。除此之外,在 netstat 中,端口号为 1521 的预期 IP 地址未在侦听。抱歉,我对您的问题了解得不够深入
-
感谢您的回复亚历克斯。这里没有什么可以隐藏的,因为我只是一名学生并且处于学习状态。规定的主机/域名是真实的。是的,通过 ping testhost.testdomain.com 两者都可以访问。就我所说的 netstat 而言,从那里我看不到任何 linux (192.168.xx.xxxx) 机器的 ip,我认为应该在那里声明它以及端口号 1521 在 netstat cmd 接口上处于打开状态但是(这是我从那里看到结果的猜测,所以我可能是错的)。
-
您要求的上述命令返回与 ifconfig 相同的 IP。是的,VM 正在我的笔记本电脑上运行。我非常感谢亚历克斯你在这里考虑我的问题。再次感谢
-
windows 应该监听 linux ip 192.168.0.103(如前所述)。 windows ip是192.168.0.102
-
这似乎与 Oracle 或开发无关,这似乎是您的 Windows 机器与 VM 通信的问题。我建议您在 Server Fault 上询问这个问题,并从 VM/Windows 设置开始,包括您正在使用的软件和地址等。我认为不需要所有 Oracle 特定的详细信息;也许先尝试让 telnet 或 ssh 或更标准的东西工作。
标签: oracle11g oracleclient oracle-net-services