SQL Guide : solidDB® SQL statements : EXPORT SUBSCRIPTION TO REPLICA
  
EXPORT SUBSCRIPTION TO REPLICA
EXPORT SUBSCRIPTION publication_name [(publication_parameters)]
   TO REPLICA replica_node_name
   USING BOOKMARK bookmark_name
   [COMMITBLOCK number_of_rows]
where
publication_name and bookmark_name are identifiers that must exist in the database.
COMMIT BLOCK keywords specify how many rows of the exported data are committed in the replica database in one transaction.
Usage
The EXPORT SUBSCRIPTION TO REPLICA statement exports large volumes of data specified by a publication from master database to a replica database. After the EXPORT operation has completed, the replica can use MESSAGE APPEND REFRESH statement to refresh the data of the subscription in an incremental manner. The EXPORT SUBSCRIPTION TO REPLICA statement is not available in a replica database.
Because the EXPORT SUBSCRIPTION TO REPLICA statement does not use the disk-based advanced replication MESSAGEs to send data from master to replica, it provides a significantly more efficient way to send large volumes of data from master to replica as the usage of disk during the operation is minimized.
Publication data is exported from the master database as a REFRESH with a set of input parameter values (if they are used in the publication).
The EXPORT SUBSCRIPTION TO REPLICA statement is based on a given bookmark, which means that export data is consistent up to this bookmark. When you export data, the EXPORT SUBSCRIPTION statement includes all rows as in a full publication up to the bookmark. However, since export is based on a given bookmark, the subsequent REFRESHes are incremental.
If a bookmark is created in a master for the purpose of exporting data, then the bookmark must exist when the EXPORT SUBSCRIPTION statement is executed on the master database. If the bookmark does not exist at this point, error message 25067 is generated, indicating the bookmark cannot be found.
Specifying a commit block when a large number of rows are to be exported improves the performance of the operation. However, it is recommended that the replica database is not used by other applications when export operation with commit block is active.
Return values
Error Code
Description
25056
Autocommit not allowed
25067
Bookmark is not found.
25010
Publication name not found.
Example
EXPORT SUBSCRIPTION FINANCE_PUBLICATION(2004) TO REPLICA
   replica_1
USING BOOKMARK BOOKMARK_FOR_FINANCE_DB COMMITBLOCK 10000;
Related reference
CREATE [OR REPLACE] PUBLICATION
CREATE SYNC BOOKMARK
See also
solidDB® SQL statements