Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build OGG 12c MySQL to MySQL

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the knowledge of "how to build OGG 12c MySQL to MySQL". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Download the installation package

Download the latest OGG FOR MySQL, using the

Ggs_121210_Linux_x64_MySQL_64bit.zip

Official download address:

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

OGG installation on source and target side

Create an OGG home directory

Mkdir / ogg

Unpack the installation package and you will get a tar file

Unzip ggs_121210_Linux_x64_MySQL_64bit.zip

Move the tar file to the OHGG home directory and extract it.

Mv ggs_Linux_x64_MySQL_64bit.tar / ogg/

Tar xvf ggs_Linux_x64_MySQL_64bit.tar

Modify environment variabl

Vi / .bash_profile

Add the following three variables

Export GGHOME=/ogg

Export PATH=$PATH:$GGHOME

Export LD_LIBRARY_PATH=/ogg:$LD_LIBRARY_PATH

Log in to the directory where OGG creates OGG.

[root@20_138-Mysql_Test1 ogg] #. / ggsci

Oracle GoldenGate Command Interpreter FOR MySQL

VERSION 12.1.2.1.0 OGGCORE_12.1.2.1.0_PLATFORMS_140920.0203

Linux, x64, 64BIT (optimized), MySQL Enterprise ON Sep 20 2014 03:43:22

Operating system CHARACTER SET IDENTIFIED AS UTF-8.

Copyright (C) 1995, 2014, Oracle AND/OR its affiliates. ALL rights reserved.

GGSCI (20_138-Mysql_Test1) 1 > CREATE subdirs

Creating subdirectories under current DIRECTORY / ogg

Parameter files / ogg/dirprm: already EXISTS

Report files / ogg/dirrpt: created

Checkpoint files / ogg/dirchk: created

PROCESS STATUS files / ogg/dirpcs: created

SQL script files / ogg/dirsql: created

DATABASE definitions files / ogg/dirdef: created

EXTRACT DATA files / ogg/dirdat: created

TEMPORARY files / ogg/dirtmp: created

Credential store files / ogg/dircrd: created

Masterkey wallet files / ogg/dirwlt: created

Dump files / ogg/dirdmp: created

Configure MGR

GGSCI (20_138-Mysql_Test1) 2 > dit params mgr

PORT 7809

Configure the source side

GGSCI (20_138-Mysql_Test1) 4 > dblogin sourcedb oggtest@localhost:3306,userid root,PASSWORD test123

Successfully logged INTO database.

GGSCI (20_138-Mysql_Test1 DBLOGIN AS root) 4 > ADD EXTRACT E1 NOW

EXTRACT added.

GGSCI (20_138-Mysql_Test1 DBLOGIN AS root) 6 > ADD exttrail / ogg/dirdat/e1,EXTRACT E1

EXTTRAIL added.

GGSCI (20_138-Mysql_Test1 DBLOGIN AS root) 7 > edit params E1

EXTRACT e1

Setenv (MYSQL_HOME= "/ var/lib/mysql")

Tranlogoptions altlogdest / var/lib/mysql/mysql-bin.index

Sourcedb oggtest@localhost:3306,userid root,PASSWORD test123

Exttrail / ogg/dirdat/e1

Dynamicresolution

Gettruncates

TABLE oggtest.*

GGSCI (20_138-Mysql_Test1 DBLOGIN AS root) 20 > ADD EXTRACT p1Magol exttrailsource / ogg/dirdat/e1

EXTRACT added.

GGSCI (20_138-Mysql_Test1 DBLOGIN AS root) 21 > ADD rmttrail / ogg/dirdat/r1,EXTRACT p1

RMTTRAIL added.

GGSCI (20_138-Mysql_Test1 DBLOGIN AS root) 22 > edit param p1

EXTRACT p1

Rmthost 192.168.20.139,mgrport 7809

Rmttrail / ogg/dirdat/r1

Passthru

Gettruncates

TABLE oggtest.*

Configure the target side

GGSCI (20_139-Mysql_Test2) 3 > dblogin sourcedb oggtest@localhost:3306,userid root,PASSWORD work123

Successfully logged INTO database.

GGSCI (20_139-Mysql_Test2 DBLOGIN AS root) 4 > ADD checkpointtable oggtest.checkpoint

Successfully created checkpoint TABLE oggtest.checkpoint.

GGSCI (20_139-Mysql_Test2 DBLOGIN AS root) 5 > ADD replicat R1 Magi ExtTrail / ogg/dirdat/r1,checkpointtable oggtest.checkpoint

REPLICAT added.

GGSCI (20_139-Mysql_Test2 DBLOGIN AS root) 5 > edit params R1

Replicat r1

Dboptions HOST localhost,connectionport 3306

Targetdb oggtest,userid root,PASSWORD test123

Assumetargetdefs

DISCARDFILE / ogg/dirrpt/r1.dsc,append,megabytes 50

MAP oggtest.*,target oggtest.*

Initialization data

The main library exports the oggtest library in master-data mode, which records the log_file information at the time of export

Mysqldump-uroot-p-- master-DATA oggtest > oggtest.sql

Open oggtest.sql to find the following and record log_file and log_pos

CHANGE MASTER TO MASTER_LOG_FILE='mysql-bin.000003', MASTER_LOG_POS=5054

Modify extract E1 to start extraction from the binlog at the time of export

GGSCI (20_138-Mysql_Test1 DBLOGIN AS root) 54 > ALTER EXTRACT E1 relegation VAM journal lognum 3recoverlogpos 5054

EXTRACT altered.

Turn on synchronization

Start the extraction process

GGSCI (20_138-Mysql_Test1 DBLOGIN AS root) 59 > START E1

Sending START request TO MANAGER...

EXTRACT E1 STARTING

Start the delivery process

GGSCI (20_138-Mysql_Test1 DBLOGIN AS root) 59 > START P1

Sending START request TO MANAGER...

EXTRACT P1 STARTING

Start the application process on the target

GGSCI (20_139-Mysql_Test2 DBLOGIN AS root) 5 > START R1

Sending START request TO MANAGER...

EXTRACT R1 STARTING

Observe the status of the process

SOURCE end

GGSCI (20_138-Mysql_Test1 DBLOGIN AS root) 63 > info ALL

Program STATUS GROUP Lag AT Chkpt TIME Since Chkpt

MANAGER RUNNING

EXTRACT RUNNING E1 00:00:00 00:00:03

EXTRACT RUNNING P1 00:00:00 00:00:07

TARGET end

GGSCI (20_139-Mysql_Test2 DBLOGIN AS root) 40 > info ALL

Program STATUS GROUP Lag AT Chkpt TIME Since Chkpt

MANAGER RUNNING

REPLICAT RUNNING R1 00:00:00 00:00:09

Insert data into the main database, observe the ogg log information, check whether the backup database is synchronized, and check the wrong beat.

This is the end of "how to build OGG 12c MySQL to MySQL". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report