SlideShare a Scribd company logo
1 of 19
Download to read offline
Replicación de Base
de datos Oracle hacia
MySQL
Oracle Golden Gate 11gR2
Este documento contiene los pasos necesarios para lograr realizar replicación
Heterogenia entre la base de datos Oracle y MySQL
2016
Erick Vidal
17/04/2016
[REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS]
gt.linkedin.com/in/erickvidal/
@vidbaz
CONTENIDO
Entorno ......................................................................................................................................................................................................3
Instalación..................................................................................................................................................................................................3
Source Database (Oracle 11gR2)............................................................................................................................................................3
Target Database (MySQL) ......................................................................................................................................................................7
Carga Inicial..............................................................................................................................................................................................11
Source Database (Oracle) ....................................................................................................................................................................11
Target Database (MySQL) ....................................................................................................................................................................14
Source Database (Oracle) ....................................................................................................................................................................14
Target Database (MySQL) ....................................................................................................................................................................14
Capturar los Cambios (replicación en línea) ............................................................................................................................................15
Source Database (Oracle) ....................................................................................................................................................................15
Target Database (MySQL) ....................................................................................................................................................................16
Source Database (Oracle) ....................................................................................................................................................................17
Target Database (MySQL) ....................................................................................................................................................................17
Anexos......................................................................................................................................................................................................18
Ejemplo de Archivo defgen..................................................................................................................................................................18
[REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS]
gt.linkedin.com/in/erickvidal/
@vidbaz
MANUAL DE PROCEDIMIENTOS
ENTORNO
A continuación se realizara la replicación heterogénea entre la bases de datos Oracle y MySQL por medio de la herramienta Oracle
Golden Gate. Inicialmente se debe tener instalado ambos motores de bases de datos en diferentes servidores, para poder realizar
dicha replicación, posteriormente se realiza la carga inicial y finalizando con el proceso de cambios en línea. La infraestructura básica
del hardware a utilizar se muestra a continuación:
INSTALACIÓN
SOURCE DATABASE (ORACLE 11GR2)
1. Descargar Oracle Golden Gate para Linux http://edelivery.oracle.com/
2. Descomprimir en el directorio que se utilizara como home de la instalación
#Creación del directorio donde se realizara la instalación
[oracle@terminal.vidbaz ~]$ mkdir /u01/app/oracle/gg_orcl_source
#ingreso del directorio en en profile de linux, para facilidad de acceso (Opcional)
[oracle@terminal.vidbaz ~]$ vi .bash_profile
[oracle@terminal.vidbaz ~]$ cd $GG_HOME
[oracle@terminal.vidbaz gg_orcl_source]$ pwd
Oracle
DB: ORCL
IP:192.168.56.102
SH: PRDAPP
Mysql
DB: ORCL
IP:192.168.56.103
SH: PRDAPP
[REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS]
gt.linkedin.com/in/erickvidal/
@vidbaz
/u01/app/oracle/gg_orcl_source
#Descompresion del binario de OGG
[oracle@terminal.vidbaz gg_orcl_source]$ unzip V34339-01.zip
Archive: V34339-01.zip
inflating: fbo_ggs_Linux_x64_ora11g_64bit.tar
inflating: Oracle_GoldenGate_11.2.1.0.3_README.doc
inflating: Oracle GoldenGate_11.2.1.0.3_README.txt
inflating: OGG_WinUnix_Rel_Notes_11.2.1.0.3.pdf
[oracle@terminal.vidbaz gg_orcl_source]$ tar -xvof fbo_ggs_Linux_x64_ora11g_64bit.tar
3. Ingresar a la consola de GoldenGate GGSCI (GoldenGate Software Command Interface)
[oracle@terminal.vidbaz gg_orcl_source]$ . oraenv
ORACLE_SID = [oracle] ? orcl
The Oracle base has been set to /u01/app/oracle
[oracle@terminal.vidbaz gg_orcl_source]$ ./ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
4. Ahora se deberán crear los Directorios que utilizara GoldenGate para la ejecución
GGSCI (terminal.vidbaz.com.gt) 1> create subdirs
Creating subdirectories under current directory /u01/app/oracle/gg_orcl_source
Parameter files /u01/app/oracle/gg_orcl_source/dirprm: already exists
Report files /u01/app/oracle/gg_orcl_source/dirrpt: created
Checkpoint files /u01/app/oracle/gg_orcl_source/dirchk: created
Process status files /u01/app/oracle/gg_orcl_source/dirpcs: created
SQL script files /u01/app/oracle/gg_orcl_source/dirsql: created
Database definitions files /u01/app/oracle/gg_orcl_source/dirdef: created
Extract data files /u01/app/oracle/gg_orcl_source/dirdat: created
Temporary files /u01/app/oracle/gg_orcl_source/dirtmp: created
Stdout files /u01/app/oracle/gg_orcl_source/dirout: created
GGSCI (terminal.vidbaz.com.gt) 3> exit
5. Verificando que los directorios estén creados
[oracle@terminal.vidbaz gg_orcl_source]$ ls -ltrd dir*
drwxr-x--- 2 oracle oinstall 4096 Aug 23 2012 dirprm
drwxr-x--- 2 oracle oinstall 4096 Aug 23 2012 dirjar
[REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS]
gt.linkedin.com/in/erickvidal/
@vidbaz
drwxrwxr-x 2 oracle oinstall 4096 Apr 14 00:29 dirtmp
drwxrwxr-x 2 oracle oinstall 4096 Apr 14 00:29 dirsql
drwxrwxr-x 2 oracle oinstall 4096 Apr 14 00:29 dirrpt
drwxrwxr-x 2 oracle oinstall 4096 Apr 14 00:29 dirpcs
drwxrwxr-x 2 oracle oinstall 4096 Apr 14 00:29 dirout
drwxrwxr-x 2 oracle oinstall 4096 Apr 14 00:29 dirdef
drwxrwxr-x 2 oracle oinstall 4096 Apr 14 00:29 dirdat
drwxrwxr-x 2 oracle oinstall 4096 Apr 14 00:29 dirchk
6. Luego de la creación de los directorios se deberá preparar las tablas que se replicaran de la base de
datos destino, para este ejemplo se utilizar las tablas que traen de ejemplo el software de OGG.
Primero se deberá crear el esquema que contendrá las tablas a ser replicadas y posteriormente se
creara el usuario de OGG el cual será el encargado de comunicar OGG a la base de datos Oracle.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
SQL> CREATE USER PRDAPP IDENTIFIED BY oracle
DEFAULT TABLESPACE users
QUOTA UNLIMITED ON users; 2 3
User created.
SQL> GRANT DBA TO PRDAPP;
Grant succeeded.
SQL> connect prdapp/oracle
Connected.
SQL>-- creación del usuario de OGG
SQL> CREATE USER GGUSER IDENTIFIED BY oracle
DEFAULT TABLESPACE users
QUOTA UNLIMITED ON users;
GRANT DBA TO GGUSER; 2 3
User created.
SQL> SQL>
Grant succeeded.
SQL>
[REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS]
gt.linkedin.com/in/erickvidal/
@vidbaz
7. A continuación se ejecutaran los scripts de demostración @demo_ora_create.sql y
@demo_ora_insert.sql
SQL> connect prdapp/oracle
Connected.
SQL> @demo_ora_create.sql
DROP TABLE tcustmer
*
ERROR at line 1:
ORA-00942: table or view does not exist
Table created.
DROP TABLE tcustord
*
ERROR at line 1:
ORA-00942: table or view does not exist
Table created.
SQL> @demo_ora_insert.sql
1 row created.
1 row created.
1 row created.
1 row created.
Commit complete.
SQL> select * from tcustmer;
CUST NAME CITY ST
---- ------------------------------ -------------------- --
WILL BG SOFTWARE CO. SEATTLE WA
JANE ROCKY FLYER INC. DENVER CO
SQL> select * from tcustord;
[REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS]
gt.linkedin.com/in/erickvidal/
@vidbaz
CUST ORDER_DAT PRODUCT_ ORDER_ID PRODUCT_PRICE PRODUCT_AMOUNT TRANSACTION_ID
---- --------- -------- ---------- ------------- -------------- --------------
WILL 30-SEP-94 CAR 144 17520 3 100
JANE 11-NOV-95 PLANE 256 133300 1 100
8. Posteriormente se deberá iniciar el proceso MANAGER, el cual es el encargado de gestionar y
monitorear los demás procesos de OGG, para mayor información visitar Oracle® GoldenGate
Windows and UNIX Administrator’s Guide 11g Release 2 (Oracle, 2012)
[oracle@terminal.vidbaz gg_orcl_source]$ ./ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (terminal.vidbaz.com.gt) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER STOPPED
GGSCI (terminal.vidbaz.com.gt) 2> edit params mgr
#se deberá editar el archive de parámetros de manager indicando el Puerto
PORT 7809
GGSCI (terminal.vidbaz.com.gt) 3> start manager
Manager started.
GGSCI (terminal.vidbaz.com.gt) 4> info mgr
Manager is running (IP port terminal.vidbaz.com.gt.7809).
GGSCI (terminal.vidbaz.com.gt) 5> exit
TARGET DATABASE (MYSQL)
9. Se deberá descargar los binarios de GoldenGate para la base de datos MySQL de igual forma se
puede descargar de Oracle Software Delivery Cloud, se deberá descomprimir en el directorio donde
se desea instalar OGG
[REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS]
gt.linkedin.com/in/erickvidal/
@vidbaz
[root@terminal.vidbaz gg_orcl_target]# unzip V32399-01.zip
Archive: V32399-01.zip
inflating: ggs_Linux_x64_MySQL_64bit.tar
inflating: OGG_WinUnix_Rel_Notes_11.2.1.0.1.pdf
inflating: Oracle GoldenGate 11.2.1.0.1 README.txt
inflating: Oracle GoldenGate 11.2.1.0.1 README.doc
[root@terminal.vidbaz gg_orcl_target]# tar -xvof ggs_Linux_x64_MySQL_64bit.tar
10. Se deberá crear la variable de entorno GG_HOME para su fácil acceso, posteriormente ingresar a la
consola GGSCI, y crear los directorios necesarios para la configuración de GoldenGate (los pasos son
iguales que cuando se configuro la base de datos fuente.
root@terminal.vidbaz gg_orcl_target]# ./ggsci
Oracle GoldenGate Command Interpreter for MySQL
Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230
Linux, x64, 64bit (optimized), MySQL Enterprise on Apr 23 2012 04:34:25
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (terminal.vidbaz.com.gt) 1> create subdirs
Creating subdirectories under current directory /u01/app/oracle/gg_orcl_target
Parameter files /u01/app/oracle/gg_orcl_target/dirprm: already exists
Report files /u01/app/oracle/gg_orcl_target/dirrpt: created
Checkpoint files /u01/app/oracle/gg_orcl_target/dirchk: created
Process status files /u01/app/oracle/gg_orcl_target/dirpcs: created
SQL script files /u01/app/oracle/gg_orcl_target/dirsql: created
Database definitions files /u01/app/oracle/gg_orcl_target/dirdef: created
Extract data files /u01/app/oracle/gg_orcl_target/dirdat: created
Temporary files /u01/app/oracle/gg_orcl_target/dirtmp: created
Stdout files /u01/app/oracle/gg_orcl_target/dirout: created
GGSCI (terminal.vidbaz.com.gt) 2> exit
[root@terminal.vidbaz gg_orcl_target]# ls -ltrd dir*
drwxr-x---. 1 root root 20 Apr 23 2012 dirprm
drwxr-x---. 1 root root 2758 Apr 23 2012 dirjar
drwxrwxr-x. 1 root root 0 Apr 14 10:36 dirsql
drwxrwxr-x. 1 root root 0 Apr 14 10:36 dirrpt
drwxrwxr-x. 1 root root 0 Apr 14 10:36 dirpcs
drwxrwxr-x. 1 root root 0 Apr 14 10:36 dirdef
drwxrwxr-x. 1 root root 0 Apr 14 10:36 dirdat
drwxrwxr-x. 1 root root 0 Apr 14 10:36 dirchk
drwxrwxr-x. 1 root root 0 Apr 14 10:36 dirtmp
[REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS]
gt.linkedin.com/in/erickvidal/
@vidbaz
drwxrwxr-x. 1 root root 0 Apr 14 10:36 dirout
[root@terminal.vidbaz gg_orcl_target]# ./ggsci
11. Editar el Puerto del manager, he iniciar dicho proceso.
[root@terminal.vidbaz gg_orcl_target]# ./ggsci
Oracle GoldenGate Command Interpreter for MySQL
Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230
Linux, x64, 64bit (optimized), MySQL Enterprise on Apr 23 2012 04:34:25
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (terminal.vidbaz.com.gt) 1> edit params mgr
#configurar el Puerto 7809
PORT 7809
GGSCI (terminal.vidbaz.com.gt) 2> start mgr
Manager started.
GGSCI (terminal.vidbaz.com.gt) 3> info mgr
Manager is running (IP port terminal.vidbaz.com.gt.7809).
GGSCI (terminal.vidbaz.com.gt) 4> exit
12. Ingresar a MySQL y crear la base de datos, que en este ejemplo se llamara orcl
mysql> CREATE DATABASE orcl;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| orcl |
| test |
+--------------------+
4 rows in set (0.00 sec)
mysql> use orcl
[REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS]
gt.linkedin.com/in/erickvidal/
@vidbaz
Database changed
13. Crear y asignar permisos al usuario de base de datos por el cual GoldenGate tendrá acceso a la
misma
mysql> CREATE USER 'ogguser'@'localhost' IDENTIFIED BY 'oracle';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON * . * TO 'ogguser'@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
14. Crear las tablas que serán replicadas desde la base de datos Oracle
[root@terminal.vidbaz gg_orcl_target]# mysql orcl -uogguser -poracle <
demo_mysql_create.sql
mysql> describe TCUSTMER;
+-----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+-------------+------+-----+---------+-------+
| CUST_CODE | varchar(4) | NO | PRI | NULL | |
| NAME | varchar(30) | YES | | NULL | |
| CITY | varchar(20) | YES | | NULL | |
| STATE | char(2) | YES | | NULL | |
+-----------+-------------+------+-----+---------+-------+
4 rows in set (0.01 sec)
mysql> describe tcustord;
ERROR 1146 (42S02): Table 'orcl.tcustord' doesn't exist
mysql> describe TCUSTORD;
+----------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------+--------------+------+-----+---------+-------+
| CUST_CODE | varchar(4) | NO | PRI | NULL | |
| ORDER_DATE | datetime | NO | PRI | NULL | |
| PRODUCT_CODE | varchar(8) | NO | PRI | NULL | |
| ORDER_ID | int(11) | NO | PRI | NULL | |
| PRODUCT_PRICE | decimal(8,2) | YES | | NULL | |
| PRODUCT_AMOUNT | int(11) | YES | | NULL | |
| TRANSACTION_ID | float | YES | | NULL | |
+----------------+--------------+------+-----+---------+-------+
7 rows in set (0.00 sec)
[REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS]
gt.linkedin.com/in/erickvidal/
@vidbaz
mysql>
CARGA INICIAL
El método que se utilizara para realizar la carga inicial es la carga directa a través de GoldenGate, para
volúmenes grandes de información, se recomienda utilizar Bulk, Data Pump, entre otros. A continuación se
muestra un esquema de la carga Inicial (Initail-Load):
SOURCE DATABASE (ORACLE)
15. Comprobar la conexión hacia la base de datos por medio del comando DBLOGIN, y posteriormente
activar el supplemental logging a las tablas que se estarán replicando
GGSCI (terminal.vidbaz.com.gt) 2> dblogin userid gguser, password oracle
Successfully logged into database.
GGSCI (terminal.vidbaz.com.gt) 3> add trandata prdapp.tcustmer
Logging of supplemental redo data enabled for table PRDAPP.TCUSTMER.
GGSCI (terminal.vidbaz.com.gt) 4> add trandata prdapp.tcustord
Logging of supplemental redo data enabled for table PRDAPP.TCUSTORD.
GGSCI (terminal.vidbaz.com.gt) 5> info trandata prdapp.tcust*
Logging of supplemental redo log data is enabled for table PRDAPP.TCUSTMER.
Columns supplementally logged for table PRDAPP.TCUSTMER: CUST_CODE.
Logging of supplemental redo log data is enabled for table PRDAPP.TCUSTORD.
Columns supplementally logged for table PRDAPP.TCUSTORD: CUST_CODE, ORDER_DATE,
PRODUCT_CODE, ORDER_ID.
GGSCI (terminal.vidbaz.com.gt) 6> exit
[oracle@terminal.vidbaz gg_orcl_source]$
(Fuente: Oracle® GoldenGate Administering Oracle GoldenGate)
[REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS]
gt.linkedin.com/in/erickvidal/
@vidbaz
16. Posteriormente agregar el proceso extract y editar el archivo de parámetros del mismo
GGSCI (terminal.vidbaz.com.gt) 1> add extract EINIORCL, sourceistable
EXTRACT added.
GGSCI (terminal.vidbaz.com.gt) 2> info extract *, tasks
EXTRACT EINIORCL Initialized 2016-04-14 12:31 Status STOPPED
Checkpoint Lag Not Available
Log Read Checkpoint Not Available
First Record Record 0
Task SOURCEISTABLE
GGSCI (terminal.vidbaz.com.gt) 4> edit params EINIORCL
--
-- Archivo de Carga Inicial
--
EXTRACT EINIORCL
USERID GGUSER, PASSWORD oracle
RMTHOST terminal.vidbaz.com.gt, MGRPORT 7809
RMTTASK REPLICAT, GROUP RINIORCL
TABLE PRDAPP.TCUSTMER;
TABLE PRDAPP.TCUSTORD;
GGSCI (terminal.vidbaz.com.gt) 5>
17. Debido a que se esta realizando una replicacion heterogenea se debera generar un archive de
parametros en la base de datos fuente que posteriormente se pasara a la base de datos destino
GGSCI> EDIT PARAM DEFGEN
DEFSFILE ./dirdef/source.def, PURGE
USERID gguser, PASSWORD oracle
TABLE PRDAPP.TCUSTMER;
TABLE PRDAPP.TCUSTORD;
[oracle@terminal.vidbaz gg_orcl_source]$ ./defgen paramfile ./dirprm/defgen.prm
***********************************************************************
Oracle GoldenGate Table Definition Generator for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258
Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 16:58:29
[REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS]
gt.linkedin.com/in/erickvidal/
@vidbaz
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
Starting at 2016-04-14 17:19:14
***********************************************************************
Operating System Version:
Linux
Version #1 SMP Wed Feb 22 17:37:40 EST 2012, Release 2.6.32-300.10.1.el5uek
Node: terminal.vidbaz.com.gt
Machine: x86_64
soft limit hard limit
Address Space Size : unlimited unlimited
Heap Size : unlimited unlimited
File Size : unlimited unlimited
CPU Time : unlimited unlimited
Process id: 24505
***********************************************************************
** Running with the following parameters **
***********************************************************************
DEFSFILE ./dirdef/source.def, PURGE
USERID gguser, PASSWORD ******
TABLE PRDAPP.TCUSTMER;
Retrieving definition for PRDAPP.TCUSTMER
TABLE PRDAPP.TCUSTORD;
Retrieving definition for PRDAPP.TCUSTORD
Definitions generated for 2 tables in ./dirdef/source.def
18. Enviar archivo de parámetros de definición a base de datos target
[oracle@terminal.vidbaz gg_orcl_source]$ scp ./dirdef/source.def
root@192.168.1.66:/u01/app/oracle/gg_orcl_target/dirdef/
root@192.168.1.66's password:
source.def
[REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS]
gt.linkedin.com/in/erickvidal/
@vidbaz
TARGET DATABASE (MYSQL)
19. Agregar el Archivo Replicate (en el cual ya contiene la información del archivo de parámetros de
definición generado en source a través de la herramienta defgen)
GGSCI (terminal.vidbaz.com.gt) 1> ADD REPLICAT RINIORCL, SPECIALRUN
GGSCI (terminal.vidbaz.com.gt) 2> INFO REPLICAT *, TASKS
GGSCI (terminal.vidbaz.com.gt) 3> EDIT PARAMS RINIORCL
--
-- Change Delivery parameter file for
-- TCUSTMER and TCUSTORD changes
--
REPLICAT RINIORCL
TARGETDB orcl@localhost, USERID OGGUSER, PASSWORD oracle
SOURCEDEFS ./dirdef/source.def
DISCARDFILE ./dirrpt/RINIORCL.dsc, PURGE
MAP PRDAPP/TCUSTMER, TARGET ORCL.TCUSTMER;
MAP PRDAPP/TCUSTORD, TARGET ORCL.TCUSTORD;
SOURCE DATABASE (ORACLE)
20. Iniciar el proceso de carga inicial
GGSCI (terminal.vidbaz.com.gt) 1> start extract EINIORCL
Sending START request to MANAGER ...
EXTRACT EINIORCL starting
TARGET DATABASE (MYSQL)
21. Verificar el reporte de la carga inicial para ver que no haya ocurrido ningún error.
GGSCI (terminal.vidbaz.com.gt) 1> view report riniorcl
Ver resultado de reporte en Anexos
22. Verificar que en las tablas de mysql se encuentre la información cargada.
mysql> select * from TCUSTMER;
+-----------+------------------+---------+-------+
| CUST_CODE | NAME | CITY | STATE |
+-----------+------------------+---------+-------+
[REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS]
gt.linkedin.com/in/erickvidal/
@vidbaz
| JANE | ROCKY FLYER INC. | DENVER | CO |
| WILL | BG SOFTWARE CO. | SEATTLE | WA |
+-----------+------------------+---------+-------+
2 rows in set (0.00 sec)
mysql> select * from TCUSTORD;
+-----------+---------------------+--------------+----------+---------------+----------------+----------------+
| CUST_CODE | ORDER_DATE | PRODUCT_CODE | ORDER_ID | PRODUCT_PRICE | PRODUCT_AMOUNT | TRANSACTION_ID |
+-----------+---------------------+--------------+----------+---------------+----------------+----------------+
| JANE | 1995-11-11 13:52:00 | PLANE | 256 | 133300.00 | 1 | 100 |
| WILL | 1994-09-30 15:33:00 | CAR | 144 | 17520.00 | 3 | 100 |
+-----------+---------------------+--------------+----------+---------------+----------------+----------------+
2 rows in set (0.00 sec)
mysql>
CAPTURAR LOS CAMBIOS (REPLICACIÓN EN LÍNEA)
Ahora se configura el proceso de extracción de los datos en tiempo real, lo cual permitirá la replicación
automática de la información de la base de datos Oracle hacia MySQL.
SOURCE DATABASE (ORACLE)
23. Agregando el proceso extract, verificando su creación y editando los parámetros
GGSCI> ADD EXTRACT EORAORCL, TRANLOG, BEGIN NOW
GGSCI> INFO EXTRACT EORAORCL
GGSCI> EDIT PARAMS EORAORCL
--
-- Change Capture parameter file to capture
-- TCUSTMER and TCUSTORD Changes
--
EXTRACT EORAORCL
USERID gguser, PASSWORD oracle
(Fuente: Oracle® GoldenGate Administering Oracle GoldenGate)
[REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS]
gt.linkedin.com/in/erickvidal/
@vidbaz
RMTHOST 192.168.56.103, MGRPORT 7809
TRANLOGOPTIONS ASMUSER sys@ASM, ASMPASSWORD oracle_4U
RMTTRAIL ./dirdat/lt
TABLE PRDAPP.TCUSTMER;
TABLE PRDAPP.TCUSTORD;
24. Ahora se agrega remote trail, recordando que en esta configuración no se hará un trail local sino que
la información será enviada a través de la red hacia el servidor destino, por eso la razón de crear el
remote trail.
GGSCI> ADD RMTTRAIL ./dirdat/lt, EXTRACT EORAORCL, MEGABYTES 5
--verificando los resultados:
GGSCI> INFO RMTTRAIL *
TARGET DATABASE (MYSQL)
25. Creando la tabla de Checkpoint, para esto se edita los parámetros de GLOBALS.
GGSCI> EDIT PARAMS ./GLOBALS
CHECKPOINTTABLE orcl.ggschkpt
GGSCI> DBLOGIN SOURCEDB orcl@localhost USERID ogguser, PASSWORD oracle
GGSCI> ADD CHECKPOINTTABLE
26. Agregar proceso de replicación
GGSCI> ADD REPLICAT RMSQORCL, EXTTRAIL ./dirdat/lt
GGSCI> EDIT PARAM RMSQORCL
--
-- Change Delivery parameter file to apply
-- TCUSTMER and TCUSTORD Changes
--
REPLICAT RMSQORCL
TARGETDB orcl@localhost, USERID ogguser, PASSWORD oracle
HANDLECOLLISIONS
SOURCEDEFS ./dirdef/source.def
DISCARDFILE ./dirrpt/RMSQORCL.DSC, PURGE
MAP PRDAPP.TCUSTMER, TARGET orcl.TCUSTMER;
MAP PRDAPP.TCUSTORD, TARGET orcl.TCUSTORD;
[REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS]
gt.linkedin.com/in/erickvidal/
@vidbaz
SOURCE DATABASE (ORACLE)
27. Iniciar el proceso de replicación y verificar resultados
GGSCI> START EXTRACT EORAORCL
--verificar resultados:
GGSCI> INFO EXTRACT EORAORCL, DETAIL
GGSCI> VIEW REPORT EORAORCL
GGSCI (terminal.vidbaz.com.gt) 3> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EORAORCL 00:00:00 00:00:03
TARGET DATABASE (MYSQL)
28. De igual forma en mysql iniciar el proceso y verificar resultados
GGSCI> START REPLICAT RMSQORCL
--Verificando los resultados:
GGSCI> INFO REPLICAT RMSQORCL
GGSCI (terminal.vidbaz.com.gt) 3> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING RMSQORCL 00:00:00 00:00:00
[REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS]
gt.linkedin.com/in/erickvidal/
@vidbaz
ANEXOS
EJEMPLO DE ARCHIVO DEFGEN
[oracle@terminal.vidbaz gg_orcl_source]$ ./defgen paramfile ./dirprm/defgen.prm
***********************************************************************
Oracle GoldenGate Table Definition Generator for Oracle
Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258
Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 16:58:29
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
Starting at 2016-04-14 17:19:14
***********************************************************************
Operating System Version:
Linux
Version #1 SMP Wed Feb 22 17:37:40 EST 2012, Release 2.6.32-300.10.1.el5uek
Node: terminal.vidbaz.com.gt
Machine: x86_64
soft limit hard limit
Address Space Size : unlimited unlimited
Heap Size : unlimited unlimited
File Size : unlimited unlimited
CPU Time : unlimited unlimited
Process id: 24505
***********************************************************************
** Running with the following parameters **
***********************************************************************
DEFSFILE ./dirdef/source.def, PURGE
USERID gguser, PASSWORD ******
TABLE PRDAPP.TCUSTMER;
Retrieving definition for PRDAPP.TCUSTMER
TABLE PRDAPP.TCUSTORD;
Retrieving definition for PRDAPP.TCUSTORD
Definitions generated for 2 tables in ./dirdef/source.def
[oracle@terminal.vidbaz gg_orcl_source]$ cat ./dirdef/source.def
*+- Defgen version 2.0, Encoding UTF-8
*
* Definitions created/modified 2016-04-14 17:19
*
* Field descriptions for each column entry:
*
* 1 Name
* 2 Data Type
* 3 External Length
* 4 Fetch Offset
[REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS]
gt.linkedin.com/in/erickvidal/
@vidbaz
* 5 Scale
* 6 Level
* 7 Null
* 8 Bump if Odd
* 9 Internal Length
* 10 Binary Length
* 11 Table Length
* 12 Most Significant DT
* 13 Least Significant DT
* 14 High Precision
* 15 Low Precision
* 16 Elementary Item
* 17 Occurs
* 18 Key Column
* 19 Sub Data Type
*
Database type: ORACLE
Character set ID: UTF-8
National character set ID: UTF-16
Locale: neutral
Case sensitivity: 14 14 14 14 14 14 14 14 14 14 14 14 11 14 14 14
*
Definition for table PRDAPP.TCUSTMER
Record length: 78
Syskey: 0
Columns: 4
CUST_CODE 64 4 0 0 0 1 0 4 4 0 0 0 0 0 1 0 1 0
NAME 64 30 10 0 0 1 0 30 30 0 0 0 0 0 1 0 0 0
CITY 64 20 46 0 0 1 0 20 20 0 0 0 0 0 1 0 0 0
STATE 0 2 72 0 0 1 0 2 2 0 0 0 0 0 1 0 0 0
End of definition
*
Definition for table PRDAPP.TCUSTORD
Record length: 182
Syskey: 0
Columns: 7
CUST_CODE 64 4 0 0 0 1 0 4 4 0 0 0 0 0 1 0 1 0
ORDER_DATE 192 19 10 0 0 1 0 19 19 19 0 5 0 0 1 0 1 0
PRODUCT_CODE 64 8 32 0 0 1 0 8 8 0 0 0 0 0 1 0 1 0
ORDER_ID 64 50 46 0 0 1 0 50 50 50 0 0 0 0 1 0 1 2
PRODUCT_PRICE 134 10 102 2 0 1 0 8 8 8 0 0 0 0 1 0 0 3
PRODUCT_AMOUNT 134 8 114 0 0 1 0 8 8 8 0 0 0 0 1 0 0 3
TRANSACTION_ID 64 50 126 0 0 1 0 50 50 50 0 0 0 0 1 0 0 2
End of definition
[oracle@terminal.vidbaz gg_orcl_source]$

