dmendreplication - End replication
Use this command to end refresh or mirroring on the specified subscriptions.
- 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 Scheduled End to replication options:
- -se parameter
- When specified without –t or –p, 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. - -p parameter
- When specified with
–se, this parameter ends replication at a 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 the 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.
- 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. For more information, see Starting and ending replication.
To stop an instance after ending replication on all subscriptions, use the dmshutdown command.
Syntax
dmendreplication [-I <name>] [-c|-i|-a|-se [-t <timestamp>|-p
<log position>] [-w|-nw]] -A|-s <subscription ...> [-L <locale>]Parameters
- [-I <name>]
- Specifies the CDC Replication instance for which you want to end replication. Alternatively, you can specify the TSINSTANCE environment variable in place of this value.
- [-c]
- Specifies that CDC Replication ends replication on the specified subscriptions with the Normal option. CDC Replication will use this option by default if you do not specify –se, -i, or –a.
- [-i]
- Specifies that CDC Replication ends replication on the specified subscriptions with the Immediate option.
- [-a]
- Specifies that CDC Replication ends replication on the specified subscriptions with the Abort option.
- [-se]
- Specifies that CDC Replication 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.
- [-t <timestamp>]
- 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.
- [-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 CDC Replication ends replication on all subscriptions.
- -s <subscription ...>
- Indicates the subscriptions where CDC Replication will end replication.
- [-L <locale>]
- The name of the locale used for the CDC Replication instance. The default is the locale of the machine where CDC Replication 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 FINANCECDC Replication ends replication with the Normal option for the FINANCE subscription in the specified instance.
dmendreplication -I MYINSTANCE –se –t 2010-02-05-00-00
FINANCE
-nwCDC Replication 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.
dmendreplication
-I MYINSTANCE –a –s SUBSCRIPTION1 SUBSCRIPTION2CDC Replication ends replication with the Abort option for SUBSCRIPTION1 and SUBSCRIPTION2 in the specified instance.