OGG-Veridata如何对比没有主键的表?

时间:2021-09-09
本文章向大家介绍OGG-Veridata如何对比没有主键的表?,主要包括OGG-Veridata如何对比没有主键的表?使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

一、需求,OGG使用Veridata如何对比没有主键的表?

参考资料

veridata如何安装、使用图形化,学习如下

https://blog.csdn.net/oradbm/article/details/109464000  

官方文档

https://docs.oracle.com/goldengate/1213/gg-veridata/GVDAD/configuration_parameters.htm#GVDAD1109

MOS

二、阅读MOS

APPLIES TO:
Oracle GoldenGate Veridata - Version 2.1.0.2 and later
Information in this document applies to any platform.
GOAL
How do we use Oracle GoldenGate (OGG) Veridata for tables without primary key (pk) or unique index?
SOLUTION
Veridata will auto detect PK/UI on compare tables when the table compare pairs are created. But if you don't have a PK/UI on the compare tables, 
you can still use Veridata.
You'll just have to manually configure the compare to include a column or multiple columns that will function as the table key and uniquely identify each row. To define your own keys for a compare, go to: Configuration >> Group Configuration, select a Group, select the link: Go To Compare Pair Configuration, then click on the Edit link under Column Mapping
and then the Column Mapping tab. Under Key Mapping Method, click the User Defined radio button and Use Specific Columns on Source and Target Keys. Then click the User Defined radio button under Comparison Column Mapping Method. It will open the Mapping Type at the bottom of the page to allow you to click the radio buttons to define which columns are keys and which should be hashed
/literally compare or excluded. Hit Save when you are done and then Validate. The columns you choose as key columns must uniquely identify the row. Otherwise, data can be flagged as out-of-sync when it actually isn't. If you aren't sure which values uniquely identify the rows, select all columns as keys. This still doesn't ensure uniqueness, but it will be the same as doing a literal compare of the rows. It would also help Veridata performance if the columns selected as keys were indexed. The Veridata initial compare uses a full table scan so an index will
not be needed for this step. However, if any rows are identified as out-of-sync, Veridata performs a confirm out-of-sync step on each of these records, querying for these specific records to see if they have changed since the time of the initial compare. This step will be extremely slow if the selected
key column is not indexed. For 12.2.x Release of Veridata Server, please see Section 1.3.2 of the Administrative Guide; https://docs.oracle.com/goldengate/v1221/gg-veridata/GVDAD/E60970-01.pdf 1.3.2 Satisfying Uniqueness Requirements Oracle GoldenGate Veridata relies on some form of unique identifier to order rows for comparison. ■ Primary Key: By default, Oracle GoldenGate Veridata uses the primary key if one is available. ■ Unique Key: If no primary key is defined, Oracle GoldenGate Veridata uses the smallest unique index ■ User-defined Key: If a table or file has neither a primary nor unique key, you can define an existing index or set of columns for comparison purposes when defining a compare pair. However, although primary or unique keys can be mapped automatically, user-defined keys must be mapped manually. A user-defined key can also be used to override existing keys or indexes if you prefer a different ordering method. For more information about choosing and mapping keys for comparison, see the Oracle GoldenGate Veridata online help OGG Veridata Validation Fails With 'Index Validation Failed Because There Were no Mappable Columns' (Doc ID 1361526.1)

基本上一个套路,对没有主键、唯一列的字段,选择自定义map对比校验。 三种对比模式,我们最安全的方式选择key的对比,将所有字段选择!!! 人为工作量增加,但是更安全可靠!!!

原文地址:https://www.cnblogs.com/lvcha001/p/15246281.html