医院系统要求能够远程修改数据,需要把数据库服务器在外面能够访问。由于医院网络的原因,采用了一个DP-Link的路由器将数据库服务器连接到网络中心的网络上。网络接通后出现以下的症状:

  • ping测试正常
  • tnsping测试正常
  • 用sql plus,oem,pl/sql都连接不上去,报ora-12535:tns操作超时。

经多方查证和网上参考资料,终于找到了问题的原因。Oracle的Metalink上提供了该问题的详细资料,以下是Oracle MetaLink上提供的原始资料:

1
2
3
4
5
**PURPOSE**
To explain how firewalls work when a Windows NT server is involved.   
RELATED DOCUMENTS  Note 45226.1  SQL*Net and Firewalls      Firewalls, Windows NT, and Redirections: 

On Windows NT, when a connect request comes in to the listener, the listener   spawns an Oracle thread. This thread is a listening thread and is started   on a wild-card address, meaning that the thread is listening for connections   on the current IP address and an unused port number given to the thread by   the networking software. The Oracle thread will contact the listener using   IPC and inform the listener of its listening address, connection load, and   some other status information. The listener sends back to the client a   REDIRECT address. This tells the client to reconnect to the newly spawned   Oracle thread. Since this Oracle thread is on a random port (a range of ports   cannot be defined), the firewall will not let the connection through.    The resulting error is usually a TNS-12203. There are two ways to resolve this issue: