dmrefresh - Refresh subscription
Use this command to refresh the specified subscriptions. When you refresh a subscription, CDC Replication ensures that the target tables are synchronized with the source tables. Typically, you would refresh target tables when you have set the replication method to Refresh on your tables.
However, you can also refresh target
tables that have a replication method set to Mirror and
a status of Active or Refresh.
When you refresh a table configured for mirroring, CDC Replication refreshes
the target table so that it is synchronized with the source table
and then marks a table capture point as the starting point for mirroring.
This command exits after it has successfully refreshed the specified subscriptions. If you terminate this program while it is still running, CDC Replication ends replication immediately for the specified subscriptions.
Syntax
dmrefresh [-I <name>] [-a|-f] -A|-s <subscription ...> [-L <locale>]
Parameters
- [-I <name>]
- Specifies the CDC Replication instance for which you want to refresh one or more subscriptions. Alternatively, you can specify the TSINSTANCE environment variable in place of this value.
- [-a]
- Specifies that CDC Replication refreshes all target tables in the subscription.
- [-f]
- Specifies that CDC Replication refreshes only target tables that are flagged for refresh. If you omit both the -a and -f options, CDC Replication assumes -f by default.
- -A
- Specifies that CDC Replication refreshes all subscriptions.
- -s <subscription...>
- Specifies that CDC Replication refreshes the indicated subscription. To specify multiple subscriptions, list the subscriptions separated by a space.
- [-L <locale>]
- The name of the locale used for the CDC Replication instance. The default is your machine's locale.
Result
This command returns a value of 0 if the command was successful and a non-zero value if the command fails.
Examples
dmrefresh
-I NEWINSTANCE -a -s FINANCE
CDC Replication refreshes all target tables in the Finance subscription.