Skip to content

ALTER REPLICATION

ALTER REPLICATION#

Syntax#

alter_replication ::=#

image49_alter_replication

replication_item ::=#

replication_item

alter_replication_set_clause ::=#

alter_replication_set_clause

offline_clause ::=#

offline_clause

Prerequisites#

Only the SYS user can execute replication-related statements.

Description#

ALTER REPLICATION controls the operation of a replication object that has been created with the CREATE REPLICATION statement.

For more information about control statements such as replication termination, please refer to 5. Data Control Statements > ALTER REPLICATION.

For more information about replication, please refer to the Replication Manual.

replication_name#

This specifies the name of the replication object.

SYNC#

This sends all data in replication target tables on the local server to the corresponding tables on the remote server and starts replication.

SYNC ONLY#

This sends all data in replication target tables on the local server to the corresponding tables on the remote server. It does not initiate a replication sender thread.

PARALLEL parallel_factor#

The parallel_factor option does not need to be specified; on omission, the default value is 1. The maximum value of parallel_factor is (the number of CPUs * 2). This value cannot be exceeded, even if a higher maximum value is specified. If 0 (zero) or a negative value is specified, an error is returned.

TABLE replication_item#

This specifies which of the replication tables or partitions on the local server to synchronize using the SYNC parameter. If this clause is specified, replication starts from the point in time up to which replication was last performed after the specified tables have been synchronized. If the TABLE clause is omitted, replication starts from the current position in the logs after all of the replication tables and partitions have been synchronized.

START#

Replication starts from the point in time up to which replication was last performed.

QUICKSTART#

Replication starts from the current point in time.

START/ QUICKSTART RETRY#

When STARTing or QUICKSTARTing replication using the RETRY option, even if handshaking fails, a sender thread is created on the local server. When handshaking between the local server and the remote server subsequently succeeds, replication starts.

When this option is used, iSQL will report handshaking success even if the first handshake attempt fails. Therefore, the user has to check the result of this command by viewing trace logs or performance views.

When starting replication without the RETRY option, if the first handshaking attempt fails, an error is raised and execution stops. Note that the use of the RETRY option is not supported in EAGER mode.

STOP#

Please refer to the ALTER REPLICATION caluse of the Data Control Statement.

RESET#

This resets replication information (such as the restart SN). It can only be executed while replication is stopped. It is an alternative to executing the DROP REPLICATION and CREATE REPLICATION commands.

ADD TABLE#

This is used to add a table to a replication object. A table can be added to a replication object only when replication is stopped.

TABLE FROM replication_item TO replication_item#

This is used to specify the name of the replication target table or partition, together with the name of the table owner.

DROP TABLE#

This is used to remove a table from a replication object. A table can be removed from a replication object only when replication is stopped.

FLUSH#

Please refer to the ALTER REPLICATION clause of the Data Control Statement.

SET HOST#

This sets a particular host as the current one. It can be changed while replication is stopped.

USING conn_type [ib_latency]#

The communication method (TCP or InfiniBand) can be set with the remote server. The ib_latency value can be set only when using InfiniBand. To use InfiniBand, the IB_ENABLE property must have a value of 1.

alter_replication_set_clause#

This clause allows the user to enable or disable the following options for replication in LAZY mode.

RECOVERY#

Enables or disables data recovery.

GAPLESS#

Enables or disables replication gap dissolution.

GROUPING#

Enables or disables replication transaction grouping.

PARALLEL#

Enables or disables parallel appliers. Also sets the number of parallel appliers.

offline_cluase#

This clause allows the user to change the offline option or perform replication with a specified offline path.

Considerations#

There are several points that users working with replication must keep in mind before using replication. Before executing an ALTER REPLICATION command, please refer to the Replication Manual.

Example#

Start execution of the repl1 replication object#

<Query> Send the data on the local server data to the remote server, and start replication.

iSQL> ALTER REPLICATION rep1 SYNC;
Alter success.

<Query> Start the rep1 replication from the time point at which replication was most recently executed:

iSQL> ALTER REPLICATION rep1 START;
Alter success.

<Query> Start the replication

iSQL> ALTER REPLICATION rep1 QUICKSTART;
Alter success.

Remove the replication target table employees from a replication object named rep1.#

iSQL> ALTER REPLICATION rep1 STOP;
Alter success.
iSQL> ALTER REPLICATION rep1 DROP TABLE FROM sys.employees TO sys.employees;
Alter success.

Add partition p2 of the partitioned table tbl_sales to the replication object of the name rep1.#

iSQL> ALTER REPLICATION rep1 STOP;
Alter success.
iSQL> ALTER REPLICATION rep1 ADD TABLE
 FROM sys.tbl_sales PARTITION p2 TO sys.tbl_sales PARTITION p2;
Alter success.

Add the table employees to the replication object rep1.#

iSQL> ALTER REPLICATION rep1 STOP;
Alter success.
iSQL> ALTER REPLICATION rep1 ADD TABLE FROM sys.employees TO sys.employees;
Alter success.