Jdbc thin not suppot Rac TAF

yyp2009發表於2014-04-16
The Oracle JDBC thin driver does not
support TAF
. TAF is only supported by the
JDBC OCI driver

Transparent Application Failover (TAF) is a feature of the Java Database
Connectivity (JDBC) Oracle Call Interface (OCI) driver. It enables the
application to automatically reconnect to a database, if the database instance
to which the connection is made fails. In this case, the active transactions
roll back.

When an instance to which a connection is established fails or is shutdown,
the connection on the client side becomes stale and would throw exceptions to
the caller trying to use it. TAF enables the application to transparently
reconnect to a preconfigured secondary instance creating a fresh connection, but
identical to the connection that was established on the first original instance.
That is, the connection properties are the same as that of the earlier
connection. This is true regardless of how the connection was lost.

大概意思就是說jdbc thin連線rac時,不支援rac failover 的TAF;只有 jdbc OCI支援rac failover
的TAF;如果是jdbc thin連線rac時建議FCF:

FCF 配置demo如下:

jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS_LIST = (ADDRESS = (PROTOCOL =
TCP)(HOST = rac1vip)(PORT = 1525)) (ADDRESS = (PROTOCOL = TCP)(HOST =
rac2vip)(PORT = 1525)) (LOAD_BALANCE =
on)
) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ractest)
(FAILOVER_MODE = (TYPE = SELECT) (METHOD = BASIC) (RETRIES = 2) (DELAY =
1))))

 JDBC Thin cannot use FAILOVER_MODE. The
failover defined by FAILOVER_MODE is Transparent Application Failover (TAF).
JDBC Thin does not support TAF.
However JDBC Thin does support Fast
Connection Failover (FCF).

大概意思仍然說JDBC Thin不支援rac TAF failover
mode;而是支援fcf,

網友lunar:
failover預設就是yes,不帶mode的一堆就是FCF,帶了就是TAF,因此你的改為下面的,用FCF就行了吧:
jdbc:oracle:thin:(
  DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 100.86.000.00*)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 100.10.000.00*)(PORT = 1521))
    (LOAD_BALANCE = yes)
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = rac_taf)
    )
  )

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/13750068/viewspace-1143118/,如需轉載,請註明出處,否則將追究法律責任。

相關文章