Performing unsupported table operations on source tables that have shadow tables

To perform an unsupported table operation on a source table that has a shadow table, you must drop the shadow table and performing the appropriate actions to quickly restart replication.

Before you begin

  • Ensure that you can log in to the InfoSphere CDC Management Console as access-server-user.
  • Ensure that you have access to the datastore for your shadow tables.

Procedure

To perform an unsupported table operation on a source table that has a shadow table:

  1. Log in to the InfoSphere CDC Management Console as access-server-user.
  2. Stop replication:
    1. Click Configuration > Subscriptions.
    2. Right-click the subscription, and select End Replication.
    3. Select Normal and click OK.
  3. Drop the table mapping for the shadow table:
    1. Click Configuration > Table Mappings.
    2. Right-click the table mapping for the shadow table, select Delete, and click Yes.
  4. Drop the shadow table.
    In the following example, the source table is DTW.TRADE and the shadow table is DTW.TRADE_SHADOW.
    $ db2 drop db DTW.TRADE_SHADOW
    
  5. Complete the table operation on the source table.
    For example:
     $ db2 alter table DTW.TRADE alter column i1 set data type bigint
  6. Reorganize the source table:
    $ db2 reorg table DTW.TRADE
  7. Re-create the shadow table:
    $ db2 "create table DTW.TRADE_SHADOW as
          (select * from DTW.TRADE)
        data initially deferred
        refresh deferred
        maintained by replication
        organize by column"
    $ db2 "set integrity for DTW.TRADE_SHADOW all immediate unchecked"
    $ db2 "alter table DTW.TRADE_SHADOW
        add constraint DTW.TRADE_SHADOW_pk primary key (pk)"
  8. Re-create the table mapping for the shadow table.
  9. Start mirroring:
    1. Click Configuration > Subscriptions.
    2. Right-click the subscription, and select Start Mirroring.
    3. Select Continuous and click OK.