Use this command to end refresh or mirroring on the specified subscriptions.
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. 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 offline maintenance activities.
If you are replicating data continuously with Continuous mirroring and business reasons arise that require an end to replication, IBM InfoSphere CDC 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 Scheduled End to replication options:
-se parameter
When specified without –t, this parameter ends replication at the current time in the source database log.
-t parameter
When specified with –se, this parameter ends replication at a user-specified date and time.
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, IBM InfoSphere CDC 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 the desired 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 or target tables change.
This command also includes an asynchronous option for scripting (-nw parameter) that can be used with -se to allow your script to continue executing without waiting for the Scheduled End to replication.
You can also start and end replication in Management Console.
To stop an instance after ending replication on all subscriptions, use the dmshutdown command.
Syntax
dmendreplication [-I <INSTANCE_NAME>] [-c|-i|-a|-se [-t <date and time>] [-w|-nw]] <-A|-s <SUBSCRIPTION NAME ...> [-L <locale>]
Parameters
-I <INSTANCE_NAME>
Specifies the IBM InfoSphere CDC instance for which you want to end replication. Alternatively, you can specify the TSINSTANCE environment variable in place of this value.
-c
Specifies that IBM InfoSphere CDC ends replication on the specified subscriptions with the Normal option. IBM InfoSphere CDC will use this option by default if you do not specify –se, -i, or –a.
This option 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.
-i
Specifies that IBM InfoSphere CDC ends replication on the specified subscriptions with the Immediate option.
This option stops all in progress work and then ends replication. Starting replication after using this option can be slower than using -c. 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. IBM InfoSphere CDC may need to reprocess all the dependent source logs when you restart the subscription. If IBM InfoSphere CDC is currently processing a long running transaction when you end replication with Immediate, IBM InfoSphere CDC may have to resume replication from the earliest open transaction in the database logs. Use the dmshowlogdependency command to determine which logs are required.
Use this option if business reasons require replication to end faster than -c at the expense of a slower start when you resume replication on the specified subscriptions.
-a
Specifies that IBM InfoSphere CDC ends replication on the specified subscriptions with the Abort option.
This option stops all in progress work and then ends replication rapidly. Starting replication after using this option can be much slower than using -c. 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. IBM InfoSphere CDC may need to reprocess all the dependent source logs when you restart the subscription. If IBM InfoSphere CDC is currently processing a long running transaction when you end replication with Abort, IBM InfoSphere CDC may have to resume replication from the earliest open transaction in the database logs. Use the dmshowlogdependency command to determine which logs are required.
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 specified subscriptions.
A sudden business requirement for an unplanned shutdown of your source system may require this option for ending replication.
-se
Specifies that IBM InfoSphere CDC will end replication normally at the current source system time in the source database log with the Scheduled End option. The source system time when replication will end is set when you issue this command.
If you specify the following parameters with -se, replication will end at a specific date and time or log position:
–t
End replication at a specific date and time in your source database log.
As latency between the source and target increases, the amount of time required to end replication will also increase.
-t <date and time>
Indicates the date and time in the source database log when replication will end when using –se. When specifying a value for this parameter, use the following format:
“yyyy-MM-dd HH:mm”
This parameter is optional when you specify –se.
-w
Indicates that this command will wait for replication to end when you use –se. –w is the default setting for a Scheduled End to replication.
If you are scripting the command with this parameter, your script must wait for -se processing to complete before it continues to execute.
This parameter does not apply if you specify –c, -i, or –a. IBM InfoSphere CDC will always wait if you specify –c, -i, or –a when ending replication.
-nw
Indicates that this command will not wait for replication to end if you specify -se. If you are scripting this command, this parameter allows your script to continue executing (asynchronous) if -se processing is not complete.
-A
Indicates that IBM InfoSphere CDC ends replication on all subscriptions. Use –s to end replication on one or more subscriptions.
-s <SUBSCRIPTION NAME>
Indicates the subscriptions where IBM InfoSphere CDC will end replication.
To specify multiple subscriptions, list the subscriptions separated by a space. For example:
Subscription1 Subscription2 Subscription3
You must specify a value for this parameter or use –A for all subscriptions.
-L <locale>
The name of the locale used for the IBM InfoSphere CDC instance. The default is the locale of the machine where IBM InfoSphere CDC is installed.
Result
This command returns a value of 0 if the command was successful and a non-zero value if the command fails.
Examples
dmendreplication -I MYINSTANCE -c -s FINANCE
IBM InfoSphere CDC ends replication with the Normal option for the FINANCE subscription in the specified instance.
IBM InfoSphere CDC ends replication with the Scheduled End option for the FINANCE subscription at the specified time in the source database log. The command exits before Scheduled End processing is complete.