More Related Content

What's hot

Les nouveautés de MySQL 8.0
Les nouveautés de MySQL 8.0Les nouveautés de MySQL 8.0
Les nouveautés de MySQL 8.0Frederic Descamps
 
Schema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12cSchema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12cuzzal basak
 
Oracle Drivers configuration for High Availability
Oracle Drivers configuration for High AvailabilityOracle Drivers configuration for High Availability
Oracle Drivers configuration for High AvailabilityLudovico Caldara
 
Ohio Linux Fest -- MySQL's NoSQL
Ohio Linux Fest -- MySQL's NoSQLOhio Linux Fest -- MySQL's NoSQL
Ohio Linux Fest -- MySQL's NoSQLDave Stokes
 
Mysql Fun
Mysql FunMysql Fun
Mysql FunSHC
 
Cloud native - Why to use MySQL 8.0 and how to use it on oci with MDS
Cloud native -  Why to use MySQL 8.0 and how to use it on oci with MDSCloud native -  Why to use MySQL 8.0 and how to use it on oci with MDS
Cloud native - Why to use MySQL 8.0 and how to use it on oci with MDSFrederic Descamps
 
Mysql nowwhat
Mysql nowwhatMysql nowwhat
Mysql nowwhatsqlhjalp
 
Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0
Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0
Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0Yury Velikanov
 
