Turning Replication On/Off

Command Syntax:

mupip set {-file db-file | -region reg-list} -replication={ON | OFF}

Qualifiers:

-file and -region

Use these qualifiers in the same manner that you would use them for a MUPIP SET. For more information refer to Chapter 5: “General Database Management.

-replication=replication-state

Switches the GT.M replication subsystem ON/OFF and possibly modify the current journaling [no-]before image field (which is stored in the database file header).

replication-state is either of the following keywords:

OFF

Disable replication of the database file(s) or region(s). Even if you turn off replication, journaling continues to operate as before.

[Important]

GT.M creates a new set of journal files and cuts the back link to the previous journal files if the replication-state is OFF and then turned ON again. The database cannot rollback to a state prior to ON. Therefore, ensure that replication-state remains ON throughout the span of database replication. Turn replication-state OFF only if database replication is no longer needed or the instance is about to be refreshed from the backup of the originating instance.

ON

Enables replication for the selected database file(s) or region(s). When the JOURNAL qualifier is not specified, this action turns BEFORE_IMAGE journaling on. Specify -JOURNAL=NOBEFORE_IMAGE to enable replication with no-before-image journaling. In both cases, GT.M creates a new journal file for each database file or region, and switches the current journal file. FIS recommends you to specify the desired journaling characteristics (MUPIP SET -JOURNAL=BEFORE_IMAGE or MUPIP SET -JOURNAL=NOBEFORE_IMAGE).

When replication is ON, a MUPIP SET REPLICATION=ON command with no JOURNAL qualifier assumes the current journaling characteristics (which are stored in the database file header). By default GT.M sets journal operation to BEFORE_IMAGE if this command changes the replication state from OFF to ON and JOURNAL=NOBEFORE_IMAGE is not specified. Therefore, conservative scripting should always specify the desired journaling characteristics using the JOURNAL qualifier of the MUPIP SET command.

The replication state ON in the file header denotes normal replication operation.

[WAS_ON] OFF

Denotes an implicit replication state when GT.M attempts to keep replication working even if run-time conditions such as no available disk space or no authorization for a process attempting to auto-switch a journal file cause GT.M to turn journaling off. Even after journaling gets turned off, the Source Server attempts to continue replication using the journal records from the backlog of transactions available on the Journal Pool.

If the ON state is like a bicycle running smoothly on the road, WAS_ON is like a bicycle with a flat front tire being ridden like a unicycle - the system is operating outside its intended mode of use and is highly subject to misfortune. If you notice the WAS_ON state, correct the cause that made GT.M turn journaling off and then execute MUPIP SET -REPLICATION=ON or MUPIP BACKUP -REPLICATION=ON.

If the Source Server does not reference any missing journal files, -REPLICATION=ON resumes replication with no downtime.

If the Source Server requires any missing journal file, it produces a REPLBRKNTRANS or NOPREVLINK error and shuts down itself. Note that you cannot rollback after journaling turned off because there is insufficient information to do such a rollback.

In this case, for the replicating instance, proceed as follows:

  1. Take a backup (with MUPIP BACKUP -REPLICATION=ON) of the originating instance.

  2. Restore the replicating instance from the backup of the originating instance.

  3. Restart the Source Source process on the originating instance.

  4. Start the Source Source with the -UPDATERESYNC qualifier on the replicating instance.

On the originating side, you should take a backup as soon as possible coincident with or soon after reestablishing journaling to ensure that a rollback never has to access the time when journaling was off.

WAS_ON is an implicit replication state. You cannot explicitly set or change it with MUPIP SET -REPLICATION. At all times during the WAS_ON state, you can see the current backlog of transactions and the content of the Journal Pool (MUPIP REPLICATE -SOURCE -SHOWBACKLOG and MUPIP REPLICATE -SOURCE -JNLPOOL -SHOW). This information is not available in the OFF state.

[Note]

To make storage space available, first consider moving unwanted non-journaled and temporary data. Then consider moving the journal files that predate the last backup. Moving the currently linked journal files is a very last resort because it disrupts the back links and a rollback or recover will not be able to get back past this discontinuity unless you are able to return them to their original location.

Example:

$ mupip set -replication=on -file mumps.dat

This example enables database replication and turns before-image journaling on for mumps.dat.

$ mupip set -replication=on -journal=nobefore_image -file mumps.dat

This example enables database replication and turns no-before-image journaling on for mumps.dat.

$ mupip set -replication=off -file mumps.dat

This example turns off database replication for mumps.dat.