HANDLECOLLISIONS | NOHANDLECOLLISIONS

Valid for Replicat

Use the HANDLECOLLISIONS and NOHANDLECOLLISIONS parameters to control whether or not Replicat tries to resolve duplicate-record and missing-record errors when applying SQL on the target. These errors can occur during an initial load, when data from source tables is being loaded to target tables while Oracle GoldenGate is replicating transactional changes that are being made to those tables. (当数据从源库被初始化加载的同时,OGG正在对那些正在加载的表进行会话改变复制)
When Oracle GoldenGate applies the replicated changes after the load is finished, HANDLECOLLISIONS causes Replicat to overwrite duplicate records in the target tables and provides alternate handling of errors for missing records.

You can use HANDLECOLLISIONS and NOHANDLECOLLISIONS in the following ways:

You can use either HANDLECOLLISIONS or NOHANDLECOLLISIONS at the root level of the parameter file to affect all MAP statements.
可以在最初开始的时候对所有MAP的声明施加影响
You can use HANDLECOLLISIONS and NOHANDLECOLLISIONS as on-off switches for groups of tables to enable or disable error handling as needed. One remains in effect for all subsequent MAP statements until the other is encountered. 
也可以作为开关在任何一个位置多次出现对某一批MAP声明施加影响
You can use HANDLECOLLISIONS and NOHANDLECOLLISIONS within a MAP statement to enable and disable the functionality for a specific table.
也可以对某张制定的表的MAP声明施加影响


Any of the preceding methods can be combined. The use within a MAP statement overrides other settings. The use as a toggle overrides a global setting. For example, you could have a global NOHANDLECOLLISIONS setting, and then use HANDLECOLLISIONS within MAP statements to enable it only for certain tables.

How HANDLECOLLISIONS works

The following example explains how HANDLECOLLISIONS works:

When Replicat encounters a duplicate-record error, the record applied by the initial load is overwritten by the change record. Overlaying the change is safer from an operational standpoint than ignoring the duplicate-record error.

复制进程遇到重复记录错误时,初始化加载的记录会被更改。从操作的角度,覆盖变化是比忽略重复记录的错误更安全。

When Replicat encounters a missing-record error during an update or delete operation, the change record is discarded. These errors happen when a record is changed on the source system and then the record is deleted before the table data is extracted by the initial-load process. For example:
当捕获进程遇到丢失记录错误,更改的记录会被丢弃,当记录在源端被改变,并且记录在初始化数据之前发生,这个错误就会出现。

1. The application updates record A in source table1.、
2. Extract extracts the update
3. The application deletes record A in source table1.
4. Extract extracts the delete.
5. Oracle GoldenGate extracts initial-load data from source table1, without record A.
6. Oracle GoldenGate applies the initial load, without record A.
7. Replicat attempts to apply the update of record A. 
8. The database returns a “record missing” error.
9. Replicat attempts to apply the delete of record A.
10. The database returns a “record missing” error.

HANDLECOLLLIONS should be disabled after the transactional changes captured during the initial load have been applied to the target tables, so that Oracle GoldenGate does not automatically handle subsequent errors. Errors generated after initial synchronization indicate an abnormal condition and should be evaluated by someone who can determine how to resolve them. For example, a missing-record error could indicate that a record which exists on the source system was inadvertently deleted from the target system.
在初始化加载已经应用到目标表的时间里的会话改变被捕获后, HANDLE COLLLI ON S应该失效,目的是OG不能自动的处理接下来的错误。初始化后生成的错误表明是异常的并且应该被知道怎么解决这些错误的人去评估,例如,丢失记录的错误会表明源端存在的记录被目标端漫不经心的删掉了。



You can turn off HANDLECOLLISIONS in the following ways:

Stop Replicat and remove HANDLECOLLISIONS from the Replicat parameter file (can cause target latency), or edit the file to add NOHANDLECOLLISIONS before MAP statements that you want it to affect.

While Replicat is running, run GGSCI and use the SEND REPLICAT command with the NOHANDLECOLLISIONS option for the tables you want to affect . If using SEND REPLICAT, make certain to remove HANDLECOLLISIONS from the parameter file or add a NOHANDLECOLLISIONS parameter before starting another Replicat run, so that HANDLECOLLISIONS does not activate again.


Default None

Syntax HANDLECOLLISIONS | NOHANDLECOLLISIONS

Example 1 The following enables HANDLECOLLISIONS for all MAP statements in the parameter file.

HANDLECOLLISIONS
MAP hr.emp, TARGET hr.emp;
MAP hr.job_hist, TARGET hr.job_hist;
MAP hr.dep, TARGET hr.dep;
MAP hr.country, TARGET hr.country;

Example 2 The following enables HANDLECOLLISIONS for some MAP statements while disabling it for others.

HANDLECOLLISIONS
MAP hr.emp, TARGET hr.emp;
MAP hr.job_hist, TARGET hr.job_hist;
NOHANDLECOLLISIONS
MAP hr.dep, TARGET hr.dep;
MAP hr.country, TARGET hr.country;


Example 3 The following shows a combination of global and MAP-level use. The MAP specification overrides the global specification for the specified tables.

HANDLECOLLISIONS
MAP hr.emp, TARGET hr.emp;
MAP hr.job_hist, TARGET hr.job_hist;
MAP hr.dep, TARGET hr.dep, NOHANDLECOLLISIONS;
MAP hr.country, TARGET hr.country, NOHANDLECOLLISIONS;




来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29802484/viewspace-2121382/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29802484/viewspace-2121382/

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值