Jdbc thin not suppot Rac TAF

本文介绍了 Oracle JDBC Thin 驱动不支持 TAF (透明应用程序故障转移),而支持 FCF (快速连接故障转移) 的配置方法。详细解释了 TAF 和 FCF 的工作原理,并提供了具体的连接字符串示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/13750068/viewspace-1143118/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值