How to add a DELAY in applying transactions in GoldenGate?

有时候生产库可能出现错误操作,那么我们使用Goldengate同步过来的数据也将是错误的,如果目标库不要求实时性,那么我们可以使用延迟参数使目标库延迟应用。这样我们就可以保护错误操作之前的数据




APPLIES TO:

Oracle GoldenGate - Version 10.4.0.0 and later
Information in this document applies to any platform.

GOAL

How to add a DELAY in the application of transactions when using Oracle GoldenGate?
 

SOLUTION

The following are the options available for delaying the application of transactions on the target.

 
Option 1: ( Recommended )


You could use the DEFERAPPLYINTERVAL parameter to to set an amount of time that Replicat waits before applying captured transactions to the target database.

Default 0 (no delay)


Syntax [DEFERAPPLYINTERVAL <n><unit>]

<n> is a numeric value for the amount of time to
delay. Minimum is set by the EOFDELAY parameter.
Maximum is seven days.

<unit> can be:
S | SEC | SECS | SECOND | SECONDS | MIN | MINS | MINUTE | MINUTES | HOUR | HOURS | DAY | DAYS

This example directs Replicat to wait 2 hours before posting its transactions.

DEFERAPPLYINTERVAL 2HOURS


Option 2:


You can also look at the use of EOFDELAY in the replicat. When the replicat positions to trail EOF, then you could have the replicat wait for 600 seconds or 10 minutes before doing more work. 

This example directs Replicat to wait 600 seconds when the replicate positions to the trail EOF.

EOFDELAY 600


The eofdelay suspends the replicat checking the trail. While DEFERAPPLYINTERVAL causes the replicat to suspend applying the data read from the trail. So former introduces the delay in reading while latter introduces the delay while applying.


for Example:

GGSCI (zbdba2) 1> view param rep1

REPLICAT rep1
ASSUMETARGETDEFS
USERID ogg, PASSWORD ogg
discardfile ./dirdat/rep1_discard.txt,append,megabytes 5
DDL INCLUDE MAPPED
DDLOPTIONS REPORT
DBOPTIONS DEFERREFCONST
DBOPTIONS LOBWRITESIZE 102400
DEFERAPPLYINTERVAL 2MIN
HANDLECOLLISIONS
DDLERROR DEFAULT DISCARD RETRYOP MAXRETRIES 5 RETRYDELAY 20
--grouptransops 1
--maxtransops 1
APPLYNOOPUPDATES
MAP zbdba.*,TARGET zbdba.*;



  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值