GoldenGate: MySQL to Oracle Heterogeneous Unidirectional Replication

MySQL  to Oracle Heterogeneous  GoldenGate Unidirectional Replication

In this article we will see    MySQL to Oracle GoldenGate Unidirectional Replication.

Prerequisites for Replication:

1.Create two VM’s on your machine

2.Install MySQL on Source Sever.

3.Install Oracle Software and Create database on target.

4.Make sure two Vm’s are pinging each other.

Node Details :

MySQL(SOURCE)

The MySQL database name is ggadmin, and uses the innodb engine.

The MySQL server name is mysql1.

GG2(TARGET)

192.168.0.40   gg2.orcl.com   gg2

Database Name :ORCl

Instance Name : orcl

Download Goldengate Binaries 

Download GoldenGate binaries from Oracle.com using below link(Oracle)

https://www.oracle.com/technetwork/middleware/goldengate/downloads/index.html

Make sure that you are using the correct OS version of binaries.

MySQL SOURCE ;

Starting on the MySQL database server, mysql1, install the GoldenGate software.

Start the MySQL 

Check MySQL is riunning or not

Check MySQL server status

Connect to MySQL and check the databases.

set the Bash_profile

Run the bash_profile

Edit my.cnf  file and add the following parameters

Now copy GoldenGate software into /opt

Unzip the S/W file

untar the file

Run the ./ggsci command and create sub directories

Check manager sunning or not , If not start the Mgr after specifying the port

Connect as Root user  and create users

Create database

Connect to oggdb1 and create objects

Create unique index on dept table

Verify that the MySQL ODBC connector is installed. As the root Linux user, run the following package manager query command:

login as root on OS:

If it doesn’t  exist, as root, create the /usr/local/etc/odbc.ini file. Add (or verify) the following in the file:

vi /usr/local/etc/odbc.ini

Connect to GGSCI on the Oracle server and create the initial load extract. Since these are small tables, we will use GoldenGate to do the initial load. If these were large tables, we would need to use a different, faster loading method such as load data infile. Also, note that the parameters point to the target (MySQL) database.

Login as oggadm1

Edit extmysql file

Add extract process

Add extrail file to extract process

Start Extract process

Add extract process for datapump(dpmysql)

Add remote trail file

Edit Datapump param file

Start dpmysql

Connect to mysql prompt and insert record into dept table

Connect  ggsci of mysql and cheek stats

ORACLE TARGET :

Login as ggamdin user 

Add Replicat process

Edit repmysql param file

Start the replicate process

check the stats repmysql

INSERT STATEMENT :

MySQL Source :

Oracle Target :

UPDATE STATEMENT :

MySQL Source :

Oracle Target :

DELETE STATEMENT :

MySQL Source 

Oracle Target :

 

Make changes and verify that they are being replicated, use the same method we used for Oracle.

Debugging notes: The file ggserr.log is in the GoldenGate home directory. It can be helpful to tail the file during the entire process on both the Oracle and MySQL server to identify any errors.

 

 

Thank you ………..

 

Note: Please test scripts in Non Prod before trying in Production.
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading...

One thought on “GoldenGate: MySQL to Oracle Heterogeneous Unidirectional Replication

Add Comment