Active - Active or 2-way replication is very similar to 1-way replication. This is used when changes can be made to both databases and they both must be kept in sync.
It can be viewed as 2 x 1-way replication, with an outer (1-way) loop and an inner (1-way) loop as seen in the following diagram:
The differences between 1-way replication and 2-way replication are:
- There is a Mine and Apply processes running on each server. With 1-way replication there is only an Apply OR a Mine process running on each server.
- Changes that are mined on the source server and then applied on the target server are not mined again on the target server. This prevents the feedback loop.
- The Mine and Apply processes are paired together. So in a typical 2-way replication there are the following 2-pairs:
- MINE > APPLY
- APPLY1 > MINE1
Configuring 2-way replication
2-way replication can be configured through the setup wizard. To configure 2-way replication, two replication pairs have to be setup. The default in the setup wizard is to configure only 1 pair.
Example configuring 2-way replication
In this example we have setup two databases: orcl and test11202.
At step 2 in the setup wizard, the replication pairs are configured.
Step 2 - Replication pairs
========================================
The second step is to set source and targets for each replication pair. This is usually just choosing the first database as source and the second one as
target, but many more configurations are possible.
Let's configure the replication pair, selecting source and target.
Following databases are described:
1: orcl (Oracle)
2: test11202 (Oracle)
Select source database: [1]
Select target database: [2]
Will be DDL replication enabled? (If YES, the script will grant more privileges to the Dbvisit Replicate users and enable database-wide supplemental logging): [yes]
Use fetcher to offload the mining to a different server? (yes/no) [no]
(NETWORK_QUALITY) - Please specify your network type (LAN or WAN). Autoconfigures timeouts, use of compression etc. [LAN]
Lock and copy the data initially one-by-one or at a single SCN? (one-by-one/single-scn/ddl-only/resetlogs) [single-scn]
What data copy script to create? (dp_networklink/dp_exp/exp/ddl_file/ddl_run) [dp_networklink]
Following replication pairs are now configured:
1: orcl (Oracle) ==> test11202 (Oracle), DDL: yes, fetcher: no, process suffix: (no suffix), network: LAN, prepare type: single-scn, data load:
dp_networklink
Enter number of replication pair to modify it, or "add", or "done": [done]
Add another replication pair, by typing "add" instead of "done". Choose the reverse source and target database:
Enter number of replication pair to modify it, or "add", or "done": [done] add
Let's configure the replication pair, selecting source and target.
Following databases are described:
1: orcl (Oracle)
2: test11202 (Oracle)
Select source database: [1] 2
Select target database: [2] 1
Will be DDL replication enabled? (If YES, the script will grant more privileges to the Dbvisit Replicate users and enable database-wide supplemental logging): [yes]
Use fetcher to offload the mining to a different server? (yes/no) [no]
(NETWORK_QUALITY) - Please specify your network type (LAN or WAN). Autoconfigures timeouts, use of compression etc. [LAN]
Lock and copy the data initially one-by-one or at a single SCN? (one-by-one/single-scn/ddl-only/resetlogs) [single-scn]
What data copy script to create? (dp_networklink/dp_exp/exp/ddl_file/ddl_run) [dp_networklink]
Following replication pairs are now configured:
1: orcl (Oracle) ==> test11202 (Oracle), DDL: yes, fetcher: no, process suffix: (no suffix), network: LAN, prepare type: single-scn, data load:
dp_networklink
2: test11202 (Oracle) ==> orcl (Oracle), DDL: yes, fetcher: no, process suffix: 1, network: LAN, prepare type: single-scn, data load: dp_networklink
Enter number of replication pair to modify it, or "add", or "done": [done]
Two replication pairs are now configured.