tnsname之双IP failover问题

如果是dataguard,经常在应用端配置双IP,以便在数据库切换时,应用端不用作任何的改变。但在ORACLE 9i里,这种方式配置的tnsname,存在着如下的问题。当需要对第一个IP进行停机维护时,即第一个IP不存在时,需要很长一段时间客户端才能failover到第二个IP上,创建新的连接.这个问题,也曾经导致过一次生产库事故。

在oracle 9i里,进行如下的测试:
引用:
db_tns =
  (DESCRIPTION =
     (failover = on )
     (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.168.100)(PORT = 1521)) --第一个IP不存在
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.168.120)(PORT = 1521)) --这个IP此时是主库
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SID = test)
    )
  )


db_stb:/u01/oracle/product/9.2/network/admin>$tnsping db_tns

TNS Ping Utility for IBM/AIX RISC System/6000: Version 9.2.0.6.0 - Production on 04-AUG-2008 13:59:02

Copyright (c) 1997 Oracle Corporation.  All rights reserved.

Used parameter files:
/u01/oracle/product/9.2/network/admin/sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (failover = on) (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.168.100)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.168.120)(PORT = 1521))) (CONNECT_DATA = (SERVER = DEDICATED) (SID = test)))
OK (76380 msec)  --这里总共花了76秒钟