Pluggable Databases: What they will break and why you should use them anyway!
Pluggable Databases: What they will break and why you should use them anyway!Pluggable Databases: What they will break and why you should use them anyway!
Pluggable Databases: What they will break and why you should use them anyway!Guatemala User Group
 
Deploying Magento on OCI with MDS
Deploying Magento on OCI with MDSDeploying Magento on OCI with MDS
Deploying Magento on OCI with MDSFrederic Descamps
 
MySQL Utilities -- PyTexas 2015
MySQL Utilities -- PyTexas 2015MySQL Utilities -- PyTexas 2015
MySQL Utilities -- PyTexas 2015Dave Stokes
 
Oracle Developer Live: Deploying MySQL InnoDB Cluster on OCI with Terraform
Oracle Developer Live: Deploying MySQL InnoDB Cluster on OCI with TerraformOracle Developer Live: Deploying MySQL InnoDB Cluster on OCI with Terraform
Oracle Developer Live: Deploying MySQL InnoDB Cluster on OCI with TerraformFrederic Descamps
 
MySQL as a Document Store
MySQL as a Document StoreMySQL as a Document Store
MySQL as a Document StoreDave Stokes
 
監査ログをもっと身近に!〜統合監査のすすめ〜
監査ログをもっと身近に!〜統合監査のすすめ〜監査ログをもっと身近に!〜統合監査のすすめ〜
監査ログをもっと身近に!〜統合監査のすすめ〜Michitoshi Yoshida
 
