...
3. Synchronize data
Use the SCN SCNs from step 2 to load the historical data (Example use datapump with flashback_scn=xxx)
...
.
For 2-way replication you cannot simply move the historical data from the database A to B and vice versa, because Dbvisit Replicate would try to replicate this data back as soon as the apply processes are resumed. This would cause the data corruption and replication conflicts, as the data is already in both databases.
To synchronize the data properly, use the named Oracle transaction. Dbvisit Replicate engine will recognize the name of the transaction and will not replicate any change done by such transaction.
Run the following command to obtain an Apply database name:
Panel | ||
---|---|---|
| ||
dbvrep> show apply_database |
...
To move the data from the database UNITTRG to the database UNITSRC set the transaction name to DBREPL_DB_UNITSRC_XID_xxx, where "xxx" is APPLY1.APPLY_DATABASE value obtained earlier.
Use the database link to select the data from the UNITTRG database using the SCN given by the PREPARE TABLE command. Notice the MINUS clause to omit a data common to both tables.
On UNITSRC database run:
Panel | ||
---|---|---|
| ||
SET TRANSACTION NAME 'DBREPL_DB_UNITSRC_XID_UNITSRC'; FROM SCHEMA_RECREATE.schema_recreate_tbl@unittrg |
...
AS OF SCN 43298074 MINUS SELECT id, member FROM SCHEMA_RECREATE.schema_recreate_tbl; COMMIT; |
To move the data from UNITSRC to UNITTRG repeat the previous steps using the APPLY.APPLY_DATABASE value for the transaction name, the database link to UNITSRC and the SCN given by PREPARE TABLE.
On UNITTRG database run:
Panel | ||
---|---|---|
| ||
SET TRANSACTION NAME 'DBREPL_DB_UNITTRG_XID_UNITTRG'; FROM SCHEMA_RECREATE.schema_recreate_tbl@unitsrc MINUS SELECT id, member FROM SCHEMA_RECREATE.schema_recreate_tbl; COMMIT; |
4. Resume the replication
Resume both the APPLY and APPLY1 processes:
Panel | ||
---|---|---|
| ||
dbvrep> choose replication MINE dbvrep> choose replication MINE1 |
...
Note that the table needs to exist on the target side before the apply process can be resumed. Using a datapump in step 3 is a good choice, since the import creates table automatically if it does not exist.
Adding new schemas
Removing tables & schemas
...