5.2.3. Best Practices: Oracle Replication for Disaster Recovery

Follow the guidelines in Section 2.2, “Best Practices”.

5.2.3.1. Management and Monitoring of Oracle Replication for Disaster Recovery

Check replication status on host1

shell-host1> . /opt/continuent/share/env.sh
shell-host1> trepctl status
shell-host1> vmrrd_oracle2oracle status

Check replication status on host2

shell-host2> . /opt/continuent/share/env.sh
shell-host2> trepctl status

5.2.3.2. Performing a Role Switch

To perform a role switch, for example, switching an existing primary (or master) to be a secondary (or slave), the following steps should be followed:

Important

To enable role switching, we recommend using Tungsten Replication 5.0.1 or later. You should also enable the enable-role-change=true option to tpm.

  1. Put the master replicator OFFLINE:

    shell> trepctl -host host1 offline
  2. Put the slave replicator OFFLINE:

    shell> trepctl -host host2 offline
  3. Change the role of the existing slave replicator to a master:

    shell> trepctl -host host2 setrole -role master
  4. Change the role of the existing master to be a slave, using the new master hostname within the configuration:

    shell> trepctl -host host1 setrole -role slave -uri thls://host2
  5. Put the new master ONLINE:

    shell> trepctl -host host2 online
  6. Wait for a maximum of 120 seconds until the replicator is ONLINE:

    shell> trepctl -host host2 wait -state ONLINE -limit 120
  7. Put the new slave ONLINE:

    shell> trepctl -host host1 online
  8. Wait for 120 seconds to ensure that the slave is ONLINE:

    shell> trepctl -host host1 wait -state ONLINE -limit 120