the State of the Dolphin - October 2020
the State of the Dolphin - October 2020the State of the Dolphin - October 2020
the State of the Dolphin - October 2020Frederic Descamps
 
tow nodes Oracle 12c RAC on virtualbox
tow nodes Oracle 12c RAC on virtualboxtow nodes Oracle 12c RAC on virtualbox
tow nodes Oracle 12c RAC on virtualboxjustinit
 

What's hot (20)

Les nouveautés de MySQL 8.0
Les nouveautés de MySQL 8.0Les nouveautés de MySQL 8.0
Les nouveautés de MySQL 8.0
 
Best Features of Multitenant 12c
Best Features of Multitenant 12cBest Features of Multitenant 12c
Best Features of Multitenant 12c
 
Schema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12cSchema replication using oracle golden gate 12c
Schema replication using oracle golden gate 12c
 
Oracle Drivers configuration for High Availability
Oracle Drivers configuration for High AvailabilityOracle Drivers configuration for High Availability
Oracle Drivers configuration for High Availability
 
MySQL Router REST API
MySQL Router REST APIMySQL Router REST API
MySQL Router REST API
 
Ohio Linux Fest -- MySQL's NoSQL
Ohio Linux Fest -- MySQL's NoSQLOhio Linux Fest -- MySQL's NoSQL
Ohio Linux Fest -- MySQL's NoSQL
 
Mysql Fun
Mysql FunMysql Fun
Mysql Fun
 
Cloud native - Why to use MySQL 8.0 and how to use it on oci with MDS
Cloud native -  Why to use MySQL 8.0 and how to use it on oci with MDSCloud native -  Why to use MySQL 8.0 and how to use it on oci with MDS
Cloud native - Why to use MySQL 8.0 and how to use it on oci with MDS
 
Mysql nowwhat
Mysql nowwhatMysql nowwhat
Mysql nowwhat
 
Long live to CMAN!
Long live to CMAN!Long live to CMAN!
Long live to CMAN!
 
Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0
Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0
Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0
 
Pluggable Databases: What they will break and why you should use them anyway!
Pluggable Databases: What they will break and why you should use them anyway!Pluggable Databases: What they will break and why you should use them anyway!
Pluggable Databases: What they will break and why you should use them anyway!
 
Deploying Magento on OCI with MDS
Deploying Magento on OCI with MDSDeploying Magento on OCI with MDS
Deploying Magento on OCI with MDS
 
MySQL Utilities -- PyTexas 2015
MySQL Utilities -- PyTexas 2015MySQL Utilities -- PyTexas 2015
MySQL Utilities -- PyTexas 2015
 
Oracle Developer Live: Deploying MySQL InnoDB Cluster on OCI with Terraform
Oracle Developer Live: Deploying MySQL InnoDB Cluster on OCI with TerraformOracle Developer Live: Deploying MySQL InnoDB Cluster on OCI with Terraform
Oracle Developer Live: Deploying MySQL InnoDB Cluster on OCI with Terraform
 
MySQL as a Document Store
MySQL as a Document StoreMySQL as a Document Store
MySQL as a Document Store
 
監査ログをもっと身近に!〜統合監査のすすめ〜
監査ログをもっと身近に!〜統合監査のすすめ〜監査ログをもっと身近に!〜統合監査のすすめ〜
監査ログをもっと身近に!〜統合監査のすすめ〜
 
the State of the Dolphin - October 2020
the State of the Dolphin - October 2020the State of the Dolphin - October 2020
the State of the Dolphin - October 2020
 
MySQL JSON Functions
MySQL JSON FunctionsMySQL JSON Functions
MySQL JSON Functions
 
tow nodes Oracle 12c RAC on virtualbox
tow nodes Oracle 12c RAC on virtualboxtow nodes Oracle 12c RAC on virtualbox
tow nodes Oracle 12c RAC on virtualbox
 

Viewers also liked

Diapositivas insertar texto
Diapositivas insertar textoDiapositivas insertar texto
Diapositivas insertar textoCristian Roca
 
Mantenimiento de la salud en las personas mayores
Mantenimiento de la salud en las personas mayoresMantenimiento de la salud en las personas mayores
Mantenimiento de la salud en las personas mayoresLorena Contreras
 
LOS DISPoSITIVOS MÓVILES COMO HERRAMIENTAS EDUCATIVAS EN LA ENSEÑANZA DEL IDI...
LOS DISPoSITIVOS MÓVILES COMO HERRAMIENTAS EDUCATIVAS EN LA ENSEÑANZA DEL IDI...LOS DISPoSITIVOS MÓVILES COMO HERRAMIENTAS EDUCATIVAS EN LA ENSEÑANZA DEL IDI...
LOS DISPoSITIVOS MÓVILES COMO HERRAMIENTAS EDUCATIVAS EN LA ENSEÑANZA DEL IDI...Gisela Martiz-W.
 
Fase de planificacion - Proyecto de capacitación docente en la Universidad Be...
Fase de planificacion - Proyecto de capacitación docente en la Universidad Be...Fase de planificacion - Proyecto de capacitación docente en la Universidad Be...
Fase de planificacion - Proyecto de capacitación docente en la Universidad Be...Servicio de Rentas Internas
 
Copia de consulta de exelavatar
Copia de consulta de exelavatarCopia de consulta de exelavatar
Copia de consulta de exelavatarsusanatieneunraton
 
Conociendo el viejo mundo
Conociendo el viejo mundoConociendo el viejo mundo
Conociendo el viejo mundoleito0715
 
Inauguración Biblioteca
Inauguración BibliotecaInauguración Biblioteca
Inauguración Bibliotecabiei
 
Mitos y Creencias Religiosas Relacionadas a Donación de Órganos en Estudia...
Mitos y Creencias Religiosas  Relacionadas a  Donación de Órganos en  Estudia...Mitos y Creencias Religiosas  Relacionadas a  Donación de Órganos en  Estudia...
Mitos y Creencias Religiosas Relacionadas a Donación de Órganos en Estudia...Ximena Cabezas
 
Perfil profesional[321]
Perfil profesional[321]Perfil profesional[321]
Perfil profesional[321]marinlema
 
Costos fabricacion ronald
Costos fabricacion ronaldCostos fabricacion ronald
Costos fabricacion ronaldChalioBatres
 
Generacion del 27
Generacion del 27Generacion del 27
Generacion del 27txuribeltza
 
Taller de los_sentidos
Taller de los_sentidosTaller de los_sentidos
Taller de los_sentidoscapicua7
 
Lección 17 maticez de colores
Lección 17 maticez de coloresLección 17 maticez de colores
Lección 17 maticez de coloresHOJA1
 
Diapositivas con canción
Diapositivas con canciónDiapositivas con canción
Diapositivas con canciónkvethslc
 

Viewers also liked (20)

Programas 5º 2009
Programas 5º 2009Programas 5º 2009
Programas 5º 2009
 
Diapositivas insertar texto
Diapositivas insertar textoDiapositivas insertar texto
Diapositivas insertar texto
 
