How to Replicate Data Between Oracle and MySQL Database? (Doc ID 1605674.1)

0    586    3

Tags:

👉 本文共约1524个字,系统预计阅读时间或需6分钟。

How to Replicate Data Between Oracle and MySQL Database? (Doc ID 1605674.1)

GOAL

This note describes a set up of a GoldenGate replication between Oracle and MySQL

SOLUTION

Please make sure you have installed GoldenGate on the Oracle and the MySQL server. First let's start with the configuration of GoldenGate on the MySQL machine.

1. Pre-requisites

So let's start ggsci: ./ggsci
and in ggsci let's create the subdirectories:

2. GoldenGate Manager

The next step is to configure a basic GoldenGate manager process:

(SIDE NOTE - I have to use 7806 port here as my replicat and extract will be running on the same machine...)

We do the same steps now for the GG side that will connect to the Oracle database and use here now the port 7809.
So at the end we have now 2 manager processes running - one for the Oracle GG extract and the other one for the MySQL replicat.

3. GoldenGate demo tables

For a basic replication we create the demo tables in Oracle and MySQL using the scripts shipped with the installation.

3.1 The demo tables for the Oracle database

connect to the Oracle database and execute the demo_ora_create and demo_ora_insert script:

3.2 Creating the MySQL demo tables

Connect to the MySQL database and execute demo_mysql_create.sql script:

4. Oracle database pre-requisites

4.1 Verify Oracle DB connection

In my Oracle database I have a user mysql with password which owns the 2 tables.

Found 2 tables matching list criteria.

4.2 Add the TRANDATA

to be able to capture the changes for the table we need to add trandata:

5. GoldenGate initial load (no data pump process configured to keep it simple)

The Oracle table already contains some data, so let's define an initial load process to first replicate the data to the target:

6. The SOURCEDEFS file

when replicating data between an Oracle and a foreign database we also need to create the SOURCEDEFS file which requires a definition generator parameter file. It is created in ggsci containing the username and password as well as the table we want to map.

6.1 DEFGEN parameter file

本人提供Oracle(OCP、OCM)、MySQL(OCP)、PostgreSQL(PGCA、PGCE、PGCM)等数据库的培训和考证业务,私聊QQ646634621或微信dbaup66,谢谢!
AiDBA后续精彩内容已被站长无情隐藏,请输入验证码解锁本文!
验证码:
获取验证码: 请先关注本站微信公众号,然后回复“验证码”,获取验证码。在微信里搜索“AiDBA”或者“dbaup6”或者微信扫描右侧二维码都可以关注本站微信公众号。

标签:

Avatar photo

小麦苗

学习或考证,均可联系麦老师,请加微信db_bao或QQ646634621

您可能还喜欢...

发表回复