solidDB Help : Replication : Advanced Replication : Maintaining a distributed system : Exporting and importing subscriptions : Creating a replica by exporting a subscription with data
  
Creating a replica by exporting a subscription with data
When you have an existing replica database that needs a subset of the master data but does not yet have it, then you use the EXPORT SUBSCRIPTION statement using the WITH DATA option to export data for the replica.
The following procedure demonstrates exporting one or more files (with data) from a master database and loading the data into a replica database by using the IMPORT statement.
Notes
When using the EXPORT SUBSCRIPTION statement, you can export data to the same file multiple times. With each statement, the data is appended to the file. If you plan to do this, be sure you have enough disk space to accommodate the exported data for each export statement. If you run out of disk space in the middle of the export, the EXPORT SUBSCRIPTION statement will fail with an error and the export file will not be usable.
solidDB requires that autocommit be set to OFF when using the EXPORT SUBSCRIPTION statement.
Steps in master database
Perform these steps in the master database:
1 Create a bookmark if one does not exist.
If a bookmark already exists and meets your needs, you can use it. See Managing data with synchronization bookmarks for information about creating bookmarks.
You can also perform queries to see what bookmarks and publications currently exist in your system. See Retrieving bookmark information.
2 Create the export file for every required publication by executing the EXPORT SUBSCRIPTION statement with the WITH DATA option.
If a bookmark is associated with more than one publication in the master database, then execute the EXPORT SUBSCRIPTION statements for each publication separately.
For each EXPORT SUBSCRIPTION statement, the metadata and versioned data corresponding to that publication and bookmark are added to the export file.
Error messages
Possible errors that you might encounter include:
Out of disk space, if you receive an error that you have run out of disk space, delete the previous file and execute the EXPORT SUBSCRIPTION statement again with sufficient disk space.
Note You cannot suspend and resume an EXPORT SUBSCRIPTION statement. If the execution did not complete for some reason, you must execute the EXPORT SUBSCRIPTION statement again.
Error message 25067, indicating that the Advanced Replication bookmark could not be found. Check to see that you have entered the bookmark name correctly.
Error message 25068, indicating that the filename you specified in the EXPORT SUBSCRIPTION or IMPORT statement cannot be opened or cannot be opened in the append mode. Check to see that you have entered the filename correctly and it is not currently in use.
Steps in replica database
Perform these steps in the replica database:
1 Register the replica database with the master database.
2 Set the replica catalog to be current catalog by using the SET CATALOG statement.
3 Register the publication whose subscriptions will be imported.
4 Import the file that you exported from the master database, by using the IMPORT statement.
The IMPORT statement accepts only one file at a time. If you have multiple export files, execute a separate IMPORT statement for each file. Remember that one file might include multiple exports.
Note You cannot suspend and resume an IMPORT statement. If the execution did not complete for some reason, you need to execute the IMPORT statement again.
5 Refresh the publication(s) from the master database by using the Advanced Replication MESSAGE or REFRESH statements.
Go up to
Exporting and importing subscriptions