Mapping multiple source tables for bulk Adaptive Apply

You can use a wizard to map multiple source tables to existing tables using the Adaptive Apply feature.

Procedure

  1. Click Configuration > Subscriptions.
  2. Select a subscription, right-click and select Map Tables.
  3. Select Multiple One-to-One Mappings > Adaptive Apply and click Next.
  4. Expand the database, schema, or table from the Source Tables list to view tables from your database that are available for mapping. Right-click the database user or schema and click Refresh if you do not see your table listed.

    You may be prompted to filter databases, schemas, or tables if Automatically prompt for filter when expanding nodes is enabled in your preferences. For more information see, Setting advanced preferences. To manually define a filter, select a datastore, database, or schema and click Specify Filter.

  5. Enable one or more tables to map from the Source Tables list. If you do not see your table listed, right-click the database user or schema and select Refresh.
  6. If you want to hide columns so that the target is not aware of them, select a source table and click Filter Columns. Clear the check box for the column you want to hide and click OK.
  7. Click Next.
  8. Select Map to existing target tables and click Next.

    If you want to map to a new target table, click Create new target tables.

    CDC Replication creates a table that is able to hold the data being sent from the source but none of the other table characteristics, such as storage options, will be specified. The tables that are created by CDC Replication can often be useful for quickly creating test environments. For production environments, a DBA should manually create a table that will better address the expected usage of the target system. Some source data types have no natural corresponding target data type and CDC Replication is unable to provide a default mapping. In these cases, you need to explicitly create the target table.

  9. Expand the database, schema, or table from the Target Tables list to view tables from your database that are available for mapping. Right-click the database user or schema and click Refresh if you do not see your table listed.

    The wizard uses the relationship between this target table and the selected source table to map the remaining source and target tables. You can click Change Example Table if you want the Map Tables wizard to base the mapping on a different source table. This option is only available if you have selected more than one source table.

  10. Enable a table to map from the Target Table list. If you do not see your table listed, right-click the database user or schema and select Refresh.
  11. Click Next.
  12. Choose a replication method from the following and click Next:
    • Mirror (Change Data Capture)—Immediately replicates changes made to the source table to the target table or accumulate source table changes and replicate at a later time. If your configuration requires you to prevent recursive updates when mirroring, enable the Prevent Recursion check box. This check box is only available in components of CDC Replication that support both source and target databases.
    • Refresh (Snapshot)—Replicates a snapshot of the source table to the target table.
    • Use Relative Record Number—Enables CDC Replication to replicate updates to the target using a relative record number. When this option is checked, CDC Replication sends the Relative Record Number to the target and expects the Relative Record Number to be the identifying column on the target side. This means that the target tables cannot be updated by more than one source table (a target table cannot be a warehouse for multiple source tables). If you do not check this box, then the CDC Replication Engine for Db2® for i uses a unique key to replicate to the target.
      Notes:
      • When this option is checked, if the source table is reorganized, CDC Replication will automatically start a refresh for that table.
      • If no Relative Record Number is available on the target table (for example, if the table resides on a non-IBM® i system), you can still make use of this option by mapping the Relative Record Number on the source table to a column in the target table to. For more information, see Source RRN (&CNTRRN).
      • This option is only available when you have installed the CDC Replication Engine for Db2 for i on the source database.
  13. Verify the mappings in the Complete Mappings dialog, and click Next.

Results

The Map Tables wizard may leave some source tables unmapped if it did not find a target table that shared the same table structure or similar column names. You must map these manually.