dmreassigntable - Update target table definition
Use this command to update the definition of a target table in CDC Replication metadata after you change the definition of the target table in your database.
Syntax
dmreassigntable [-I <name>] -s <subscription ...>
-A|-t <schema>.<table> ... [-L <locale>] [-ma] [-ms]
Parameters
- [-I <name>]
- Specifies the name of the CDC Replication instance. Alternatively, you can specify the TSINSTANCE environment variable in place of this value.
- -s <subscription ...>
- Specifies the subscription that contains the source table that is mapped to the target table which was updated in your database. To specify multiple subscriptions, list the subscriptions separated by a space.
- -A
- Specifies that CDC Replication updates definitions for all target tables in the subscription.
- -t <database>.<table> ...
- Specifies the name of a source table in the subscription that is mapped to the target table for which CDC Replication updates the table definition in the metadata. You must specify the table name in the format database.table. To specify multiple tables, list the tables separated by a space.
- [-L <locale>]
- The name of the locale used for the CDC Replication instance. The default is your machine's locale.
- [-ma]
- Indicates the table mapping type must be changed from Standard to Adaptive Apply.
- [-ms]
- Indicates the table mapping type must be changed from Adaptive Apply back to Standard.
Usage for the -ma and -ms options
Use the -ma and -ms options to temporarily change the mapping
type of an existing table mapping between Standard and Adaptive Apply.
The -ma option changes an existing Standard table mapping to Adaptive Apply.
This can be useful when a target table has temporarily become out of sync with its source table and
replication errors, such as unique constraint violations, are occurring. Enabling Adaptive Apply can
help replication continue while the source and target tables resynchronize, avoiding the need for a
potentially expensive table refresh.
After the source and target tables are back in sync, use the -ms option to
change the mapping type back to Standard.
-ma is specified:- If the current mapping type is already
ADAPTIVE_APPLY, no action is taken. - If the current mapping type is
STANDARD, the mapping type is changed toADAPTIVE_APPLY. - If the current mapping type is anything other than
STANDARD, the following error is returned:User attempted to change the mapping type for target table {0} from {1} to {2}. This is not supported.
-ms is specified:- If the current mapping type is already
STANDARD, no action is taken. - If the current mapping type is
ADAPTIVE_APPLYand was previously a Standard mapping, the mapping type is changed back toSTANDARD. - If the current mapping type is not
ADAPTIVE_APPLY, this error is returned:User attempted to change the mapping type for target table {0} from {1} to {2}. This is not supported. - If the current mapping type is
ADAPTIVE_APPLYbut was not previously a Standard mapping, this error is returned:User attempted to change the mapping type for target table {0} from ADAPTIVE_APPLY to STANDARD, but the mapping type was not previously a standard mapping. This is not supported.
If -ma or -ms is specified together with the
-A option, the requested mapping type change is applied to all tables in the
subscription. The same validation rules and error conditions that apply to individual table mappings
also apply when modifying all tables in a subscription.
Result
This command returns a value of 0 if the operation was successful. If it fails, this command returns a non-zero value.
Example
dmreassigntable
-I NEWINSTANCE -s FINANCE -ACDC Replication updates definitions for all target tables in the Finance subscription.