Practices for Lesson 7: Overview Practices Overview
Practice 7-2: Configuring Data Capture Overview
In this practice, you reuse the primary Extract EUEVT and the Data Pump PUEVT, which were defined in the practices for Lesson 5, “Oracle GoldenGate Event Marker System.” To complete the capture configuration, you use the defgen utility to create column definitions that will be used by the delivery Extract on the replication target to map the database columns into Java data types.
Tasks
1. Open a shell window and use the oggsrc alias to change the directory to
/u03/ogg/ogg_src. Launch GGSCI and create (or edit, if it still exists in the dirprm directory) the EUEVT primary Extract parameter file, which captures all table activity in the src_user schema. Note that we want to change the format of the trail file to the (lower) Oracle GoldenGate version of the target environment (11.2). To force the Extract to write a trail file that follows specifications different from the default, the directive "Format
Release <major>.<minor>" must be used when specifying the trail file in the Extract parameter file:
[OS prompt]$ oggsrc [OS prompt]$ pwd /u03/ogg/ogg_src [OS prompt]$ ggsci
Oracle GoldenGate Command Interpreter for Oracle Version 12.1.2.1.0
OGGCORE_12.1.2.1.0_PLATFORMS_140727.2135.1_FBO
Linux, x64, 64bit (optimized), Oracle 12c on Aug 7 2014 10:21:34
Operating system character set identified as UTF-8.
Copyright (C) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
GGSCI ([SRCHOST]) > edit params euevt Extract euevt
Exttrail ./dirdat/eu, format release 11.2 UseridAlias ogg_admin
LOGALLSUPCOLS
tranlogoptions integratedparams (max_sga_size 128) SOURCECATALOG ogg1
Table src_user.*;
Oracle University and Error : You are not a Valid Partner use only
2. Exit from the editor after saving the parameter file. In GGSCI, log in to the database and register and add the newly created Extract:
GGSCI ([SRCHOST]) > DBLogin UserIdAlias ogg_admin Successfully logged into database CDB$ROOT.
GGSCI ([HOST] as C##OGG_ADMIN@CDB12c/CDB$ROOT) > Register Extract EUEVT Database Container (ogg1)
Extract EUEVT successfully registered with database at SCN 3079294.
GGSCI ([HOST] as C##OGG_ADMIN@CDB12c/CDB$ROOT) > add extract euevt, Integrated Tranlog, begin now
EXTRACT added.
3. Connect the Extract to the ExtTrail, setting the exttrail file size to 10 MB:
GGSCI ([HOST] as C##OGG_ADMIN@CDB12c/CDB$ROOT) > add exttrail ./dirdat/eu, Extract euevt, megabytes 10
EXTTRAIL added.
4. Add the Data Pump Extract puevt, which physically transfers the captured data to the target host. Note that you specify remote port 7709, which is where the Java Adapter instance is listening for incoming Oracle GoldenGate connections. Also, note that you do not specify the catalog name (SOURCECATOLOG ogg1) like you did in the primary Extract.
If you do, the Data Pump Extract would abend because the eu trail fail has already been
"downgraded" by EUEVT and it has lost all references to the ogg1 container:
GGSCI ([HOST] as C##OGG_ADMIN@CDB12c/CDB$ROOT) > edit params puevt
Extract puevt
SETENV (ORACLE_SID='CDB12c') rmthost ogg_target, mgrport 7709
rmttrail ./dirdat/pu, format release 11.2 passthru
table src_user.*;
5. Connect the Data Pump to the local exttrail file:
GGSCI ([HOST] as C##OGG_ADMIN@CDB12c/CDB$ROOT) > add extract puevt, exttrailsource ./dirdat/eu
EXTRACT added.
6. Connect the remote trail file to the Data Pump, setting the remote trail file size to 10 MB:
GGSCI ([HOST] as C##OGG_ADMIN@CDB12c/CDB$ROOT) > add rmttrail ./dirdat/pu, Extract puevt, megabytes 10
RMTTRAIL added.
7. Start the Extract and Data Pump processes, check their status, and exit from GGSCI:
GGSCI ([HOST] as C##OGG_ADMIN@CDB12c/CDB$ROOT) > start extract euevt
Sending START request to MANAGER ...
EXTRACT EUEVT starting
Oracle University and Error : You are not a Valid Partner use only
GGSCI ([HOST] as C##OGG_ADMIN@CDB12c/CDB$ROOT) > start extract puevt
Sending START request to MANAGER ...
EXTRACT PUEVT starting
GGSCI ([HOST] as C##OGG_ADMIN@CDB12c/CDB$ROOT) > info all Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EUEVT 00:00:00 00:41:39 EXTRACT RUNNING PUEVT 00:00:00 00:00:06
8. Create the javadef parameter file, which will be provided to the defgen utility. Note that for the defgen definitions also, you must force a format downgrade from 12c to 11g using the FORMAT RELEASE directive:
GGSCI ([HOST] as C##OGG_ADMIN@CDB12c/CDB$ROOT) > Edit Param javadef
-- defgen column definitions for tables in src_user.
UserIdAlias ogg_admin
defsfile ./dirdef/jmsdef.def format release 11.2 SOURCECATALOG ogg1
table src_user.economic_entity;
table src_user.gdp_by_year;
table src_user.gdp_growth_by_year;
9. Save the file and exit the editor. Exit GGSCI and, at the OS prompt, invoke the defgen utility:
([HOST] as C##OGG_ADMIN@CDB12c/CDB$ROOT) > Exit [OS prompt]$ ./defgen paramfile dirprm/javadef.prm
**********************************************************************
Oracle GoldenGate Table Definition Generator for Oracle Version 12.1.2.1.0 OGGCORE_12.1.2.1.0_PLATFORMS_140727.2135.1 Linux, x64, 64bit (optimized), Oracle 12c on Aug 7 2014 03:26:23 Copyright (C) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
Starting at 2015-03-25 23:34:53
**********************************************************************
Operating System Version:
Linux
Version #2 SMP Wed Jan 28 17:03:28 PST 2015, Release 3.8.13-55.1.5.el6uek.x86_64
Node: host01.localdomain Machine: x86_64
Oracle University and Error : You are not a Valid Partner use only
Address Space Size : unlimited unlimited Heap Size : unlimited unlimited File Size : unlimited unlimited CPU Time : unlimited unlimited Process id: 33571
**************************************************************
** Running with the following parameters
**
**************************************************************
UserIdAlias ogg_admin
defsfile ./dirdef/jmsdef.def SOURCECATALOG ogg1
table src_user.economic_entity;
Default source catalog name ogg1 will be used for table specification src_user.economic_entity.
Retrieving definition for SRC_USER.ECONOMIC_ENTITY.
table src_user.gdp_by_year;
Default source catalog name ogg1 will be used for table specification src_user.gdp_by_year.
Retrieving definition for SRC_USER.GDP_BY_YEAR.
table src_user.gdp_growth_by_year;
Default source catalog name ogg1 will be used for table specification src_user.gdp_growth_by_year.
Retrieving definition for SRC_USER.GDP_GROWTH_BY_YEAR.
Definitions generated for 3 tables in ./dirdef/jmsdef.def.
10. Copy the definition file to its target directory, the dirprm directory under /u03/ogg/oggjms_trg:
[OS prompt]$ pwd /home/oracle/ggs_src
[OS prompt]$ cp dirdef/jmsdef.def /u03/ogg/oggjms_trg/dirdef [OS prompt]$ ls -l /u03/ogg/oggjms_trg/dirdef
total 4
-rw-r---. 1 oracle oinstall 1828 Mar 26 00:12 jmsdef.def [OS prompt]$
This completes Practice 7-2. Continue with Practice 7-3.