Skip to content

Incremental apply options

The apply options decide how an incremental subscription applies captured changes: keep the destination an exact copy, tolerate rows already there, keep a history of every change, or not touch the table at all. Set them per subscription on the Destination tab, under Incremental Apply Options. The group's Subscription Wizard Defaults are the defaults for new members; changing them doesn't affect existing members.

Choose an option

Some options behave differently, or aren't applied, with Merge as the group's DML Replication: see Under each apply method.

Choose one of these:

Option What happens at the destination Use it when
Strict Apply Rules (default) Inserts, updates and deletes are applied as they happened. A change that can't be applied (such as an update of a row that isn't there) is flagged as an error. The destination must be an exact copy of the source.
Allow UPSERT An update of a missing row is applied as an insert, and an insert of an existing row as an update; a delete of a missing row is ignored. When the Replicator Service created the destination table, it adds a primary key on the replication key (or a unique index) once the changes captured during the baseline are applied; see Keys, RRN/ROWID and indexes. The destination may already hold some rows, or changes may be applied more than once (for example, after a replay).
Archive all DML Activity Every change, deletes and updates included, is inserted as a new row, so the table holds the history of every change. No index is created. For deletes, only the key and derived columns have values. Audit trails and change history. Add capture metadata columns such as @TS and @TYPE to know when and how each row changed.
Ignore Deletes Source deletes (and truncates) aren't applied: deleted rows stay at the destination. The destination keeps everything ever inserted, for example a data warehouse that keeps historical rows.
Only Stream Change Data The destination table isn't changed: changes go only to the group's change data processing procedure, or to a streaming destination's Apply extension. You process the changes yourself, or the destination is a stream. Not available for destinations with remote apply, where the Capture Agent applies the changes itself (see Destinations and methods).

You can add these to any of the options above:

Option What it does Use it when
Decompose Update Applies each update as a delete followed by an insert; statistics then count two rows per update. No effect with Archive all DML Activity or Only Stream Change Data. Destinations that handle updates poorly, such as tables with column store indexes. A complete after image of the row must be available.
Soft Delete A source delete updates the destination row's derived columns instead of deleting it. See Soft Delete. You need to keep deleted rows and know they were deleted.

Soft Delete

With Soft Delete, a source delete updates only the destination row's derived columns, found by the row's key; the other columns keep their values. So add derived columns that record the delete, for example:

  • @TYPE, which becomes D;
  • @TS or @ts, the time of the delete;
  • for Db2 for i sources with collectLogDetail=true, @JED('enttyp'), which becomes DL.

@LT, @lt and @skip columns aren't updated.

If a row with the same key is inserted again later, the destination row is updated with all the new values.

A new baseline with Delete existing data before replication keeps the rows marked as deleted (@TYPE = D, or @JED('enttyp') = DL); Truncate table before replication removes all rows, those included.

Under each apply method

The options are designed for changes applied row by row. With the group's DML Replication set to Batch or Sequence, they behave as described above. Merge applies each table's changes with one MERGE statement, so some options behave differently or aren't applied (see Choosing the apply method):

Option Batch and Sequence Merge
Strict Apply Rules An update or delete that doesn't touch exactly one row is reported and the subscription is flagged; a duplicate insert is an error (see When a change can't be applied). Behaves like Allow UPSERT: an update of a missing row inserts it, an insert of an existing row updates it, a delete of a missing row does nothing. Nothing is flagged for row counts.
Allow UPSERT A duplicate insert is retried as an update, an update of a missing row as an insert; a delete of a missing row is ignored. Same result, from the MERGE itself.
Archive all DML Activity Every change is inserted as a new row. The same: every change is appended as a new row, with multi-row inserts on the group's connection, and committed with the group's position.
Ignore Deletes Deletes are left out by the Capture Agent; truncates are ignored. The same.
Only Stream Change Data The destination table isn't changed; changes go to the change data processing procedure. Not applied: the destination table is merged. Use a Batch group.
Decompose Update An update is applied as a delete followed by an insert. No effect.
Soft Delete A delete updates only the row's derived columns. A delete updates every non-key column of the row from the delete record, not only the derived columns. Test it before relying on it.
Change Data Logging Every change (or every failed change) is passed to the procedure. Changes are passed only when rows are loaded one at a time (see How Merge works).
Source truncate The destination table is truncated (or its rows deleted). The member is marked as needing a baseline, unless rows are loaded one at a time.
Statistics Inserted, updated and deleted rows are counted separately. Every loaded change is counted as an inserted row; deletes of old keys and of rows leaving a criteria aren't counted.