如果Oracle资料库和client端连线有经过firewall,在MTS模式下连线的设定可能需要特别注意,因为就算你防火墙开通了1521 port,但是在MTS下listener会把连线要求redirect给dispatcher,而dispatcher的port又是random port,这时候你可以选择client端改用Dedicated 连线,或者修改dispatcher设定来达成正常连结,而不会出现ORA-12535: TNS:operation timed out。
1)client端改用Dedicated mode
DD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.1)(PORT = 1521))
)
(CONNECT_DATA =
(SID = DD)
(SERVER = DEDICATED)
)
)
2)修改dispatcher固定使用port number
# vi initSID.ora
*.dispatchers="(address=(protocol=tcp)(port=5000))(dispatchers=3)"
# restart instance
# SQL> select name,network from v$dispatcher
NAME NETWORK
---- --------------------------------------------------
D000 (ADDRESS=(PROTOCOL=tcp)(HOST=ora1)(PORT=5000))
D001 (address=(protocol=tcp)(port=5000))
D002 (address=(protocol=tcp)(port=5000))
# netstat -al |grep 5000
tcp 0 0 *:5000 *:* LISTEN
# 开放firewall 5000 port number