dmshowlogdependency - Show Log Dependency

Use this command to display information about source database logs in order to implement a log retention policy.

You can display the following information for a specified instance of CDC Replication, you can display:
  • A list of all the logs that are required for the specified instance.
  • A list of the required logs that are missing and are required by the specified instance.
  • The logs that contain the position confirmed by the target database for the specified instance.
  • The logs that contain the position that the specified instance is reading from.

You must issue this command on your CDC Replication source system.

Syntax

dmshowlogdependency [-I <name>] ( -i | -t | -l)[-c] 
(-s <subscription> | -A | -a) [-v] [-L <locale>]

Parameters

[-I <name>]
The name of the CDC Replication instance. You can set the TSINSTANCE environment variable to the name of your CDC Replication instance. After this is complete, you no longer have to specify the instance when issuing commands.
-i
Displays the complete list of required source database logs for the specified instance. These logs are required to start replication and contain data that has not been applied to the target. If you specify -A, the command considers all subscriptions and displays a list of logs required to start replication on all subscriptions. If you specify -s, the command displays a list of logs required to start replication on the specified subscription. If you decide to use -a, then the command displays a list of logs required to start replication for each individual subscription. Each list contains logs required for the corresponding subscription.
-t
Displays the source database log which contains the position confirmed by the target database. If you specify -A, the command considers all subscriptions and displays the oldest log. If you specify -s, the command displays the log for the specified subscription. If you decide to use -a, then the command displays one log for each subscription. Each log contains the position confirmed by the target database for the corresponding subscription.
-l
Displays the source database log which contains the position CDC Replication is reading from. If you specify -A, the command considers all subscriptions and displays the oldest log. If you specify -s, the command displays the log for the specified subscription. If you decide to use-a, then the command displays one log for each subscription. Each log contains the position for the corresponding subscription.
Accurate information about where in the log CDC Replication is reading will only be provided if there is a steady stream of in scope data being applied and committed on the source database
[-c]
Considers the current position instead of the restart position.
-s <subscription>
Displays a source database log or a list of logs for the specified subscription.
-A
Displays a source database log or a list of logs for all subscriptions.
-a
Displays a source database log or a list of logs for each individual subscription.
[-v]
Specifies verbose output (otherwise, the output is formatted for scripting).
[-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. The command can also print as NULL if there are no tables defined in the subscription.

Examples

dmshowlogdependency -I MYINSTANCE -i -s MYSUBSCRIPTIONNAME

Displays the complete list of required source database logs for the specified instance and subscription.

dmshowlogdependency -I MYINSTANCE -A -t

Displays the complete list of required source database logs for all subscriptions in the specified instance.