Adding an existing replicate to a grid replicate set by altering a table

You can alter replicated tables through a grid even if the replicate was not created through a grid. Altering a replicated table through a grid adds the replicate to the grid replicate set.

Before you begin

Before you begin, you must verify the following items:
  • All the replicate participants are members of the grid. Replicate participants must include every member node of the grid, and no additional participants.
  • Each replicate participant's information refers to the same database, owner, table name and SELECT statement.
  • The replicated table schema is the same among all participants.
  • The replicate does not belong to an exclusive replicate set.

About this task

Procedure

To alter a replicated table through a grid:
  1. Connect to the grid by running the ifx_grid_connect() procedure with the ER_enable argument set to 1.
  2. Run an ALTER TABLE statement.
  3. Disconnect from the grid by running the ifx_grid_disconnect() procedure.

Results

The replicate is automatically remastered.

Example

The following example adds a new column to the special_offers table and remasters the replicate on all participants that are members of the grid:

EXECUTE PROCEDURE ifx_grid_connect('grid1', 1);

ALTER TABLE special_offers ADD (
	  offer_exceptions	varchar(255));

EXECUTE PROCEDURE ifx_grid_disconnect();