TAF(Transparent Application Failover)
RAC的TAF是指会话连接到一个实例上,如果这个实例出现了故障,Oracle会自动将会话迁移到另一个实例上。
以下为例:
(SERVICE_NAME = RACDB)
(FAILOVER_MODE =
(TYPE = SELECT)
(METHOD = BASIC)
(RETRIES = 180)
(DELAY = 5)
当FAILOVER_MODE类型为SELECT,METHOD = BASIC时可以实现查询语句不间断的返回结果.
当FAILOVER_MODE类型为SESSION,METHOD = BASIC时,可能会遇到的异常:
ORA-25408: can not safely replay call
ORA-25401: can not continue fetches
或许还有其它的错误。
这应该进行足够的测试,以应对TAF的不同Failover,以对特殊错误进行处理。
METHOD
BASIC 当感知到节点故障后,才创建到其它实例的连接。
PRECONNECT 在最初建立连接时就同时建立到所有实例的连接,当发生故障时就可以立刻切换到其它实例上。
basic: Set to establish connections at failover time. This option requires almost no work on the backup server until failover time.
preconnect: Set to pre-established connections. This provides faster failover but requires that the backup instance be able to support all connections from every supported instance.
TYPE
session: Set to failover the session. If a user's connection is lost, a new session is automatically created for the user on the backup. This type of failover does not attempt to recover selects.
select: Set to enable users with open cursors to continue fetching on them after failure. However, this mode involves overhead on the client side in normal select operations.
none: This is the default. No failover functionality is used. This can also be explicitly specified to prevent failover from happening.
不管是select还是session,当发生实例故障时,未提交的事务都会自动回滚。
可以使用dbca生成service,也可以使用srvctl来生成service,使用srvctl时要使用dbms_service.modify_service更新数据字典,添加tns条目。
rac TAF理解
最新推荐文章于 2025-02-08 13:50:56 发布
本文详细介绍了Oracle RAC环境中TAF(Transparent Application Failover)的工作原理及配置方法。当一个实例出现故障时,TAF能确保会话自动迁移至其他健康实例,从而保障业务连续性。文中还对比了不同配置选项如BASIC与PRECONNECT的区别,并阐述了SESSION与SELECT模式下故障转移的行为差异。

1139

被折叠的 条评论
为什么被折叠?