Mantenimiento de la salud en las personas mayores
Mantenimiento de la salud en las personas mayoresMantenimiento de la salud en las personas mayores
Mantenimiento de la salud en las personas mayores
 
LOS DISPoSITIVOS MÓVILES COMO HERRAMIENTAS EDUCATIVAS EN LA ENSEÑANZA DEL IDI...
LOS DISPoSITIVOS MÓVILES COMO HERRAMIENTAS EDUCATIVAS EN LA ENSEÑANZA DEL IDI...LOS DISPoSITIVOS MÓVILES COMO HERRAMIENTAS EDUCATIVAS EN LA ENSEÑANZA DEL IDI...
LOS DISPoSITIVOS MÓVILES COMO HERRAMIENTAS EDUCATIVAS EN LA ENSEÑANZA DEL IDI...
 
Fase de planificacion - Proyecto de capacitación docente en la Universidad Be...
Fase de planificacion - Proyecto de capacitación docente en la Universidad Be...Fase de planificacion - Proyecto de capacitación docente en la Universidad Be...
Fase de planificacion - Proyecto de capacitación docente en la Universidad Be...
 
Copia de consulta de exelavatar
Copia de consulta de exelavatarCopia de consulta de exelavatar
Copia de consulta de exelavatar
 
Meditaciones.4pdf
Meditaciones.4pdfMeditaciones.4pdf
Meditaciones.4pdf
 
Conociendo el viejo mundo
Conociendo el viejo mundoConociendo el viejo mundo
Conociendo el viejo mundo
 
Inauguración Biblioteca
Inauguración BibliotecaInauguración Biblioteca
Inauguración Biblioteca
 
IBIO
IBIOIBIO
IBIO
 
Mitos y Creencias Religiosas Relacionadas a Donación de Órganos en Estudia...
Mitos y Creencias Religiosas  Relacionadas a  Donación de Órganos en  Estudia...Mitos y Creencias Religiosas  Relacionadas a  Donación de Órganos en  Estudia...
Mitos y Creencias Religiosas Relacionadas a Donación de Órganos en Estudia...
 
Perfil profesional[321]
Perfil profesional[321]Perfil profesional[321]
Perfil profesional[321]
 
Costos fabricacion ronald
Costos fabricacion ronaldCostos fabricacion ronald
Costos fabricacion ronald
 
Generacion del 27
Generacion del 27Generacion del 27
Generacion del 27
 
Taller de los_sentidos
Taller de los_sentidosTaller de los_sentidos
Taller de los_sentidos
 
Jing!
Jing!Jing!
Jing!
 
Lección 17 maticez de colores
Lección 17 maticez de coloresLección 17 maticez de colores
Lección 17 maticez de colores
 
Metal live forever
Metal live foreverMetal live forever
Metal live forever
 
Las telecomunicaciones
Las telecomunicacionesLas telecomunicaciones
Las telecomunicaciones
 
Diapositivas con canción
Diapositivas con canciónDiapositivas con canción
Diapositivas con canción
 

Similar to Manual Tecnico OGG Oracle to MySQL

0396 oracle-goldengate-12c-tutorial
0396 oracle-goldengate-12c-tutorial0396 oracle-goldengate-12c-tutorial
0396 oracle-goldengate-12c-tutorialKlausePaulino
 
Extreme replication at IOUG Collaborate 15
Extreme replication at IOUG Collaborate 15Extreme replication at IOUG Collaborate 15
Extreme replication at IOUG Collaborate 15Bobby Curtis
 
Oracle Enterprise Manager 12c - OEM12c Presentation
Oracle Enterprise Manager 12c - OEM12c PresentationOracle Enterprise Manager 12c - OEM12c Presentation
Oracle Enterprise Manager 12c - OEM12c PresentationFrancisco Alvarez
 
MySQL Webinar 2/4 Performance tuning, hardware, optimisation
MySQL Webinar 2/4 Performance tuning, hardware, optimisationMySQL Webinar 2/4 Performance tuning, hardware, optimisation
MySQL Webinar 2/4 Performance tuning, hardware, optimisationMark Swarbrick
 
Maa goldengate-rac-2007111
Maa goldengate-rac-2007111Maa goldengate-rac-2007111
Maa goldengate-rac-2007111pablitosax
 
Remote DBA Experts 11g Features
Remote DBA Experts 11g FeaturesRemote DBA Experts 11g Features
Remote DBA Experts 11g FeaturesRemote DBA Experts
 
Upgrade Oracle Database to 12c
Upgrade Oracle Database to 12c Upgrade Oracle Database to 12c
Upgrade Oracle Database to 12c Osama Mustafa
 
DOAG 2016 Oracle Logon Security
DOAG 2016 Oracle Logon SecurityDOAG 2016 Oracle Logon Security
DOAG 2016 Oracle Logon SecurityLoopback.ORG
 
Maruthi_YH_resume
Maruthi_YH_resumeMaruthi_YH_resume
Maruthi_YH_resumeMaruthi YH
 
Oracle database edition-12c
Oracle database edition-12cOracle database edition-12c
Oracle database edition-12cAsha BG
 
maa-goldengate-rac-2007111.pdf
maa-goldengate-rac-2007111.pdfmaa-goldengate-rac-2007111.pdf
maa-goldengate-rac-2007111.pdfChandan Bose
 
A MySQL Odyssey - A Blackhole Crossover
A MySQL Odyssey - A Blackhole CrossoverA MySQL Odyssey - A Blackhole Crossover
A MySQL Odyssey - A Blackhole CrossoverKeith Hollman
 
Sfrac on oracle_vm_with_npiv_whitepaper_sol
Sfrac on oracle_vm_with_npiv_whitepaper_solSfrac on oracle_vm_with_npiv_whitepaper_sol
Sfrac on oracle_vm_with_npiv_whitepaper_solNovonil Choudhuri
 
Best practices oracle_clusterware_session355_wp
Best practices oracle_clusterware_session355_wpBest practices oracle_clusterware_session355_wp
Best practices oracle_clusterware_session355_wpwardell henley
 
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expre...
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expre...Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expre...
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expre...Alex Zaballa
 

Similar to Manual Tecnico OGG Oracle to MySQL (20)

0396 oracle-goldengate-12c-tutorial
0396 oracle-goldengate-12c-tutorial0396 oracle-goldengate-12c-tutorial
0396 oracle-goldengate-12c-tutorial
 
Extreme replication at IOUG Collaborate 15
Extreme replication at IOUG Collaborate 15Extreme replication at IOUG Collaborate 15
Extreme replication at IOUG Collaborate 15
 
My sql 5.6&MySQL Cluster 7.3
My sql 5.6&MySQL Cluster 7.3My sql 5.6&MySQL Cluster 7.3
My sql 5.6&MySQL Cluster 7.3
 
MySQL Shell for DBAs
MySQL Shell for DBAsMySQL Shell for DBAs
MySQL Shell for DBAs
 
Oracle Enterprise Manager 12c - OEM12c Presentation
Oracle Enterprise Manager 12c - OEM12c PresentationOracle Enterprise Manager 12c - OEM12c Presentation
Oracle Enterprise Manager 12c - OEM12c Presentation
 
MySQL Webinar 2/4 Performance tuning, hardware, optimisation
MySQL Webinar 2/4 Performance tuning, hardware, optimisationMySQL Webinar 2/4 Performance tuning, hardware, optimisation
MySQL Webinar 2/4 Performance tuning, hardware, optimisation
 
Maa goldengate-rac-2007111
Maa goldengate-rac-2007111Maa goldengate-rac-2007111
Maa goldengate-rac-2007111
 
Oracle-11g-upgrade
Oracle-11g-upgradeOracle-11g-upgrade
Oracle-11g-upgrade
 
Remote DBA Experts 11g Features
Remote DBA Experts 11g FeaturesRemote DBA Experts 11g Features
Remote DBA Experts 11g Features
 
Upgrade Oracle Database to 12c
Upgrade Oracle Database to 12c Upgrade Oracle Database to 12c
Upgrade Oracle Database to 12c
 
DOAG 2016 Oracle Logon Security
DOAG 2016 Oracle Logon SecurityDOAG 2016 Oracle Logon Security
DOAG 2016 Oracle Logon Security
 
Maruthi_YH_resume
Maruthi_YH_resumeMaruthi_YH_resume
Maruthi_YH_resume
 
Oracle database edition-12c
Oracle database edition-12cOracle database edition-12c
Oracle database edition-12c
 
maa-goldengate-rac-2007111.pdf
maa-goldengate-rac-2007111.pdfmaa-goldengate-rac-2007111.pdf
maa-goldengate-rac-2007111.pdf
 
A MySQL Odyssey - A Blackhole Crossover
A MySQL Odyssey - A Blackhole CrossoverA MySQL Odyssey - A Blackhole Crossover
A MySQL Odyssey - A Blackhole Crossover
 
Sfrac on oracle_vm_with_npiv_whitepaper_sol
Sfrac on oracle_vm_with_npiv_whitepaper_solSfrac on oracle_vm_with_npiv_whitepaper_sol
Sfrac on oracle_vm_with_npiv_whitepaper_sol
 
PHP Oracle
PHP OraclePHP Oracle
PHP Oracle
 
Best practices oracle_clusterware_session355_wp
Best practices oracle_clusterware_session355_wpBest practices oracle_clusterware_session355_wp
Best practices oracle_clusterware_session355_wp
 
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expre...
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expre...Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expre...
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expre...
 
MOHAMMED VIKHAR AHMED
MOHAMMED VIKHAR AHMEDMOHAMMED VIKHAR AHMED
MOHAMMED VIKHAR AHMED
 

