注:本文内容猜想属于个人意见,不保证内容的正确性。如有错误,欢迎指正。
1、Package中Model的选项设置为Journalizing Model
此配置无法正常完成cdc数据捕获)
参数选择Add Subscriber、Extend Window、Lock Subscriber/ Remove Subscriber、Purge Journal、Unlock Subcriber
Subcriber列表中添加导数据接口中对应的Subcriber Filter
结果:1)删除源数据表的数据,运行包,目标数据表的数据被删除
2)新增或修改源数据表的数据,运行包,目标数据表的数据无变化,日记数据不存在,Subcriber不存在
猜想:Add Subcriber的动作在运行包的时候才进行,导致未捕获之前源数据表发生的数据变化信息,而结束后执行了Remove Subcriber,导致运行后查看Subcriber找不到对应的
订阅者及日记数据。
另外,根据官方文档描述,删除源数据表的数据,目标数据也跟着被删除(似乎没有被以上猜想影响),可能原因是:
Knowledge Module Options
When processing journalized data, the SYNC_JRN_DELETE option of the integration knowledge
module should be set carefully.
It invokes the deletion from the target datastore of the records
marked as deleted (D) in the journals and that are not excluded by the journalizing filter. If this
option is set to No, integration will only process inserts and updates.
官方推荐做法:
consistent set journalizing:
Operations before Using the Changed Data
Extend Window: The Consistency Window is a range of available changes in all the tables
of the consistency set for which the insert/update/delete are possible without violating
referential integrity. The extend window operation (re)computes this window to take into
account new changes captured since the latest Extend Window operation. This operation is
implemented using a package step with the Journalizing Model Type. This operation can be
scheduled separately from other journalizing operations.
Lock Subscribers: Although the extend window is applied to the entire consistency set,
subscribers consume the changes separately. This operation performs a subscriber(s) specific
"snapshot" of the changes in the consistency window. This snapshot includes all the changes
within the consistency window that have not been consumed yet by the subscriber(s). This
operation is implemented using a package step with the Journalizing Model Type. It should
be always performed before the first interface using changes captured for the subscriber(s).
Operations after Using the Changed Data
After using the changed data, the following operations should be performed:
Unlock Subscribers: This operation commits the use of the changes that where locked
during the Lock Subscribers operations for the subscribers. It should be processed only after
all the changes for the subscribers have been processed. This operation is implemented using
a package step with the Journalizing Model Type. It should be always performed after the
last interface using changes captured for the subscribers. If the changes need to be processed
again (for example, in case of an error), this operation should not be performed.
Purge Journal: After all subscribers have consumed the changes they have subscribed to,
entries still remain in the journalizing tables and should be deleted. This is performed by the
Purge Journal operation. This operation is implemented using a package step with the
Journalizing Model Type. This operation can be scheduled separately from the other
journalizing operations.