rac TAF理解

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条目。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值