Ending replication

Ending replication allows you to prepare for transitional activities in your business environment and allows you to move to the next step in your business processes.

About this task

Here are some examples of transitional activities in your business environment that may require an end to replication:

  • Initiating a database backup.
  • Performing a regularly scheduled reboot of your source database server.
  • Quiescing your database in preparation for an upgrade.
  • Weekly batch processing has just completed.
  • Preparing for off-line maintenance activities.

If you are replicating data continuously with Continuous mirroring and business reasons arise that require an end to replication, CDC Replication provides multiple options that suit most business needs. If your business requirements dictate that replication must end at a particular point in your source database log because the target database must be in a known state when replication ends, you can choose from the following options:

  • Current time or “Now”
  • User-specified date and time
  • User-specified log position

An example of a scenario that might require these options is that you are populating a reporting instance and you need stable (non-changing) data in your reporting instance during the day. At the end of the day when you shut down your application, you can choose one of the Scheduled End (Net Change) options to update the reporting instance with data from the current day as well.

If business requirements do not require a specific end point but do require a time frame for ending replication, CDC Replication provides escalating options (Normal, Immediate, and Abort) that end replication more rapidly at the expense of a slower start when resuming replication. For example, a routine end to replication with no particular urgency may require the Normal option, whereas a sudden business need to end replication rapidly may require the Abort option. A routine reboot of a SAN might be appropriate for the Normal option, whereas a sudden and unexpected hardware or application failure may require the Abort option.

If you initiate an end to replication and business reasons warrant a change in your preferred time frame, you can reschedule the end of replication by specifying a new date and time, a new position in the database log, or choose another option for ending replication.

Ending replication is also necessary if you want to update and make changes to your subscription by:

  • Adding a table mapping to the subscription.
  • Deleting a table mapping from the subscription.
  • Temporarily removing a table mapping from the subscription (parking a table).
  • Modifying mapping details such as source and target column mappings, derived columns, data translations, row and column selections, user exits, and so on.
  • Updating the properties of a subscription when the structure of your source and/or target tables change.

Procedure

  1. Click Monitoring > Subscriptions.
  2. If the subscriptions are available for editing, right-click one or more subscriptions and select End Replication.
  3. Depending on your version of CDC Replication, choose from the following options.

    CDC Replication version 6.5 or later:

    Normal
    CDC Replication completes in progress work and then ends replication. If a refresh is in progress, Normal will complete the refresh for the current table before replication ends.
    Normal is the most appropriate option for most business requirements and is the preferred method for ending replication in most situations.
    Immediate
    CDC Replication stops all in progress work and then ends replication. Starting replication after using this option can be slower than using the Normal. If a refresh is in progress, the refresh for the current table will be interrupted and then replication will end.
    You should ensure that all dependent source database logs are available before ending replication using the Immediate option. CDC Replication may need to reprocess all the dependent source logs when you restart the subscription. If CDC Replication is currently processing a long running transaction when you end replication with Immediate, CDC Replication may have to resume replication from the earliest open transaction in the database logs. Use the dmshowlogdependency command to determine which logs are required. This recommendation does not apply to CDC Replication Engine for Db2® for z/OS®.
    Abort
    CDC Replication stops all in progress work and then ends replication rapidly. Starting replication after using this option can be much slower than the Normal. A refresh in progress will be interrupted and the target will stop processing any data that has not been committed before replication ends.
    You should ensure that all dependent source database logs are available before ending replication using the Abort option. CDC Replication may need to reprocess all the dependent source logs when you restart the subscription. If CDC Replication is currently processing a long running transaction when you end replication with Abort, CDC Replication may have to resume replication from the earliest open transaction in the database logs. Use the dmshowlogdependency command to determine which logs are required. This recommendation does not apply to CDC Replication Engine for Db2 for z/OS.
    Use this option if your business reasons require a rapid end to replication and you are willing to tolerate a much slower start when you resume replication on the subscription. A sudden business requirement for an unplanned shutdown of your source system may require this option for ending replication.
    Scheduled End
    This option will process all committed database changes in the source database and then end replication at the indicated point with the Normal option. This option is not available if all the tables in a subscription are currently refreshing.
    Now
    End replication at the current source system time in your source database log. The source system time when replication will end is set when you click OK.
    Specific Date/Time
    End replication with the Normal option at the specified date and time. CDC Replication displays the UTC offset (in minutes) of the source database.
    Specific Log Position
    End replication with the Normal option at the specified log position. CDC Replication displays the format of the log position for the source datastore. This option is only available for supported source datastores.

    CDC Replication version 6.3 and earlier:

    Controlled
    CDC Replication completes all in-progress operations and applies pending changes to the target table.
    Immediate
    CDC Replication interrupts any in-progress operations and does not apply pending changes to the target table.
  4. Click OK.

    If business reasons warrant a change in the preferred time frame for replication to end (faster or slower), you can reschedule the end of replication by specifying a new date and time, a new position in the database log, or choose another option for ending replication.

    Note: As latency between the source and target increases, the amount of time required to end replication will also increase.