In this blog, let's discuss how to perform a "clean" initial loading for Oracle GoldenGate from MySQL database. The word "clean" means that you need need to run HANDLECOLLISIONS to transit from the initial loading to the real-time (CDC) replication. The HANDLECOLLISIONS approach requires primary keys to detect collisions which is not ideal for some databases which doesn't have primary keys.
Let's use one example that replicates data from MySQL database to Big Data. The initial loading need the following steps:
- Enabling the read lock on the MySQL master database
- Flush all the tables on master
- Copy master data to slave for the initial snapshot
- Create the slave and start the MySQL replication
- Unlock master to receive new transactions
- Suspend the MySQL replication (Note down the Binlog file number and offset on the slave)
- Start the GoldenGate initial loading from the slave to the big data repository
- After the initial loading is completed, start the GG extract from the binlog position noted down.
- Resume the MySQL replication.
Resources
- MySQL 5.7 Documentation - 17.1.2.4 Choosing a Method for Data Snapshots