Setting up a multi-database system that uses C Replicator (CREP) involves designing the schema for both source and target databases and configuring the replicator in the target database. The following sections summarize the tasks that you must perform in the source and target databases for each specified scenario.
For details about the syntax of the statements for defining a replication partition and configuring and starting the replicator, see Managing replication.
Setting up one source database (without data) and one target database
1 Create database schema in both the source database and the target database. Make sure schemas are compatible.
2 Define a replication partition in the source database.
3 Configure and start the replicator in the target database
Setting up one source database (without data) and multiple target databases
1 Create the database schema in the source database and all the target databases. Make sure schemas are compatible.
2 Define a replication partition in source database.
3 Configure the replicator for each target database .
Note All target databases connect to same source.
Setting up multiple source databases (without data) and one target database
1 Create the database schema in all source databases and the target database. Make sure schemas are compatible.
2 Define a replication partition in the source database.
3 Configure the replicator for the target database.
Note The same replicator controls all source databases for the target database.
Setting up one source database (already populated) and one target database
1 Create the database schema in the target database. Make sure it is compatible with source database schema.
2 Define a replication partition in the source database.
3 Configure the replicator for the target database. If required, perform the initial load by using the LOAD ONLY option with the START REPLICATION statement.
Setting up bidirectional replication between two databases
In this context, there are no source or target databases (since each database instance is acting as both source and target), and a replicator is configured and started in both databases.
1 Create the database schema in both databases. Make sure the schemas can be replicated bidirectionally. The schemas do not need to be identical.
2 Define partitions for replication in both databases.
3 Configure and start a replicator in each database.
When starting bidirectional replication with both databases already populated, the primary source for data needs to be defined and accept potential loss of data in conflicts. This is done by running the Initial Load asymmetrically and using CREATE REPLICATION SUBSCRIPTION ... LOAD NONE syntax in the other direction to avoid conflicts.
Note Conflict resolution can not be symmetrically configured in bidirectional replication. In order to resolve conflicts, the conflict resolution rule must be SOURCE WINS in one direction and TARGET WINS in the other direction.