solidDB Help : Samples : C Replicator sample
  
C Replicator sample
This sample sets up an environment for data replication by using the solidDB C Replicator (CREP) component.
The files for the sample are located in the soliddb-installdir\samples\replication directory.
For general information about running the samples, see Samples.
CREP provides an asynchronous mechanism to replicate write operations across any number of solidDB instances. For more information, see C Replicator.
Running the sample
Run the runme script (runme.bat in Windows) to complete the following actions:
1 Start two solidDB servers (master and replica).
2 Run a script (init_master.sql) to complete the following steps:
a Connect to the master server.
b Create a table (TAB1) and a replication partition (SHARE1).
c Add a row to the table.
3 Run a script (init_replica.sql) to complete the following steps:
a Connect to the replica server.
b Create a table (TAB1) with the same schema as the table on the master server.
c Create a replication connection to the master server.
d Create a replication subscription to the replication partition.
4 Run a statement on the replica server to describe the replication subscription (the status is INIT).
5 Query the table on the replica server (the table is currently empty).
6 Start the replication subscription with LOAD ONLY clause.
7 Run a statement to describe the replication subscription (the status is STOPPED).
8 Query the table on the replica server (the row has replicated from master server).
9 Start the replication subscription (with no LOAD ONLY clause).
10 Add a new row to the table on the master server.
11 Query the table on the replica server (the table now has two rows).
Go up to
Samples