"Business continuity encompasses a loosely defined set of planning, preparatory and related activities which are intended to ensure that an organization's critical business functions will either continue to operate despite serious incidents or disasters that might otherwise have interrupted them, or will be recovered to an operational state within a reasonably short period." - Wikipeida
There are actually three sub-stories:
- Zero Downtime Migration - When you plan to upgrade or move your database to a different operating system, a newer version, or another database type. Oracle GoldenGate can enable the zero-down time migration. With this setup, you can migrate the system gradually and keep both the old and new systems running during the transition stage.
- High Availability -Setting up a true active-active, active-passive HA system allows you get maximum availability of your applications. Oracle GoldenGate can allow you to do this by synchronizing 2 or multiple systems so that when one system is down, you can use the other system right away.
- Disaster Recovery (DR) - You can use Oracle GoldenGate to setup a standby database for DR purposes.
Zero Downtime Migration
Let's talk about an example migration to a newer Oracle database version. The steps are:
- Start the extract process on the source and write down the time.
- Make sure there is no open transactions at the time of instantiation. The best source for this information is the V$TRANSACTION performance view (GV$TRANSACTION in a RAC database). After starting capture, look at the transactions that exist in this view to see how many of them have a START_TIME less than the time noted when starting the capture process. Try to close those transactions.
- Export the source database (write down the SCN number) and import the data into the target database.
- Start the replicat using from "Start replicat <group_name>, AFTERCSN <SCN number>" (the recorded SCN).
- Check the lag to make sure you see "At EOF, no more records to process."
- Start the extract on the target database and start the replicat on the source database for the fallback replication.
The most tricky part is to use the point-in-time recovery database copy to perform the initial data loading and make sure there is no open transactions before the instantiation.
For database without SCN, you can use the HANDLECOLLISION parameter for the initial loading and then turn off if there is no lag time.
For heterogeneous DB, you can also choose to use direct load for initial loading and then transit to the replcation process.
High Availability
Oracle GoldenGate support bidirectional replication which can be used to setup Active-Active HA configuration. The setup is summarized with the diagrams shown as follows.
- Keep both source and target on the same time zone.
- Use primary key or define KEYCOLS.
- Make sure TRUNCDATE are replicated in one-way.
- Suppress triggers on replicats.
- Use EXCLUDEUSER, EXCLUDEUSERID, EXCLUDETAG, TRANLOGOPTIONS FILTERTABLE table_name, TRANLOGOPTIONS EXCLUDETRANSACTION <transaction_name> in extracts to avoid data replication loop.
- For conflict resolution and detection, include GETBEFORECOLS [10-Part 3] in the extracts and use COMPARECOLS ...RESOLVECONFLICT in replicats.
Disaster Recover
The setup is just simple a bi-direction replication and the replication only run one-direction a time. The setup is similar to the HA setup. I will not discuss the details here.
- GoldenGate High Availability (HA) overview tips by Burleson Consulting
- Oracle Database Documentation - Database High Availability Overview
- Oracle GoldenGate Tutorial 10- performing a zero downtime cross platform migration and 11g database upgrade, by Gavin Soorma.
- Oracle GoldenGate Best Practices: Oracle Migrations and Upgrades 9i and up by Mony Subramony
- Zero Downtime Consolidation to Oracle Database 12c: Webcast Recap, by Irem Radzik
- Zero Downtime Database Upgrade Using Oracle GoldenGate, Oracle TWP, October 2014
- Zero Downtime Migration using Oracle GoldenGate, by Thomas Niewel
- Oracle GoldenGate Documentation - Overview of an Active-active Configuration
- GoldenGate Active-Active Database Replication with Conflict Detection and Resolution, by Natik Ameen
- Blog: Oracle GoldenGate Active-Active Part 1, Part 2, Part 3, by Nick Wagner