STRTSMIR—Start mirroring

This command starts mirroring updates that are applied to source tables that are selected to replicate data to the specified subscription. Mirroring can be of two types:

  • Continuous - Replicates changes to the target on a continuous basis. Use continuous mirroring when business requirements dictate that replication must be running continuously and you do not have a clearly defined reason to end replication currently. This option is appropriate when your business processes require the source and target to be synchronized always. Continuous mirroring is also useful if your environment experiences frequent changes to large volumes of data. Instead of capturing these changes by using a batch transfer, you can replicate changes to the target on a continuous basis.
  • Periodic - Replicates changes (to the target) up to a user-specified point in the source database log and then ends replication. Use periodic 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. Periodic mirroring (also known in Management Console as Scheduled End or Net Change mirroring) allows you to end replication at the following points in your source database log:
    • Current time or “Now”
    • User-specified date and time
    • User-specified log position
    These user specified end points ensure that your target database is in a known state when replication ends.

Mirroring can be started and stopped from the operator console or in Management Console. Therefore, it is important to realize that mirroring to the specified subscriptions can be started at the operator console and then stopped in Management Console. CDC Replication handles conflicting commands that are issued from the operator console and Management Console.

Subscriptions can be started under the control of a user-defined pacing interval when PACESUBSTART is configured. This is particularly useful when the user needs to start multiple subscriptions concurrently, and one or more targets have insufficient resources to process all the STRTSMIR commands simultaneously.

Syntax

Read syntax diagramSkip visual syntax diagram FMODIFY procname.identifier,STRTSMIR,SUBSCR=ALL(,subscription), SCHED=*DateTimePOSITION=LogPosition
SUBSCR=subscription
Identifies the subscriptions to receive mirrored data from selected source tables.

One or more subscriptions can be specified. In addition, you can specify the wildcard character (*) to reference multiple subscriptions having names that start with the same set of characters. An example is provided in the example section to illustrate how wildcards are used.

The following predefined value can be specified:

  • ALL - Specifies all subscriptions that are defined to the CDC Replication address space in the metadata.
SCHED=<DateTime>
Identifies the Db2® log data scrape date and time that triggers the ending of replication for the specified subscriptions.

CDC Replication mirrors all committed database changes in the source database that were current at the time that is specified by the keyword value and then ends replication normally.

The <DateTime> value is an ISO format date-time stamp, although “/” will also be accepted as separators of the date parts, and “:” will also be accepted as separators of the hour, minute and second parts. “-“ must still separate the date and time portions, and “.” must separate the seconds and microseconds parts of the time portion. Leading zeroes of any date or time part can be omitted. This date-time stamp can be partially provided, in which case omitted parts are inferred from the current date and time. The parts that can be omitted are the year, month, day and hour. If a part is omitted, all the higher significance parts must be omitted, as well. If the date-time is thus partially provided, it can be preceded by a “+” or “-“, meaning “in the future” or “in the past” respectively, with reference to the current date-time. In the absence of the “+” or “-“ prefix, the missing parts are simply filled in from the current date-time. The lower order parts of the time portion can be omitted as well, in which case they are assumed to be zero. A part of the time portion can be omitted only if all the less significant parts are also omitted. Here are some examples, assume that the current time is 2010-04-10-01.29.54.123456, then:

  Specified Interpretation
  4-9-23.00 2010-04-09-23.00.00.000000
  4/11-23.00 2010-04-11-23.00.00.000000
  -9-23.00 2010-04-09-23.00.00.000000
  +9-23.00 2010-05-09-23.00.00.000000
  +4-9-23.00 2011-04-09-23.00.00.000000
  0:0:0.00 2010-04-10-00.00.00.000000
  +0.0.0.0 2010-04-11-00.00.00.000000
  -2:0:0.0 2010-04-09-02.00.00.000000

Thus +2 means the next time 2:00 A.M occurs (either today or tomorrow), -2 means the previous time 2:00 A.M occurred (either today or yesterday), and 2 means 2:00 A.M. today, whether it has already passed or not.

In addition, you can specify an asterisk (*) to reference the current date and time

POSITION=<LogPosition>
Identifies the point in your source database log where mirroring will be ended.
The value of the POSITION is a hexadecimal specification of either an RBA or LRSN. The interpretation of the value as an RBA or LRSN is dependent on the type of log position being used by the DB2® subsystem. The size of the values vary by database version:
  • For DB2 version 11 or later, an RBA or LRSN is twenty hexadecimal digits.
  • For earlier versions of DB2, an RBA or LRSN is twelve hexadecimal digits.

CDC Replication mirrors all committed database changes in the source database up to the position in the log specified by the keyword value and then ends replication normally.

In the absence of the SCHED and POSITION keywords, the default functional mode is continuous mirroring

Note: The syntactical requirements for the z/OS® START and MODIFY commands and explanations of the procname and identifier elements can be found in the IBM® console commands manual that contains information about operator commands.

This command can be issued on source environments.

Examples

MODIFY CHCAS,STRTSMIR,SUBSCR=ALL

Starts mirroring source table updates to all subscriptions defined in the CDC Replication address space. Since the default functional mode is continuous mirroring, updates are mirrored continuously to all defined subscriptions.

MODIFY CHCAS,STRTSMIR,SUBSCR=(SUB1),SCHED

Starts mirroring source table updates to target SUB1 from the point when the subscription was previously ended. All changes that were logged between that time and the time that the command was submitted will be mirrored to the target, after which the subscription will end.

F CHCAS,STRTSMIR,SUBSCR=(SUB1,SUB2*)

Starts mirroring source table updates to subscription SUB1 and all subscriptions having a name that starts with SUB2 (for instance, SUB2A, SUB2B, and SUB2C) from the point when the subscription was previously ended. Updates are mirrored continuously to the specified subscriptions until the subscription is ended through operator or Management Console intervention.