FOR TABLES clause
This clause specifies the tables that are affected by the schema change.
SET SCRIPT VERSION clause
Specifies the new script version for all subscriptions that contain any table specified in the FOR TABLES clause. The
new script version may be the same as the existing script version.
Cloud note: You can specify NULL for the script-version value for cloud tenant databases.
ON SUBSCRIPTION clause
Specifies the new script version for specified subscription. When used, this clause must be repeated for each subscription
that contains any table specified in the FOR TABLES clause. The new script version may be the same as the existing script
version.
All tables to which you want to apply a schema change must be listed in table-list. A table cannot be listed more than once. An error message is reported if there is an existing lock on any of the tables
in table-list.
Only one synchronization schema change can be executed on a database at a time. The START SYNCHRONIZATION SCHEMA CHANGE statement
fails when another schema change is in progress.
The database server obtains locks on all tables specified in table-list. The database server ignores the setting of the blocking option when attempting to obtain locks. If a lock cannot be obtained,
all previously acquired locks are released and an error message is reported.
During a synchronization schema change:
You cannot execute a data manipulation statement.
You cannot execute additional START SYNCHRONIZATION SCHEMA CHANGE statements.
You can alter a publication to change the column subsetting of any table in table-list.
You can alter a publication to drop any table in table-list.
You can alter any of the tables listed in table-list.
An implicit commit is performed both before and after the START SYNCHRONIZATION SCHEMA CHANGE statement is executed. A synchronization
schema change ends with the execution of a STOP SYNCHRONIZATION SCHEMA CHANGE statement. When the STOP SYNCHRONIZATION SCHEMA
CHANGE statement is executed, all table locks are released.
The following sequence of SQL statements illustrates how to use START SYNCHRONIZATION SCHEMA CHANGE and STOP SYNCHRONIZATION
SCHEMA CHANGE:
START SYNCHRONIZATION SCHEMA CHANGE
FOR TABLES DBA.Sales, DBA.Products
SET SCRIPT VERSION = 'version_2';
ALTER TABLE DBA.Sales ADD SUBTOTAL NUMERIC (10,2);
ALTER TABLE DBA.Products ALTER QUANTITY BIGINT;
STOP SYNCHRONIZATION SCHEMA CHANGE;