Recently uploaded

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Recently uploaded (20)

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Manual Tecnico OGG Oracle to MySQL

  • 1. Replicación de Base de datos Oracle hacia MySQL Oracle Golden Gate 11gR2 Este documento contiene los pasos necesarios para lograr realizar replicación Heterogenia entre la base de datos Oracle y MySQL 2016 Erick Vidal 17/04/2016
  • 2. [REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS] gt.linkedin.com/in/erickvidal/ @vidbaz CONTENIDO Entorno ......................................................................................................................................................................................................3 Instalación..................................................................................................................................................................................................3 Source Database (Oracle 11gR2)............................................................................................................................................................3 Target Database (MySQL) ......................................................................................................................................................................7 Carga Inicial..............................................................................................................................................................................................11 Source Database (Oracle) ....................................................................................................................................................................11 Target Database (MySQL) ....................................................................................................................................................................14 Source Database (Oracle) ....................................................................................................................................................................14 Target Database (MySQL) ....................................................................................................................................................................14 Capturar los Cambios (replicación en línea) ............................................................................................................................................15 Source Database (Oracle) ....................................................................................................................................................................15 Target Database (MySQL) ....................................................................................................................................................................16 Source Database (Oracle) ....................................................................................................................................................................17 Target Database (MySQL) ....................................................................................................................................................................17 Anexos......................................................................................................................................................................................................18 Ejemplo de Archivo defgen..................................................................................................................................................................18
  • 3. [REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS] gt.linkedin.com/in/erickvidal/ @vidbaz MANUAL DE PROCEDIMIENTOS ENTORNO A continuación se realizara la replicación heterogénea entre la bases de datos Oracle y MySQL por medio de la herramienta Oracle Golden Gate. Inicialmente se debe tener instalado ambos motores de bases de datos en diferentes servidores, para poder realizar dicha replicación, posteriormente se realiza la carga inicial y finalizando con el proceso de cambios en línea. La infraestructura básica del hardware a utilizar se muestra a continuación: INSTALACIÓN SOURCE DATABASE (ORACLE 11GR2) 1. Descargar Oracle Golden Gate para Linux http://edelivery.oracle.com/ 2. Descomprimir en el directorio que se utilizara como home de la instalación #Creación del directorio donde se realizara la instalación [oracle@terminal.vidbaz ~]$ mkdir /u01/app/oracle/gg_orcl_source #ingreso del directorio en en profile de linux, para facilidad de acceso (Opcional) [oracle@terminal.vidbaz ~]$ vi .bash_profile [oracle@terminal.vidbaz ~]$ cd $GG_HOME [oracle@terminal.vidbaz gg_orcl_source]$ pwd Oracle DB: ORCL IP:192.168.56.102 SH: PRDAPP Mysql DB: ORCL IP:192.168.56.103 SH: PRDAPP
  • 4. [REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS] gt.linkedin.com/in/erickvidal/ @vidbaz /u01/app/oracle/gg_orcl_source #Descompresion del binario de OGG [oracle@terminal.vidbaz gg_orcl_source]$ unzip V34339-01.zip Archive: V34339-01.zip inflating: fbo_ggs_Linux_x64_ora11g_64bit.tar inflating: Oracle_GoldenGate_11.2.1.0.3_README.doc inflating: Oracle GoldenGate_11.2.1.0.3_README.txt inflating: OGG_WinUnix_Rel_Notes_11.2.1.0.3.pdf [oracle@terminal.vidbaz gg_orcl_source]$ tar -xvof fbo_ggs_Linux_x64_ora11g_64bit.tar 3. Ingresar a la consola de GoldenGate GGSCI (GoldenGate Software Command Interface) [oracle@terminal.vidbaz gg_orcl_source]$ . oraenv ORACLE_SID = [oracle] ? orcl The Oracle base has been set to /u01/app/oracle [oracle@terminal.vidbaz gg_orcl_source]$ ./ggsci Oracle GoldenGate Command Interpreter for Oracle Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21 Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved. 4. Ahora se deberán crear los Directorios que utilizara GoldenGate para la ejecución GGSCI (terminal.vidbaz.com.gt) 1> create subdirs Creating subdirectories under current directory /u01/app/oracle/gg_orcl_source Parameter files /u01/app/oracle/gg_orcl_source/dirprm: already exists Report files /u01/app/oracle/gg_orcl_source/dirrpt: created Checkpoint files /u01/app/oracle/gg_orcl_source/dirchk: created Process status files /u01/app/oracle/gg_orcl_source/dirpcs: created SQL script files /u01/app/oracle/gg_orcl_source/dirsql: created Database definitions files /u01/app/oracle/gg_orcl_source/dirdef: created Extract data files /u01/app/oracle/gg_orcl_source/dirdat: created Temporary files /u01/app/oracle/gg_orcl_source/dirtmp: created Stdout files /u01/app/oracle/gg_orcl_source/dirout: created GGSCI (terminal.vidbaz.com.gt) 3> exit 5. Verificando que los directorios estén creados [oracle@terminal.vidbaz gg_orcl_source]$ ls -ltrd dir* drwxr-x--- 2 oracle oinstall 4096 Aug 23 2012 dirprm drwxr-x--- 2 oracle oinstall 4096 Aug 23 2012 dirjar
  • 5. [REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS] gt.linkedin.com/in/erickvidal/ @vidbaz drwxrwxr-x 2 oracle oinstall 4096 Apr 14 00:29 dirtmp drwxrwxr-x 2 oracle oinstall 4096 Apr 14 00:29 dirsql drwxrwxr-x 2 oracle oinstall 4096 Apr 14 00:29 dirrpt drwxrwxr-x 2 oracle oinstall 4096 Apr 14 00:29 dirpcs drwxrwxr-x 2 oracle oinstall 4096 Apr 14 00:29 dirout drwxrwxr-x 2 oracle oinstall 4096 Apr 14 00:29 dirdef drwxrwxr-x 2 oracle oinstall 4096 Apr 14 00:29 dirdat drwxrwxr-x 2 oracle oinstall 4096 Apr 14 00:29 dirchk 6. Luego de la creación de los directorios se deberá preparar las tablas que se replicaran de la base de datos destino, para este ejemplo se utilizar las tablas que traen de ejemplo el software de OGG. Primero se deberá crear el esquema que contendrá las tablas a ser replicadas y posteriormente se creara el usuario de OGG el cual será el encargado de comunicar OGG a la base de datos Oracle. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options SQL> CREATE USER PRDAPP IDENTIFIED BY oracle DEFAULT TABLESPACE users QUOTA UNLIMITED ON users; 2 3 User created. SQL> GRANT DBA TO PRDAPP; Grant succeeded. SQL> connect prdapp/oracle Connected. SQL>-- creación del usuario de OGG SQL> CREATE USER GGUSER IDENTIFIED BY oracle DEFAULT TABLESPACE users QUOTA UNLIMITED ON users; GRANT DBA TO GGUSER; 2 3 User created. SQL> SQL> Grant succeeded. SQL>
  • 6. [REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS] gt.linkedin.com/in/erickvidal/ @vidbaz 7. A continuación se ejecutaran los scripts de demostración @demo_ora_create.sql y @demo_ora_insert.sql SQL> connect prdapp/oracle Connected. SQL> @demo_ora_create.sql DROP TABLE tcustmer * ERROR at line 1: ORA-00942: table or view does not exist Table created. DROP TABLE tcustord * ERROR at line 1: ORA-00942: table or view does not exist Table created. SQL> @demo_ora_insert.sql 1 row created. 1 row created. 1 row created. 1 row created. Commit complete. SQL> select * from tcustmer; CUST NAME CITY ST ---- ------------------------------ -------------------- -- WILL BG SOFTWARE CO. SEATTLE WA JANE ROCKY FLYER INC. DENVER CO SQL> select * from tcustord;
  • 7. [REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS] gt.linkedin.com/in/erickvidal/ @vidbaz CUST ORDER_DAT PRODUCT_ ORDER_ID PRODUCT_PRICE PRODUCT_AMOUNT TRANSACTION_ID ---- --------- -------- ---------- ------------- -------------- -------------- WILL 30-SEP-94 CAR 144 17520 3 100 JANE 11-NOV-95 PLANE 256 133300 1 100 8. Posteriormente se deberá iniciar el proceso MANAGER, el cual es el encargado de gestionar y monitorear los demás procesos de OGG, para mayor información visitar Oracle® GoldenGate Windows and UNIX Administrator’s Guide 11g Release 2 (Oracle, 2012) [oracle@terminal.vidbaz gg_orcl_source]$ ./ggsci Oracle GoldenGate Command Interpreter for Oracle Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258_FBO Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 20:20:21 Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved. GGSCI (terminal.vidbaz.com.gt) 1> info all Program Status Group Lag at Chkpt Time Since Chkpt MANAGER STOPPED GGSCI (terminal.vidbaz.com.gt) 2> edit params mgr #se deberá editar el archive de parámetros de manager indicando el Puerto PORT 7809 GGSCI (terminal.vidbaz.com.gt) 3> start manager Manager started. GGSCI (terminal.vidbaz.com.gt) 4> info mgr Manager is running (IP port terminal.vidbaz.com.gt.7809). GGSCI (terminal.vidbaz.com.gt) 5> exit TARGET DATABASE (MYSQL) 9. Se deberá descargar los binarios de GoldenGate para la base de datos MySQL de igual forma se puede descargar de Oracle Software Delivery Cloud, se deberá descomprimir en el directorio donde se desea instalar OGG
  • 8. [REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS] gt.linkedin.com/in/erickvidal/ @vidbaz [root@terminal.vidbaz gg_orcl_target]# unzip V32399-01.zip Archive: V32399-01.zip inflating: ggs_Linux_x64_MySQL_64bit.tar inflating: OGG_WinUnix_Rel_Notes_11.2.1.0.1.pdf inflating: Oracle GoldenGate 11.2.1.0.1 README.txt inflating: Oracle GoldenGate 11.2.1.0.1 README.doc [root@terminal.vidbaz gg_orcl_target]# tar -xvof ggs_Linux_x64_MySQL_64bit.tar 10. Se deberá crear la variable de entorno GG_HOME para su fácil acceso, posteriormente ingresar a la consola GGSCI, y crear los directorios necesarios para la configuración de GoldenGate (los pasos son iguales que cuando se configuro la base de datos fuente. root@terminal.vidbaz gg_orcl_target]# ./ggsci Oracle GoldenGate Command Interpreter for MySQL Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230 Linux, x64, 64bit (optimized), MySQL Enterprise on Apr 23 2012 04:34:25 Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved. GGSCI (terminal.vidbaz.com.gt) 1> create subdirs Creating subdirectories under current directory /u01/app/oracle/gg_orcl_target Parameter files /u01/app/oracle/gg_orcl_target/dirprm: already exists Report files /u01/app/oracle/gg_orcl_target/dirrpt: created Checkpoint files /u01/app/oracle/gg_orcl_target/dirchk: created Process status files /u01/app/oracle/gg_orcl_target/dirpcs: created SQL script files /u01/app/oracle/gg_orcl_target/dirsql: created Database definitions files /u01/app/oracle/gg_orcl_target/dirdef: created Extract data files /u01/app/oracle/gg_orcl_target/dirdat: created Temporary files /u01/app/oracle/gg_orcl_target/dirtmp: created Stdout files /u01/app/oracle/gg_orcl_target/dirout: created GGSCI (terminal.vidbaz.com.gt) 2> exit [root@terminal.vidbaz gg_orcl_target]# ls -ltrd dir* drwxr-x---. 1 root root 20 Apr 23 2012 dirprm drwxr-x---. 1 root root 2758 Apr 23 2012 dirjar drwxrwxr-x. 1 root root 0 Apr 14 10:36 dirsql drwxrwxr-x. 1 root root 0 Apr 14 10:36 dirrpt drwxrwxr-x. 1 root root 0 Apr 14 10:36 dirpcs drwxrwxr-x. 1 root root 0 Apr 14 10:36 dirdef drwxrwxr-x. 1 root root 0 Apr 14 10:36 dirdat drwxrwxr-x. 1 root root 0 Apr 14 10:36 dirchk drwxrwxr-x. 1 root root 0 Apr 14 10:36 dirtmp
  • 9. [REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS] gt.linkedin.com/in/erickvidal/ @vidbaz drwxrwxr-x. 1 root root 0 Apr 14 10:36 dirout [root@terminal.vidbaz gg_orcl_target]# ./ggsci 11. Editar el Puerto del manager, he iniciar dicho proceso. [root@terminal.vidbaz gg_orcl_target]# ./ggsci Oracle GoldenGate Command Interpreter for MySQL Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230 Linux, x64, 64bit (optimized), MySQL Enterprise on Apr 23 2012 04:34:25 Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved. GGSCI (terminal.vidbaz.com.gt) 1> edit params mgr #configurar el Puerto 7809 PORT 7809 GGSCI (terminal.vidbaz.com.gt) 2> start mgr Manager started. GGSCI (terminal.vidbaz.com.gt) 3> info mgr Manager is running (IP port terminal.vidbaz.com.gt.7809). GGSCI (terminal.vidbaz.com.gt) 4> exit 12. Ingresar a MySQL y crear la base de datos, que en este ejemplo se llamara orcl mysql> CREATE DATABASE orcl; Query OK, 1 row affected (0.00 sec) mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | orcl | | test | +--------------------+ 4 rows in set (0.00 sec) mysql> use orcl
  • 10. [REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS] gt.linkedin.com/in/erickvidal/ @vidbaz Database changed 13. Crear y asignar permisos al usuario de base de datos por el cual GoldenGate tendrá acceso a la misma mysql> CREATE USER 'ogguser'@'localhost' IDENTIFIED BY 'oracle'; Query OK, 0 rows affected (0.00 sec) mysql> GRANT ALL PRIVILEGES ON * . * TO 'ogguser'@'localhost'; Query OK, 0 rows affected (0.00 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) mysql> exit Bye 14. Crear las tablas que serán replicadas desde la base de datos Oracle [root@terminal.vidbaz gg_orcl_target]# mysql orcl -uogguser -poracle < demo_mysql_create.sql mysql> describe TCUSTMER; +-----------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-----------+-------------+------+-----+---------+-------+ | CUST_CODE | varchar(4) | NO | PRI | NULL | | | NAME | varchar(30) | YES | | NULL | | | CITY | varchar(20) | YES | | NULL | | | STATE | char(2) | YES | | NULL | | +-----------+-------------+------+-----+---------+-------+ 4 rows in set (0.01 sec) mysql> describe tcustord; ERROR 1146 (42S02): Table 'orcl.tcustord' doesn't exist mysql> describe TCUSTORD; +----------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------------+--------------+------+-----+---------+-------+ | CUST_CODE | varchar(4) | NO | PRI | NULL | | | ORDER_DATE | datetime | NO | PRI | NULL | | | PRODUCT_CODE | varchar(8) | NO | PRI | NULL | | | ORDER_ID | int(11) | NO | PRI | NULL | | | PRODUCT_PRICE | decimal(8,2) | YES | | NULL | | | PRODUCT_AMOUNT | int(11) | YES | | NULL | | | TRANSACTION_ID | float | YES | | NULL | | +----------------+--------------+------+-----+---------+-------+ 7 rows in set (0.00 sec)
  • 11. [REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS] gt.linkedin.com/in/erickvidal/ @vidbaz mysql> CARGA INICIAL El método que se utilizara para realizar la carga inicial es la carga directa a través de GoldenGate, para volúmenes grandes de información, se recomienda utilizar Bulk, Data Pump, entre otros. A continuación se muestra un esquema de la carga Inicial (Initail-Load): SOURCE DATABASE (ORACLE) 15. Comprobar la conexión hacia la base de datos por medio del comando DBLOGIN, y posteriormente activar el supplemental logging a las tablas que se estarán replicando GGSCI (terminal.vidbaz.com.gt) 2> dblogin userid gguser, password oracle Successfully logged into database. GGSCI (terminal.vidbaz.com.gt) 3> add trandata prdapp.tcustmer Logging of supplemental redo data enabled for table PRDAPP.TCUSTMER. GGSCI (terminal.vidbaz.com.gt) 4> add trandata prdapp.tcustord Logging of supplemental redo data enabled for table PRDAPP.TCUSTORD. GGSCI (terminal.vidbaz.com.gt) 5> info trandata prdapp.tcust* Logging of supplemental redo log data is enabled for table PRDAPP.TCUSTMER. Columns supplementally logged for table PRDAPP.TCUSTMER: CUST_CODE. Logging of supplemental redo log data is enabled for table PRDAPP.TCUSTORD. Columns supplementally logged for table PRDAPP.TCUSTORD: CUST_CODE, ORDER_DATE, PRODUCT_CODE, ORDER_ID. GGSCI (terminal.vidbaz.com.gt) 6> exit [oracle@terminal.vidbaz gg_orcl_source]$ (Fuente: Oracle® GoldenGate Administering Oracle GoldenGate)
  • 12. [REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS] gt.linkedin.com/in/erickvidal/ @vidbaz 16. Posteriormente agregar el proceso extract y editar el archivo de parámetros del mismo GGSCI (terminal.vidbaz.com.gt) 1> add extract EINIORCL, sourceistable EXTRACT added. GGSCI (terminal.vidbaz.com.gt) 2> info extract *, tasks EXTRACT EINIORCL Initialized 2016-04-14 12:31 Status STOPPED Checkpoint Lag Not Available Log Read Checkpoint Not Available First Record Record 0 Task SOURCEISTABLE GGSCI (terminal.vidbaz.com.gt) 4> edit params EINIORCL -- -- Archivo de Carga Inicial -- EXTRACT EINIORCL USERID GGUSER, PASSWORD oracle RMTHOST terminal.vidbaz.com.gt, MGRPORT 7809 RMTTASK REPLICAT, GROUP RINIORCL TABLE PRDAPP.TCUSTMER; TABLE PRDAPP.TCUSTORD; GGSCI (terminal.vidbaz.com.gt) 5> 17. Debido a que se esta realizando una replicacion heterogenea se debera generar un archive de parametros en la base de datos fuente que posteriormente se pasara a la base de datos destino GGSCI> EDIT PARAM DEFGEN DEFSFILE ./dirdef/source.def, PURGE USERID gguser, PASSWORD oracle TABLE PRDAPP.TCUSTMER; TABLE PRDAPP.TCUSTORD; [oracle@terminal.vidbaz gg_orcl_source]$ ./defgen paramfile ./dirprm/defgen.prm *********************************************************************** Oracle GoldenGate Table Definition Generator for Oracle Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258 Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 16:58:29
  • 13. [REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS] gt.linkedin.com/in/erickvidal/ @vidbaz Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved. Starting at 2016-04-14 17:19:14 *********************************************************************** Operating System Version: Linux Version #1 SMP Wed Feb 22 17:37:40 EST 2012, Release 2.6.32-300.10.1.el5uek Node: terminal.vidbaz.com.gt Machine: x86_64 soft limit hard limit Address Space Size : unlimited unlimited Heap Size : unlimited unlimited File Size : unlimited unlimited CPU Time : unlimited unlimited Process id: 24505 *********************************************************************** ** Running with the following parameters ** *********************************************************************** DEFSFILE ./dirdef/source.def, PURGE USERID gguser, PASSWORD ****** TABLE PRDAPP.TCUSTMER; Retrieving definition for PRDAPP.TCUSTMER TABLE PRDAPP.TCUSTORD; Retrieving definition for PRDAPP.TCUSTORD Definitions generated for 2 tables in ./dirdef/source.def 18. Enviar archivo de parámetros de definición a base de datos target [oracle@terminal.vidbaz gg_orcl_source]$ scp ./dirdef/source.def root@192.168.1.66:/u01/app/oracle/gg_orcl_target/dirdef/ root@192.168.1.66's password: source.def
  • 14. [REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS] gt.linkedin.com/in/erickvidal/ @vidbaz TARGET DATABASE (MYSQL) 19. Agregar el Archivo Replicate (en el cual ya contiene la información del archivo de parámetros de definición generado en source a través de la herramienta defgen) GGSCI (terminal.vidbaz.com.gt) 1> ADD REPLICAT RINIORCL, SPECIALRUN GGSCI (terminal.vidbaz.com.gt) 2> INFO REPLICAT *, TASKS GGSCI (terminal.vidbaz.com.gt) 3> EDIT PARAMS RINIORCL -- -- Change Delivery parameter file for -- TCUSTMER and TCUSTORD changes -- REPLICAT RINIORCL TARGETDB orcl@localhost, USERID OGGUSER, PASSWORD oracle SOURCEDEFS ./dirdef/source.def DISCARDFILE ./dirrpt/RINIORCL.dsc, PURGE MAP PRDAPP/TCUSTMER, TARGET ORCL.TCUSTMER; MAP PRDAPP/TCUSTORD, TARGET ORCL.TCUSTORD; SOURCE DATABASE (ORACLE) 20. Iniciar el proceso de carga inicial GGSCI (terminal.vidbaz.com.gt) 1> start extract EINIORCL Sending START request to MANAGER ... EXTRACT EINIORCL starting TARGET DATABASE (MYSQL) 21. Verificar el reporte de la carga inicial para ver que no haya ocurrido ningún error. GGSCI (terminal.vidbaz.com.gt) 1> view report riniorcl Ver resultado de reporte en Anexos 22. Verificar que en las tablas de mysql se encuentre la información cargada. mysql> select * from TCUSTMER; +-----------+------------------+---------+-------+ | CUST_CODE | NAME | CITY | STATE | +-----------+------------------+---------+-------+
  • 15. [REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS] gt.linkedin.com/in/erickvidal/ @vidbaz | JANE | ROCKY FLYER INC. | DENVER | CO | | WILL | BG SOFTWARE CO. | SEATTLE | WA | +-----------+------------------+---------+-------+ 2 rows in set (0.00 sec) mysql> select * from TCUSTORD; +-----------+---------------------+--------------+----------+---------------+----------------+----------------+ | CUST_CODE | ORDER_DATE | PRODUCT_CODE | ORDER_ID | PRODUCT_PRICE | PRODUCT_AMOUNT | TRANSACTION_ID | +-----------+---------------------+--------------+----------+---------------+----------------+----------------+ | JANE | 1995-11-11 13:52:00 | PLANE | 256 | 133300.00 | 1 | 100 | | WILL | 1994-09-30 15:33:00 | CAR | 144 | 17520.00 | 3 | 100 | +-----------+---------------------+--------------+----------+---------------+----------------+----------------+ 2 rows in set (0.00 sec) mysql> CAPTURAR LOS CAMBIOS (REPLICACIÓN EN LÍNEA) Ahora se configura el proceso de extracción de los datos en tiempo real, lo cual permitirá la replicación automática de la información de la base de datos Oracle hacia MySQL. SOURCE DATABASE (ORACLE) 23. Agregando el proceso extract, verificando su creación y editando los parámetros GGSCI> ADD EXTRACT EORAORCL, TRANLOG, BEGIN NOW GGSCI> INFO EXTRACT EORAORCL GGSCI> EDIT PARAMS EORAORCL -- -- Change Capture parameter file to capture -- TCUSTMER and TCUSTORD Changes -- EXTRACT EORAORCL USERID gguser, PASSWORD oracle (Fuente: Oracle® GoldenGate Administering Oracle GoldenGate)
  • 16. [REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS] gt.linkedin.com/in/erickvidal/ @vidbaz RMTHOST 192.168.56.103, MGRPORT 7809 TRANLOGOPTIONS ASMUSER sys@ASM, ASMPASSWORD oracle_4U RMTTRAIL ./dirdat/lt TABLE PRDAPP.TCUSTMER; TABLE PRDAPP.TCUSTORD; 24. Ahora se agrega remote trail, recordando que en esta configuración no se hará un trail local sino que la información será enviada a través de la red hacia el servidor destino, por eso la razón de crear el remote trail. GGSCI> ADD RMTTRAIL ./dirdat/lt, EXTRACT EORAORCL, MEGABYTES 5 --verificando los resultados: GGSCI> INFO RMTTRAIL * TARGET DATABASE (MYSQL) 25. Creando la tabla de Checkpoint, para esto se edita los parámetros de GLOBALS. GGSCI> EDIT PARAMS ./GLOBALS CHECKPOINTTABLE orcl.ggschkpt GGSCI> DBLOGIN SOURCEDB orcl@localhost USERID ogguser, PASSWORD oracle GGSCI> ADD CHECKPOINTTABLE 26. Agregar proceso de replicación GGSCI> ADD REPLICAT RMSQORCL, EXTTRAIL ./dirdat/lt GGSCI> EDIT PARAM RMSQORCL -- -- Change Delivery parameter file to apply -- TCUSTMER and TCUSTORD Changes -- REPLICAT RMSQORCL TARGETDB orcl@localhost, USERID ogguser, PASSWORD oracle HANDLECOLLISIONS SOURCEDEFS ./dirdef/source.def DISCARDFILE ./dirrpt/RMSQORCL.DSC, PURGE MAP PRDAPP.TCUSTMER, TARGET orcl.TCUSTMER; MAP PRDAPP.TCUSTORD, TARGET orcl.TCUSTORD;
  • 17. [REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS] gt.linkedin.com/in/erickvidal/ @vidbaz SOURCE DATABASE (ORACLE) 27. Iniciar el proceso de replicación y verificar resultados GGSCI> START EXTRACT EORAORCL --verificar resultados: GGSCI> INFO EXTRACT EORAORCL, DETAIL GGSCI> VIEW REPORT EORAORCL GGSCI (terminal.vidbaz.com.gt) 3> info all Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING EXTRACT RUNNING EORAORCL 00:00:00 00:00:03 TARGET DATABASE (MYSQL) 28. De igual forma en mysql iniciar el proceso y verificar resultados GGSCI> START REPLICAT RMSQORCL --Verificando los resultados: GGSCI> INFO REPLICAT RMSQORCL GGSCI (terminal.vidbaz.com.gt) 3> info all Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING REPLICAT RUNNING RMSQORCL 00:00:00 00:00:00
  • 18. [REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS] gt.linkedin.com/in/erickvidal/ @vidbaz ANEXOS EJEMPLO DE ARCHIVO DEFGEN [oracle@terminal.vidbaz gg_orcl_source]$ ./defgen paramfile ./dirprm/defgen.prm *********************************************************************** Oracle GoldenGate Table Definition Generator for Oracle Version 11.2.1.0.3 14400833 OGGCORE_11.2.1.0.3_PLATFORMS_120823.1258 Linux, x64, 64bit (optimized), Oracle 11g on Aug 23 2012 16:58:29 Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved. Starting at 2016-04-14 17:19:14 *********************************************************************** Operating System Version: Linux Version #1 SMP Wed Feb 22 17:37:40 EST 2012, Release 2.6.32-300.10.1.el5uek Node: terminal.vidbaz.com.gt Machine: x86_64 soft limit hard limit Address Space Size : unlimited unlimited Heap Size : unlimited unlimited File Size : unlimited unlimited CPU Time : unlimited unlimited Process id: 24505 *********************************************************************** ** Running with the following parameters ** *********************************************************************** DEFSFILE ./dirdef/source.def, PURGE USERID gguser, PASSWORD ****** TABLE PRDAPP.TCUSTMER; Retrieving definition for PRDAPP.TCUSTMER TABLE PRDAPP.TCUSTORD; Retrieving definition for PRDAPP.TCUSTORD Definitions generated for 2 tables in ./dirdef/source.def [oracle@terminal.vidbaz gg_orcl_source]$ cat ./dirdef/source.def *+- Defgen version 2.0, Encoding UTF-8 * * Definitions created/modified 2016-04-14 17:19 * * Field descriptions for each column entry: * * 1 Name * 2 Data Type * 3 External Length * 4 Fetch Offset
  • 19. [REPLICACIÓN DE BASE DE DATOS ORACLE HACIA MYSQL] [MANUAL DE PROCEDIMIENTOS] gt.linkedin.com/in/erickvidal/ @vidbaz * 5 Scale * 6 Level * 7 Null * 8 Bump if Odd * 9 Internal Length * 10 Binary Length * 11 Table Length * 12 Most Significant DT * 13 Least Significant DT * 14 High Precision * 15 Low Precision * 16 Elementary Item * 17 Occurs * 18 Key Column * 19 Sub Data Type * Database type: ORACLE Character set ID: UTF-8 National character set ID: UTF-16 Locale: neutral Case sensitivity: 14 14 14 14 14 14 14 14 14 14 14 14 11 14 14 14 * Definition for table PRDAPP.TCUSTMER Record length: 78 Syskey: 0 Columns: 4 CUST_CODE 64 4 0 0 0 1 0 4 4 0 0 0 0 0 1 0 1 0 NAME 64 30 10 0 0 1 0 30 30 0 0 0 0 0 1 0 0 0 CITY 64 20 46 0 0 1 0 20 20 0 0 0 0 0 1 0 0 0 STATE 0 2 72 0 0 1 0 2 2 0 0 0 0 0 1 0 0 0 End of definition * Definition for table PRDAPP.TCUSTORD Record length: 182 Syskey: 0 Columns: 7 CUST_CODE 64 4 0 0 0 1 0 4 4 0 0 0 0 0 1 0 1 0 ORDER_DATE 192 19 10 0 0 1 0 19 19 19 0 5 0 0 1 0 1 0 PRODUCT_CODE 64 8 32 0 0 1 0 8 8 0 0 0 0 0 1 0 1 0 ORDER_ID 64 50 46 0 0 1 0 50 50 50 0 0 0 0 1 0 1 2 PRODUCT_PRICE 134 10 102 2 0 1 0 8 8 8 0 0 0 0 1 0 0 3 PRODUCT_AMOUNT 134 8 114 0 0 1 0 8 8 8 0 0 0 0 1 0 0 3 TRANSACTION_ID 64 50 126 0 0 1 0 50 50 50 0 0 0 0 1 0 0 2 End of definition [oracle@terminal.vidbaz gg_orcl_source]$