Replication with Infosphere CDC : IBM InfoSphere CDC for solidDB® reference : Commands for IBM InfoSphere CDC : Controlling replication commands
  
Controlling replication commands
This section contains commands that control replication in IBM InfoSphere CDC.
See also
dmendreplication: End replication
dmrefresh: Refresh subscription
dmstartmirror: Start mirroring
Commands for IBM InfoSphere CDC
dmendreplication: End replication
Use this command to end refresh or mirroring on the specified subscriptions.
Ending replication allows you to prepare for transitional activities in your business environment and allows you to move to the next step in your business processes. Here are some examples of transitional activities in your business environment that may require an end to replication:
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 offline maintenance activities.
If you are replicating data continuously with Continuous mirroring and business reasons arise that require an end to replication, IBM InfoSphere CDC 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, 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.
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, IBM InfoSphere CDC 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 desired 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.
Ending replication is also necessary if you want to update and make changes to your subscription by:
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.
To stop an instance after ending replication on all subscriptions, use the dmshutdown command.
Syntax
dmendreplication [-I <instance_name>] [-c|-i|-a|-se [-t <date and time>] [-w|-nw]] <-A|-s <SUBSCRIPTION NAME ...> [-L <locale>]
Parameters
-I <instance_name>
Specifies the IBM InfoSphere CDC instance for which you want to end replication. Alternatively, you can specify the TSINSTANCE environment variable in place of this value.
-c
Specifies that IBM InfoSphere CDC ends replication on the specified subscriptions with the Normal option. IBM InfoSphere CDC will use this option by default if you do not specify ‑se, -i, or ‑a.
This option completes in progress work and then ends replication. If a refresh is in progress, Normal will complete the refresh for the current table before replication ends.
Normal is the most appropriate option for most business requirements and is the preferred method for ending replication in most situations.
-i
Specifies that IBM InfoSphere CDC ends replication on the specified subscriptions with the Immediate option.
This option stops all in progress work and then ends replication. Starting replication after using this option can be slower than using -c. If a refresh is in progress, the refresh for the current table will be interrupted and then replication will end.
You should ensure that all dependent source database logs are available before ending replication using the Immediate option. IBM InfoSphere CDC may need to reprocess all the dependent source logs when you restart the subscription. If IBM InfoSphere CDC is currently processing a long running transaction when you end replication with Immediate, IBM InfoSphere CDC may have to resume replication from the earliest open transaction in the database logs. Use the dmshowlogdependency command to determine which logs are required.
Use this option if business reasons require replication to end faster than -c at the expense of a slower start when you resume replication on the specified subscriptions.
-a
Specifies that IBM InfoSphere CDC ends replication on the specified subscriptions with the Abort option.
This option stops all in progress work and then ends replication rapidly. Starting replication 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.
You should ensure that all dependent source database logs are available before ending replication using the Abort option. IBM InfoSphere CDC may need to reprocess all the dependent source logs when you restart the subscription. If IBM InfoSphere CDC is currently processing a long running transaction when you end replication with Abort, IBM InfoSphere CDC may have to resume replication from the earliest open transaction in the database logs. Use the dmshowlogdependency command to determine which logs are required.
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.
-se
Specifies that IBM InfoSphere CDC 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.
If you specify the following parameters with -se, replication will end at a specific date and time or log position:
–t End replication at a specific date and time in your source database log.
As latency between the source and target increases, the amount of time required to end replication will also increase.
-t <date and time>
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.
If you are scripting the command with this parameter, your script must wait for -se processing to complete before it continues to execute.
This parameter does not apply if you specify -c, -i, or -a. IBM InfoSphere CDC will always wait if you specify -c, -i, or -a when ending 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 IBM InfoSphere CDC ends replication on all subscriptions. Use –s to end replication on one or more subscriptions.
-s <SUBSCRIPTION NAME>
Indicates the subscriptions where IBM InfoSphere CDC will end replication.
To specify multiple subscriptions, list the subscriptions separated by a space. For example:
Subscription1 Subscription2 Subscription3
You must specify a value for this parameter or use –A for all subscriptions.
-L <locale>
The name of the locale used for the IBM InfoSphere CDC instance. The default is the locale of the machine where IBM InfoSphere CDC is installed.
Result
This command returns a value of 0 if the command was successful and a non-zero value if the command fails.
Example
dmendreplication -I MYINSTANCE -c -s FINANCE
IBM InfoSphere CDC 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 -nw
IBM InfoSphere CDC 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 SUBSCRIPTION2
IBM InfoSphere CDC ends replication with the Abort option for SUBSCRIPTION1 and SUBSCRIPTION2 in the specified instance.
See also
Controlling replication commands
dmrefresh: Refresh subscription
Use this command to refresh the specified subscriptions. When you refresh a subscription, IBM InfoSphere CDC 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, IBM InfoSphere CDC 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, IBM InfoSphere CDC ends replication immediately for the specified subscriptions.
Syntax
dmrefresh -I <instance_name> [-a|-f] <-A|-s <subscription_names> ...> [-L <locale>]
Parameters
-I <instance_name>
Specifies the IBM InfoSphere CDC 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 IBM InfoSphere CDC refreshes all target tables in the subscription.
-f
Specifies that IBM InfoSphere CDC refreshes only target tables that are flagged for refresh. If you omit both the -a and -f options, IBM InfoSphere CDC assumes -f by default.
-A
Specifies that IBM InfoSphere CDC refreshes all subscriptions.
-s <subscription_names>
Specifies that IBM InfoSphere CDC 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 IBM InfoSphere CDC instance. The default is the locale of the machine where IBM InfoSphere CDC is installed.
Result
This command returns a value of 0 if the command was successful and a non-zero value if the command fails.
Example
dmrefresh -I new_instance -a -s Finance
IBM InfoSphere CDC refreshes all target tables in the Finance subscription.
See also
Controlling replication commands
dmstartmirror: Start mirroring
Issue this command from your IBM InfoSphere CDC source to start mirroring on the specified subscriptions. This command starts mirroring for any table with a replication method of “Mirror” and a status of “Refresh” or “Active”. Tables with a replication method of Mirror and a status of Refresh are refreshed before mirroring begins.
IBM InfoSphere CDC provides two types of mirroring for source tables that are mapped to target tables: Continuous (-c parameter) and Scheduled End (Net Change) (-n parameter). The type of mirroring you select depends on your business needs.
As its name implies, Continuous mirroring replicates changes to the target on a continuous basis. Use this type of mirroring when business requirements dictate that you need replication to be running continuously and you do not have a clearly defined reason to end replication at the present time.
Scheduled End (Net Change) mirroring replicates changes (to the target) up to a user-specified point in the source database log and then ends replication. Use this type of mirroring when business requirements dictate that you only replicate your data periodically and you have a clearly defined end point for the state of your target database when replication ends.
Scheduled End (Net Change) mirroring allows you to end replication at the following points in your source database log:
-n parameter: When specified without –t, this parameter ends replication at the current time in the source database log.
-t parameter: When specified with –n, this parameter ends replication at a user-specified date and time.
These user specified end points ensure that your target database is in a known state when replication ends.
Syntax
dmstartmirror [-I <instance_name>] [-c|-n [-t <date and time>] [‑w|-nw]] <-A|-s <SUBSCRIPTION NAME ...> [-L <locale>]
Parameters
-I <instance_name>
Specifies the IBM InfoSphere CDC instance for which you want to start mirroring. Alternatively, you can specify the TSINSTANCE environment variable in place of this value.
-c
Specifies that IBM InfoSphere CDC will start Continuous mirroring on the specified subscriptions.
If you do not specify –c or -n, IBM InfoSphere CDC will start Continuous mirroring by default on the specified subscriptions.
-n
Specifies that IBM InfoSphere CDC mirrors all committed database changes in the source database and then ends replication normally at the current source system time in the database log with the Scheduled End option.
-t <date and time>
Indicates the date and time in the source database log when replication will end when using –n.
When specifying a value for this parameter, use the following format:
yyyy-MM-dd HH:mm
This parameter is optional when you specify –n.
-w
Indicates that this command will wait for replication to end when you use –n. –w is the default setting for a Scheduled End to replication.
If you are scripting the command with this parameter, your script must wait for -n processing to complete before it continues to execute.
This parameter does not apply if you specify –c for Continuous mirroring.
-nw
Indicates that this command will not wait for replication to end if you specify -n.
If you are scripting this command, this parameter allows your script to continue executing (asynchronous) if -n processing is not complete.
This parameter does not apply if you specify –c for Continuous mirroring. -A Indicates that IBM InfoSphere CDC starts mirroring for all subscriptions. Use –s to start mirroring for one or more subscriptions.
-s <SUBSCRIPTION NAME>
Indicates the subscriptions where IBM InfoSphere CDC will start mirroring. To specify multiple subscriptions, list the subscriptions separated by a space. For example:
Subscription1 Subscription2 Subscription3
You must specify a value for this parameter or use –A for all subscriptions.
-L <locale>
The name of the locale used for the IBM InfoSphere CDC instance. The default is the locale of the machine where IBM InfoSphere CDC 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
dmstartmirror -I MYINSTANCE -c -s FINANCE
IBM InfoSphere CDC starts continuous mirroring for the FINANCE subscription.
dmstartmirror -I MYINSTANCE –n –t “2010-02-05-00-00” FINANCE -nw
IBM InfoSphere CDC starts mirroring with the Scheduled End option for the FINANCE subscription in the MYINSTANCE instance. Replication will end at the specified time in the source database log. The command will exit before Scheduled End processing is complete.
See also
Controlling replication commands