dmshutdown - Shut down CDC Replication

Use this command to stop an instance of CDC Replication and end replication on all subscriptions that use the instance as a source.

This command is often used prior to taking a server or database offline for maintenance purposes or upgrading CDC Replication.

Note: As a best practice before you run this command and to ensure that it completes successfully, use the dmendreplication command to end replication on all subscriptions that use the instance specified in this command.

To end replication on subscriptions that use the specified instance, you can use the –a parameter which will generate an error when forcefully ending replication on subscriptions that use the instance as a target.

If this command does not end CDC Replication processes and stop the specified instance, use the dmterminate command on the UNIX and Linux® platforms to force a complete shut down.

Syntax

dmshutdown [-I <name>] [-c|-i|-a] [-L <locale>]

Parameters

[-I <name>]
Specifies the name of the CDC Replication instance. Alternatively, you can specify the TSINSTANCE environment variable in place of this value.
[-c]
Specifies that CDC Replication stops the specified instance with the Normal option. CDC Replication will use this option by default if you do not specify -i or -a. The instance will only stop if no subscriptions are currently running.
Normal is the most appropriate option for most business requirements and is the preferred method for stopping an instance in most situations.
[-i]
Specifies that CDC Replication stops the specified instance with the Immediate option. The instance will only stop if no subscriptions are currently running.
Starting the target instance after using this option can be slower than -c.
[-a]
Specifies that CDC Replication stops the specified instance and ends replication on all subscriptions that use the instance with the Abort option. Subscriptions that use the specified instance will end replication with an error.
This option stops all in progress work and then ends replication rapidly. Starting replication on subscriptions 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.
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.
As a best practice, use the dmendreplication command to end replication on all subscriptions that use the instance specified in this command.
[-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

dmshutdown -I MYINSTANCE -c

Stops the specified instance with the Normal option. The instance will only stop if no subscriptions are currently running.

dmshutdown -I MYINSTANCE –a

Stops the specified instance and ends replication with the Abort option for all subscriptions that use the instance. Subscriptions that use the specified instance will end replication with an error.