How to Change Name of MINE/APPLY in Dbvisit Replicate

Description

This articles explains how to re-name MINE and APPLY processes. This Requires Dbvisit Replicate version 2.7.14 or higher

Environment

For this example bi-directional replication was configured for the schema (NODDLBUTCH. Processes were renamed from default names.

  • Source DB: SDB11@ test210

  • Target DB : TDB11@ test211

Default process names were changed to the following:

| Default Process Name | Custom Process Name | | MINE | MINE_SRC | | APPLY | APPLY_SRC | | MINE1 | MINE1_SRC | | APPLY1 | APPLY1_SRC |

Solution

  1. Run Setup Wizard and configure Two-Way Replication which is adding the replication from both SDB11->TDB11 & TDB11->SDB11 instantiating using Data Pump as per the following document:

    https://dbvisit.atlassian.net/wiki/display/ugd7/Data+Instantiation+in+Two-Way+Replication

    Following databases are now configured: 1: Oracle SDB11, SYS/***, SYSTEM/***, dbvrep1/***, USERS/TEMP, dbvrep1/, ASM:No, TZ: +00:00 2: Oracle TDB11, SYS/***, SYSTEM/***, dbvrep1/***, USERS/TEMP, dbvrep1/, ASM:No, TZ: +00:00 Following replication pairs are now configured: 1: SDB11 (Oracle) ==> TDB11 (Oracle), DDL: NO, fetcher: No, process suffix: (no suffix), compression: No, encryption: No, network timeout: 60, prepare type: single-scn, data load: dp_networklink 2: TDB11 (Oracle) ==> SDB11 (Oracle), DDL: NO, fetcher: No, process suffix: 1, compression: No, encryption: No, network timeout: 60, prepare type: single-scn, data load: dp_networklink Enter number of replication pair to modify it, or "add", or "done": [done]

    Note: I selected to instantiate over the network. You may choose another method.

    Following tables are defined for replication pairs: 1: SDB11 (Oracle) ==> TDB11 (Oracle), DDL: NO, suffix: (no suffix), prepare: single-scn BUTCH(tables) 2: TDB11 (Oracle) ==> SDB11 (Oracle), DDL: NO, suffix: 1, prepare: single-scn BUTCH(tables) Following processes are defined: 1: MINE on SDB11 Host: test210.dbvisit.com, SMTP: No, SNMP: No 2: APPLY on TDB11 Host: test211.dbvisit.com, SMTP: No, SNMP: No 3: MINE1 on TDB11 Host: test211.dbvisit.com, SMTP: No, SNMP: No 4: APPLY1 on SDB11 Host: test210.dbvisit.com, SMTP: No, SNMP: No Enter number of process to modify it, or "done": [done] Select database to hold the DDC settings: 1: SDB11#dbvrep1 2: TDB11#dbvrep1 Enter database number: [1]
  2. After completing setup wizard, run 

    • -all.sh

    , this will generate the APPLY.sh file with data pump script as per instructions during setup.

  3. Next edit the APPLY.sh script which imports over the network in this example. Edit APPLY.sh & add CONTENT=METADATA_ONLY to impdp string:

  4. Check target database & you should see the tables created in the schema BUTCH but no rows as desired.

  5. You should compile all schemas replicated as a best practice.

  6. If you have foreign key constraints, these should be disabled before instantiating the target with data as below. For each schema you are replicating on TARGET, on Target database, run:

    Then run the dynamic SQL you built to disable FK constraints:

  7. Now its time to alter the Process Names. Update configuration files located under the config directory:

    • Edit TARGET2-onetime.ddc & add the following line to the top of the file:

    • Next replace all the process names:

      For Example:

  8. Next edit TARGET2-setup.dbvrep

    • At the top of the file add the following two lines:

    • Change other process name & process setting for the SCN further down in the fileConfiguring non-default processes

      old: choose process MINE

      new: choose process MINE1_SRC


      old: choose process APPLY1

      new: choose process APPLY1_SRC


      old: SET APPLY.INSTANTIATE_SCN NOW

      new: SET APPLY_SRC.INSTANTIATE_SCN NOW


      old: SET APPLY1.INSTANTIATE_SCN NOW

      new: SET APPLY1_SRC.INSTANTIATE_SCN NOW

  9. Edit file TARGET2-wizard-ddc.cfg and change directory names in the file for the MINE & APPLY plog/staging files entries:

  10. Go back to the directory with all your other files & move the 

    • ddc

     files to new names:

  11. Run 

    • all.sh

     script runs once again to now recreate/repopulate the repository metadata & establish an instantiation point (SCN) for your schema/tables you are replicating. This will create a new APPLY.sh that will be used for instantiation. The APPLY1.sh can be ignored.

  12. Once the 

    • all.sh/

     ()

    • all.bat

     on Windows) script completes successfully run APPLY.sh (APPLY.bat) to instantiate target data at the starting point now in metadata (SCN#):

  13. Re-enable any foreign key constraints on Target for each schema owner tables you are replicating. On Target database:

    & run the script:

  14. Edit start-console.sh & change call to ddc file to your renamed MINE process:

  15. Edit your replication startup scripts and rename the startup calls to your new files. For example my run files are TARGET2-run-test210.dbvisit.com.sh & TARGET2-run-test211.dbvisit.com.sh.

    Their contents are now updated:

  16. Copy the DDC files to the server(s) where the processes will run (target host):

  17. For this test I just ran a simple add 10 rows on source SDB11 database & waited until those rows replicated to target (TDB11). Then I proceeded to delete the 10 rows on the target database (TDB11) and verified they were also deleted from source db (SDB11). Below is a Console display after this action:

  18. Delete the old DBVisit MINE and APPLY Services from the control-panel via these commands (Windows):

    On Source Server (Run from CMD-prompt as Administrator):

    On Target Server (Run from CMD-prompt as Administrator):

Chris Lawless May 08, 2015 02:02