Professional Documents
Culture Documents
Use This Student Guideฺ: Oracle Goldengate 12C: Fundamentals For Oracle
Use This Student Guideฺ: Oracle Goldengate 12C: Fundamentals For Oracle
Use This Student Guideฺ: Oracle Goldengate 12C: Fundamentals For Oracle
e to
cens
l i
a ble
fe r
n
Oracle GoldenGate
a s 12c:
t r
on-
Fundamentals for Oracle
s a n eฺ
) haActivity
u idGuide
ฺ c om ent G
s s on tud
e ric this S
n a g@ use
itฺ
( s uj
a g
N
S ujit
D84357GC10
Edition 1.0
January 2014
D85202
Author Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
publish, license, post, transmit, or distribute this document in whole or in part without
Joseph deBuzna the express authorization of Oracle.
Pete Daly
The information contained in this document is subject to change without notice. If you
Joe Greenwald find any problems in the document, please report them in writing to: Oracle University,
500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not
Steven George warranted to be error-free.
Susan Jang
Restricted Rights Notice
Naoki Kato
Juan Quezada Nunez If this documentation is delivered to the United States Government or anyone using
the documentation on behalf of the United States Government, the following notice is
e to
Randy Richeson applicable:
ce ns
Doug Reid l i
Ranbir Singh
U.S. GOVERNMENT RIGHTS
a b le
The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or
fe r
disclose these training materials are restricted by the terms of the applicable Oracle
Jinyu Wang
n s
license agreement and/or the applicable U.S. Government contract.
a
Volker Zell
Trademark Notice
n- t r
a no
Editors
h a s ideฺ
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names
may be trademarks of their respective owners.
Aju Kumar
m ) G u
Richard Wallis o
ฺc den t
o n
r i c ss s Stu
hi
Graphic Designer
@ e t
Seema Bopaiah
ag us e
t ฺ n
( s uji
Publishers
g
jit NaPavithran Adka
Su
Jayanthy Keshavamurthy
Srividya Rameshkumar
Table of Contents
Practices for Lesson 1: Introduction ..............................................................................................................1-1
Practices for Lesson 1....................................................................................................................................1-2
Practices for Lesson 2: Technology Overview ..............................................................................................2-1
Practices for Lesson 2....................................................................................................................................2-2
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ
g@
Practice 7-2: Setting Up Replicat .....................................................................................................7-5
a Data and s
u e GoldenGate Processes..............................................................7-7
n
Practice 7-3: Generating Starting
itฺ Processes and Checking Statistics ............................................................................7-12
Practice 7-4:jStopping
s u
( for Lesson 8: Extract Trail and Files..............................................................................................8-1
g
Practices
a
j i t NPractices for Lesson 8: Overview...................................................................................................................8-2
S u Practice 8-1: Using the logdump Utility ..........................................................................................................8-3
Practices for Lesson 9: Configuring Initial Load...........................................................................................9-1
Practices for Lesson 9: Overview ...................................................................................................................9-2
Practice 9-1: Setting Up the Initial Load by Using the File to Replicat Method...............................................9-3
Practice 9-2: Setting Up the Initial Data Load by Using the Direct Load Method ...........................................9-8
Practice 9-3: Putting it All Together ................................................................................................................9-13
Practice 9-4: Converting from Classic Mode to Integrated Mode ...................................................................9-18
Practices for Lesson 10: Oracle GoldenGate Parameters ............................................................................10-1
Practices for Lesson 10: Overview .................................................................................................................10-2
Practice 10-1: Modifying Source Manager Parameters ..................................................................................10-3
Practice 10-2: Modifying the Target Manager Parameters .............................................................................10-5
Practice 10-3: Modifying the Extract Parameters on the Source Database....................................................10-7
Practices for Lesson 11: Data Selection and Filtering..................................................................................11-1
Practices for Lesson 11: Overview .................................................................................................................11-2
Practice 11-1: Increasing Performance by Splitting Replication Loads ..........................................................11-3
Practice 11-2: Increasing Performance by Coordinated Applies ....................................................................11-11
s a eฺ
A New Innovative Continuous m ) h Learning
a
G u id Solution
o ent
ฺclearned
Ideal for supplementing whatoyou n u d in the classroom
s s t
e ric this S
n a g@ use
s u jitฺ
a g(
N
S ujit
e to
cens
l i
a ble
fe r
a n s
Practices for n t r
-Lesson 1:
n o
a eฺ
Introduction
s
) a
h 1 uid
ฺ c om ent G
Chapter
s s on tud
e ric this S
n a g@ use
u jitฺ
g ( s
Na
S ujit
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
e to
cens
l i
a ble
fe r
a n s
Practices for n t r
-Lesson 2:
n o
Technology
s a eOverview
ฺ
h a
) 2Gu i d
o m
c dent
Chapter
n ฺ
c s so Stu
e ri this
n a g@ use
u jitฺ
g ( s
Na
S ujit
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
e to
cens
l i
a ble
fe r
a n s
Practices for n t r
-Lesson 3:
n o
Oracle s aGoldenGate
eฺ
) h a u
Architecture i d
o m t G
o n ฺc Chapter
d e n3
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
e to
cens
l i
a ble
fe r
a n s
Practices for n t r
-Lesson 4:
n o
Installing
s a Oracle
e ฺ GoldenGate
a
) h 4Gui d
m
co dent
Chapter
n ฺ
c s so Stu
e ri this
n a g@ use
u jitฺ
g ( s
Na
S ujit
AMER and EURO databases. The software zip file is already downloaded and staged. Then you
are briefly introduced to the command-line interface (GGSCI).
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
steps describe how to connect to each of your databases and also provide more details about
the users and tables that you will be working with.
Each database has administrative users, such as system, as well as other users created
specifically for this course. The data tables that you create and populate in the AMER database
that you use in this course are owned by the WEST user. Conversely, the data tables in the EURO
database are owned by the EAST user.
Even though there is only one PC for each practice team, there are two host names defined in
the /etc/hosts file: easthost and westhost. You should be able to ping both hosts, and e to
you should use those names in place of localhost so that you can clearly indicate to yourself
cens
l i
source and target hosts.
a ble
To connect to the AMER database as the system user by using SQL*Plus, enter the following
fe r
command at the operating system prompt:
a ns
[OS_prompt ~] sqlplus system@amer
n- t r
no
The password for all database accounts for this course is oracle_4U.
a
h a s ideฺ
m ) G u
Operating System o
ฺc den t
o n
Type
r i c ss s Stu Linux
@ e
e t hi
<userid>
t ฺ n ag us oracle
( s uji
<password> oracle
N ag
jit
Su
AMER Database (Source)
<login> west
<password> oracle_4U
<oracle_sid> amer
$GG_AMER_HOME /u01/app/oracle/product/gg_amer
<login> east
<password> oracle_4U
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ
<oracle_sid> euro
$GG_EURO_HOME /u01/app/oracle/product/gg_euro
GoldenGate
e to
cens
<software location> /stage
l i
a ble
GoldenGate <install location - source> /u01/app/oracle/product/gg_amer
fe r
a n s
GoldenGate <install location - target>
n -t r
/u01/app/oracle/product/gg_euro
o
s a n eฺ
1. To set up your working environment, create )terminal ha windowsu id to make it easier to navigate
between the source and target databases:
ฺ c om ent G
a. Log in to your designated Linux
s s on machine
t u d with the following information:
1) Username: oracle
e ric this S
2) Password:
n a g@oracle u s e
2. Verify that
u j itฺa local copy of the documentation is accessible on your PC.
s
gb.a. ( Start
Go to the Linux desktop.
N a Adobe Reader. (Click its launcher icon.)
jit
Su c. Click File > Open and select the Release Notes in /home/oracle/Documents, that
is, ggate12c_release_notes_e40012.pdf. This is only to verify that you have a
working set of documentation.
d. Close the Release Notes, but leave Adobe Reader running minimized. You will need it
later, but not now.
3. Set up your terminal environment.
a. Double-click the Terminal icon located on your Linux desktop.
e to
cens
l i
e. Set the name of the terminal tabs from left to right to be AMER_WEST_SQLPLUS,
a ble
AMER_WEST_GGSCI, EURO_EAST_SQLPLUS, EURO_EAST_GGSCI, and nothing for the fe r
last one (which will dynamically show the current directory). It should look similar toa ns
this: n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
N a
S ujit
Leave these terminal tabs open for the entire course.
4. On the fifth (unnamed) tab, unzip the OGG installation files from the stage directory into the
temp directory.
oracle@somehost ~ _
[OS_prompt ~] cd /tmp
[OS_prompt tmp] mkdir ogg
[OS_prompt tmp] cd ogg
[OS_prompt tmp] unzip /stage/1212*
[OS_prompt tmp] cd fbo*
[OS_prompt tmp] cd Disk1
[OS_prompt tmp] ls
install response runInstaller stage
[OS_prompt ~] cd $GG_EURO_HOME
[OS prompt gg_euro] pwd
/u01/app/oracle/product/gg_euro
[OS prompt gg_euro] . oraenv
ORACLE_SID = [amer] ? euro
The Oracle base remains unchanged with value /u01/app/oracle
Note: The first time, you must change the value to euro. But if you ever run the command
e to
again in the same window or on the same tab, you can accept euro without change by
cens
pressing Enter. l i
a ble
This completes Practice 4-1. Continue now with Practice 4-2.
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
Assumptions
The interchangeability of the databases assumes that they are not currently running any GGSCI
commands.
Tasks
1. How you invoke GGSCI depends on the settings in your profile. On the fifth tab
oracle@hostname, from the /home/oracle directory, review the .bashrc file. Make
e to
certain that the ORACLE_HOME, GG_AMER_HOME, and GG_EURO_HOME system
cens
environment variables are set to the correct directories. The Oracle GoldenGate processes l i
refer to them when connecting to the database. If the appropriate settings have been
a ble
included, you can invoke GGSCI directly from the command line. fe r
a ns
[OS_prompt] more ~/.bashrc
n- t r
no
# .bashrc
ss
]; then s S
# Source global definitions
i c tu
e r
if [ -f /etc/bashrc
t hi
fi @
. /etc/bashrc
ag us e
t ฺ n
( s uji
ORACLE_BASE=/u01/app/oracle
ag ORACLE_HOME=${ORACLE_BASE}/product/12.1.0/dbhome_1
N GG_AMER_HOME=${ORACLE_BASE}/product/gg_amer
ujit
GG_EURO_HOME=${ORACLE_BASE}/product/gg_euro
S GG_DS_HOME=${ORACLE_BASE}/product/gg_director_server
GG_DC_HOME=${ORACLE_BASE}/product/gg_director_client
GG_MONI_HOME=${ORACLE_BASE}/product/gg_moni
JAVA_HOME=/usr/java/jdk1.7.0_40
PATH=${JAVA_HOME}/bin:${ORACLE_HOME}/bin:${GG_AMER_HOME}:${GG_EURO_HOME}:${PAT
H}:${HOME}/bin
LD_LIBRARY_PATH=${JAVA_HOME}/jre/lib/amd64/server/:${ORACLE_HOME}/lib
ORACLE_SID=amer
PATH=${ORACLE_HOME}/bin:${PATH}:${LD_LIBRARY_PATH}
CLASSPATH=${ORACLE_HOME}/jdbc/lib/ojdbc7.jar:${ORACLE_HOME}/jlib/orai18n.jar
export PATH
export ORACLE_BASE ORACLE_HOME ORACLE_SID GG_AMER_HOME GG_EURO_HOME
export GG_DC_HOME GG_DS_HOME GG_MONI_HOME
export CLASSPATH LD_LIBRARY_PATH JAVA_HOME
[OS_prompt]
Note: Make sure the PATH= statement is all on one line. Some of the Management
Pack variables for Director and Monitor are set as well. They are not used in this
course.
e to
GGSCI (AMER) 1>
cens
l i
3. View a HELP summary for all commands:
a ble
GGSCI (AMER) 1> Help
fe r
a n s
GGSCI Command Summary:
n- t r
a no
Object: Command:
h a s ideฺ
SUBDIRS CREATE
m ) G u
DATASTORE
o t
ALTER, CREATE, DELETE, INFO, REPAIR
ฺc den
ER
o n
INFO, KILL, LAG, SEND, STATUS, START, STATS, STOP
EXTRACT
r i c ss s Stu
ADD, ALTER, CLEANUP, DELETE, INFO, KILL,
@ e t hi
LAG, REGISTER, SEND, START, STATS, STATUS, STOP
e
t ฺ n ag us UNREGISTER
uji
EXTTRAIL ADD, ALTER, DELETE, INFO
( s
GGSEVT
g JAGENT
VIEW
ujit
MANAGER INFO, SEND, START, STOP, STATUS
S MARKER
PARAMS
INFO
EDIT, VIEW
REPLICAT ADD, ALTER, CLEANUP, DELETE, INFO, KILL, LAG, SEND,
START, STATS, STATUS, STOP, SYNCHRONIZE
REPORT VIEW
RMTTRAIL ADD, ALTER, DELETE, INFO
TRACETABLE ADD, DELETE, INFO
TRANDATA ADD, DELETE, INFO
SCHEMATRANDATA ADD, DELETE, INFO
CHECKPOINTTABLE ADD, DELETE, CLEANUP, INFO, UPGRADE
WALLET CREATE, OPEN, PURGE
MASTERKEY ADD, INFO, RENEW, DELETE, UNDELETE
CREDENTIALSTORE ADD, ALTER, INFO, DELETE
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
e to
cens
l i
a ble
fe r
a n s
Practices for n t r
-Lesson 5:
n o
a eฺ Overview and
Configuration
s
) h a
Preparing u idthe Environment
ฺ c om ent G
s s on tuChapter
d 5
e ric this S
n a g@ use
u jitฺ
g ( s
Na
S ujit
of Oracle GoldenGate. Oracle GoldenGate provides log-based change data capture (CDC) and
replication of committed database transactions. The software provides capture, routing,
transformation, and delivery of transactional data across heterogeneous environments in real
time.
Big Picture
The following figure depicts the simplified Oracle GoldenGate implementation that you create. In
this practice, you create the objects that are shaded (source database, target database, and
mgr.prm files):
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
Note: Some parts of the screenshot feedback may be in a smaller font for clarity. However, the
commands that you should type are always indicated by full-sized, bold monospace font.
Assumptions
Two core databases are already installed: AMER and EURO. The AMER database (the source
database) has the west/oracle_4U user already created, and the EURO database has the
east/oracle_4U user also already created. In this practice, you run the
source_database.sql script on the AMER database and the target_database.sql script
on the EURO database. Both of these scripts create the following tables: e to
• cens
ACCOUNT
l i
• ACCOUNT_TRANS
a ble
• fe r
BRANCH
a ns
• TELLER
n- t r
• TELLER_TRANS
a no
• BRANCH_ATM
h a s ideฺ
m
The data tables in the AMER database are owned ) by the G u user. The data tables in the EURO
WEST
database are owned by the EAST user. ฺc o e n t
o n d
tu with oraenv for amer and euro. The
r i c ss variables
You have already set the environment
s S
e t hi
SQL*Plus tabs are in the /home/oracle/labs
@ e
working directory.
t ฺ n ag us
utojithe AMER_WEST_SQLPLUS tab. To create the source database for AMER, at the
Tasks
( s
1. Switch
N agOS prompt, issue the following command:
S ujit [OS_prompt labs] ls Section5/sqlscripts/
seed_database.sql source_database.sql target_database.sql
[OS_prompt labs] sqlplus west@amer/oracle_4U
@Section5/sqlscripts/source_database.sql
SQL*Plus: Release 12.1.0.1.0 Production on Wed Nov 20 13:42:30 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Last Successful login time: Tue Nov 19 2013 12:39:20 +00:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing
options
Table dropped.
... many lines omitted for clarity ...
As with many Oracle PL/SQL scripts, a first attempt to drop a non-existent table gives an
“error” that the table or view does not exist. For these setup scripts, you can ignore those
messages.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing
options
Table truncated.
... many lines omitted for clarity ...
e to
ns
3. To create the data tables on the EURO database, on the EURO_EAST_SQLPLUS tab,
execute the following commands:
l i ce
[OS_prompt labs] sqlplus east@euro/oracle_4U
a b le
@Section5/sqlscripts/target_database.sql
fe r
a n s
SQL*Plus: Release 12.1.0.1.0 Production on Wed Nov 20 13:50:54 2013
n- t r
no
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Last Successful login time: Wed Nov 06 2013 13:58:56 +00:00
a
s ideฺ
Connected to:
h a
) Analytics
Releaseu12.1.0.1.0 - 64bit Production
m t G and Real Application Testing
Oracle Database 12c Enterprise Edition
c
With the Partitioning, OLAP, Advanced
ฺ o e n
options
s s on tud
Table dropped.
e ic hisforS clarity ...
romitted
... many lines
g @ e t
Note that you ฺ s
nado not populate
u the target tables with SQL scripts; populating (replicating) will
j i t
u GoldenGate’s job.
be Oracle
4. g
( s
N a Don’t do this step―just read it! Create an Oracle GoldenGate user that can connect to
ujit
the source and target databases for transactional data. An Oracle GoldenGate user
S requires a database user with at least the following privileges:
User Privilege Extract (Source Side) Replicat (Target Side)
CREATE SESSION, ALTER X X
SESSION
RESOURCE X X
SELECT ANY DICTIONARY X X
FLASHBACK ANY TABLE X
or
FLASHBACK ON <owner.table>
SELECT ANY TABLE X X
or
SELECT ON <owner.table>
INSERT, UPDATE, DELETE ON X
<target tables>
CREATE TABLE X
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
u j itฺ
db_name string amer
SQL> exit
The separate tablespace is required only for the DDL replication in Practice 15; otherwise,
the user could be anywhere.
s u j
ALTER DATABASE FORCE LOGGING;
g (c. To ensure that the redo and archive logs contain supplemental log data, switch the
N a logs by executing the following commands:
Database altered.
Database altered.
Overview
On the target side, Replicat checkpoints to a table in the database that is defined in a special
parameter file named GLOBALS. The file name must be all UPPERCASE with no extension. In
this practice, you create a GLOBALS parameter file located on the target database (EURO).
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ
Tasks
1. On the EURO_EAST_GGSCI tab, create a GLOBALS parameter file by executing the
following commands. The oraenv variables should already be set.
[OS_prompt ~] cd $GG_EURO_HOME
[OS_prompt gg_euro] gedit GLOBALS
2. Start gedit (or vi if you prefer) to open a new GLOBALS file located in the directory of
e to
your Oracle GoldenGate instance. Add the following runtime parameters to the GLOBALS
cens
file, which you use in a later practice: l i
CheckpointTable GGS_CHECKPOINT a ble
fe r
3. Save and close the file.
a ns
Note: There is no harm or benefit in creating a GLOBALS file on the source side as well;
n- t r
no
however, it is not necessary at this time. Other Oracle GoldenGate products, such as
a
h a s ideฺ
Monitor from the Management Pack, also make use of the GLOBALS file.
) u
This completes Practice 5-2. Continue now with Practice 5-3.
m G
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
N a
S ujit
• Listens for incoming connectivity requests from Extract or Extract data pump
• Performs housekeeping functions to delete any consumed Oracle GoldenGate trails
Tasks
1. The first task is to configure and stop/restart the Manager processes on both the source
and target. On the AMER_WEST_GGSCI tab, GGSCI should still be started from a previous
lab. If so, skip to step 2; if not, do the following:
e to
[OS_prompt ~] cd $GG_AMER_HOME
cens
[OS_prompt gg_amer] . oraenv
l i
ORACLE_SID = [amer] ?
a ble
The Oracle base remains unchanged with value /u01/app/oracle
fe r
[OS_prompt gg_amer] rlggsci
a ns
Oracle GoldenGate Command Interpreter for Oracle
n- t r
no
Version 12.1.2.0.0 17185003 OGGCORE_12.1.2.0.0_PLATFORMS_130924.1316_FBO
a
h a s ideฺ
Linux, x64, 64bit (optimized), Oracle 12c on Sep 25 2013 02:33:54
Operating system character set identified as UTF-8.
m ) G u
Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
o
ฺc den t
GGSCI (AMER) 1>
o n tueditor for this session, enter:
c ss thes text
2. (Optional) If you want to ichange
r S
GGSCI (AMER)> @ e hi gedit
eSet Editor
t
If you do not
t ฺ n agthis Set,uyou
do s get vi as the default editor for Linux. You cannot change the
ji editor.
startupudefault
s
3. ag
(
At the GGSCI prompt, enter:
N
S ujit 4.
GGSCI (AMER)> Edit Param mgr
The text editor starts and opens a new mgr.prm file. Add the following runtime parameter
to the mgr.prm file below the existing Port line (created by the installer):
Port 15000
PurgeOldExtracts ./dirdat/*, UseCheckpoints
Do not save it yet. You have another line to add.
5. Using the Oracle GoldenGate Reference Manual
(ggate12c_reference_oracle_e29392.pdf) located in ~/Documents, what
parameter is used to specify ports that Manager can allocate for dynamic communications?
a. Add that parameter to the mgr.prm file, defining the DynamicPortList range to be
15100 through 15150.
b. Save and close the file.
The results should look similar to the following: (Your host name and PID will be different.)
GGSCI (AMER)> Stop Manager
Manager process is required by other GGS processes.
Are you sure you want to stop it (y/n)? y
Sending STOP request to MANAGER ...
Request processed.
Manager stopped.
e to
GGSCI (AMER)> Start Manager
cens
Manager started.
l i
a ble
GGSCI (AMER)> Info Manager
fe r
Manager is running (IP port WESTHOST.15000, Process ID 7992).
a ns
GGSCI (AMER)> n- t r
a no
Notice that you can substitute mgr for Manager, and you can add an exclamation mark (!)
h a s ideฺ
at the end of the Stop command to suppress the “Are you sure?” prompt (useful for
scripts). m ) G u
o
ฺc den t
7. n
On the EURO_EAST_GGSCI tab, from the shell prompt positioned inside the Oracle
o
r i c ss s Stu
GoldenGate directory, invoke GGSCI. Execute the following commands:
e t hi
[OS_prompt ~] cd $GG_EURO_HOME
@ e
g us
[OS_prompt gg_euro] . oraenv
u jti ฺna
ORACLE_SID = [euro] ? euro
Overview
In this practice, you enable supplemental logging on the source database for the specified
tables. Before you can start capturing real-time data, the Oracle database must be set to log the
table key values whenever it logs a rows change, so that they are available to Oracle
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ
GoldenGate in Redo. By default, the database logs only those column values that change. This
is required so Oracle GoldenGate can locate the correct row on the target for update and delete
operations.
Tasks
1. You can add individual tables or use wildcards. On the AMER_WEST_GGSCI tab (the source
server), at the GGSCI prompt, enter the following:
GGSCI (AMER)> DBLogin UserID gguser@amer, Password oracle_4U
e to
GGSCI (AMER)> Add TranData WEST.ACCOUNT
cens
l i
GGSCI (AMER)> Add TranData WEST.*
a ble
The results should be similar to the following:
fe r
a ns
GGSCI (AMER)> DBLogin UserID gguser@amer, Password oracle_4U
n- t r
no
Successfully logged into database.
a
s ideฺ
GGSCI (AMER)> Add TranData WEST.ACCOUNT
) h a u
Logging of supplemental redo ฺc o m t G
n for table WEST.ACCOUNT.
o n datahas
TRANDATA for schedulingscolumns u d e
enabled
e ri this
GGSCI (AMER)>
a g @ seTranData WEST.*
Add
i t ฺ n u
j
u of supplemental redo log data is already enabled for table
g (sLogging
WEST.ACCOUNT.
N a
uj i t 2013-12-02 13:14:07 WARNING OGG-00706 Failed to add supplemental log group
S on table WEST.ACCOUNT due to ORA-32588: supplemental logging attribute primary
key exists SQL ALTER TABLE "WEST"."ACCOUNT" ADD SUPPLEMENTAL LOG DATA (PRIMARY
KEY, UNIQUE, FOREIGN KEY) COLUMNS /* GOLDENGATE_DDL_REPLICATION */.
each table:
GGSCI (AMER)> Info TranData WEST.*
The results should be similar to the following:
GGSCI (AMER)> Info TranData WEST.*
to
Columns supplementally logged for table WEST.ACCOUNT: ACCOUNT_NUMBER.
ns e
Logging of supplemental redo log data is enabled for table WEST.ACCOUNT_TRANS.
c e
Columns supplementally logged for table WEST.ACCOUNT_TRANS: TRANS_NUMBER,
b l e li
era
ACCOUNT_NUMBER, ACCOUNT_TRANS_TS.
s f
Logging of supplemental redo log data is enabled for table
t r anWEST.BRANCH.
Columns supplementally logged for table WEST.BRANCH: -BRANCH_NUMBER.
n on
s a for eฺ tableBRANCH_NUMBER,
Columns supplementally logged for table) h a
Logging of supplemental redo log data is enabled
u i d
WEST.BRANCH_ATM:
WEST.BRANCH_ATM.
o m t G
ฺc den
ATM_TRANS_TS, TRANS_NUMBER, ATM_NUMBER.
( s
Columns
g TELLER_TRANS_TS, TELLER_NUMBER.
N a
S ujit GGSCI (AMER)>
Leave all the GGSCI and SQL*Plus sessions running. Leave the five terminal tabs open.
This completes Practice 5-4. This completes the practices for Lesson 5. Stop here.
e to
cens
l i
a ble
fe r
a n s
Practices for n t r
-Lesson 6:
n o
a eฺChange Capture
Configuring
s
) a
h 6 uid
ฺ c om ent G
Chapter
s s on tud
e ric this S
n a g@ use
u jitฺ
g ( s
Na
S ujit
Big Picture
The following diagram shows the new objects that are created: Extract, ExtTrail, data pump
Extract, and RmtTrail.
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g is for
The ew extract trailaprefix
n u sExtractWest. The pe remote trail prefix is for PumpEast. This is
t ฺ
( s
name length.uji rather than a requirement. What is a requirement is the two-letter maximum
only a convention
N ag
S ujit
Overview
In this practice, you perform the following actions:
• Configure the primary Extract process that captures changes.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ
Tasks
1. You should still be logged in to GGSCI in the AMER instance from the previous lab. If so,
skip this task and proceed to task 2. If not, perform the following step. On the source server
(on the AMER_WEST_GGSCI tab), confirm that you are in the proper installation directory
and logged in to the database by using AMER SID. Start GGSCI by using the read-line
utility.
e to
[OS_prompt ~] cd $GG_AMER_HOME
cens
[OS_prompt gg_amer] . oraenv l i
[OS_prompt gg_amer] rlggsci
a ble
fe r
GGSCI (AMER) 1> DBLogin UserID gguser@amer, Password oracle_4U
a ns
Optionally, set the default text editor.
n- t r
2. no
On the AMER_WEST_GGSCI tab, add the wallet and credential store information (password)
a
a s ideฺ
for user gguser on both source and target systems. WARNING: Make sure that each
h
) u
Alter CredentialStore command is all on one line (cut and paste may make this
m G
difficult). o
ฺc den t
o n tu
i c ss 'dirwlt'.
GGSCI (AMER)> Create Wallet
Created wallet at rlocation s S
Opened wallet@
e t i
h'dirwlt'.
ag Add e
at location
u s
j
GGSCIi t ฺ n
(AMER)> CredentialStore
s u
ag ( Credential store created in ./dircrd/.
N
ujit
GGSCI (AMER)> Alter CredentialStore Add User gguser@amer
S Password oracle_4U Alias gguamer
Credential store in ./dircrd/ altered.
Alias: ggueuro
Userid: gguser@euro
GGSCI (AMER)>
S ujit 6. On the AMER_WEST_GGSCI tab, add a local extract trail that links the trail to the extwest
Extract:
GGSCI (AMER)> Add ExtTrail ./dirdat/ew, Extract extwest
This adds the dirdat/ew local extract trail, and links the trail to the extwest Extract
group. When the Extract is started, the dirdat/ew000000 file is created. When that file is
full, trail ew000001 is created, and so on through ew999999. Your results should be similar
to the following:
GGSCI (AMER)> Edit Param extwest
GGSCI (AMER)>
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
• Configure a data pump Extract to read the local trail and create a remote trail on the
target.
• Add the remote trail.
• Start the two Extract processes.
Tasks
1. On the AMER_WEST_GGSCI tab, at the GGSCI prompt on the source server, configure the
Extract data pump to read from the dirdat/ew local extract trail, transmit the data to the
e to
target server (EURO), and write it to the dirdat/pe remote trail:
cens
GGSCI> Edit Param pwest l i
a ble
2. Your text editor of choice opens the empty pwest.prm file. Add the following runtime
fe r
parameters to the text file:
a ns
Extract pwest
n- t r
RmtHost easthost, MgrPort 15001
a no
RmtTrail ./dirdat/pe
h a s ideฺ
Passthru
m ) G u
Table WEST.*; o
ฺc den t
o n tu
Make sure you include the one
r i c sstrailing
s Ssemicolon. Save and close the file.
3. Add the Extract groupe
@ t
by executing
e hi the following GGSCI commands:
t ฺ n ag Add
GGSCI (AMER)> u s Extract pwest, ExtTrailSource ./dirdat/ew
( s uji added.
EXTRACT
ag
N
ujit
GGSCI (AMER)> Add RmtTrail ./dirdat/pe, Extract pwest
S RMTTRAIL added.
GGSCI (AMER)>
4. Start the primary Extract process, extwest, by issuing the following command:
GGSCI (AMER)> Start Extract extwest
5. Start the data pump Extract process, pwest, by issuing the following command:
GGSCI (AMER)> Start Extract pwest
6. To verify the status of all Extracts and Replicats (ER), execute the command:
GGSCI (AMER)> Info ER *
Your results should look similar to the following:
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
e to
cens
l i
a ble
fe r
a n s
Practices for n t r
-Lesson 7:
n o
a eฺChange Delivery
Configuring
s
) a
h 7 uid
ฺ c om ent G
Chapter
s s on tud
e ric this S
n a g@ use
u jitฺ
g ( s
Na
S ujit
Big Picture
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
Assumptions
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ
It is assumed that you still have the five terminal tabs labeled and open from the previous labs.
Replicat checkpoints to this table in the database ensure that the Replicat checkpoint is part of
the transaction, and is used to ensure data integrity. For this step, you will create a special table
on the target server.
Tasks
1. GGSCI should still be running on the EURO_EAST_GGSCI tab from the previous labs. If so,
skip to the next task 2. If not, do the following task:
e to
[OS_prompt ~] cd $GG_EURO_HOME
cens
l i
[OS_prompt gg_euro] . oraenv
a ble
ORACLE_SID = [euro] ? euro
fe r
[OS_prompt gg_euro] rlggsci
a ns
GGSCI (EURO) 1> n- t r
2. a no
To create the checkpoint table, on the target server (on the EURO_EAST_GGSCI tab), from
h a s ideฺ
the installation directory, execute the following commands:
m ) G u
o t
GGSCI (EURO)> DBLogin UserIDAlias ggueuro
ฺc den
o n
Successfully logged into database.
r i c ss s Stu
@ e t hi
GGSCI (EURO)>eAdd CheckpointTable
n a
No checkpointg us
table specified. Using GLOBALS specification (GGS_CHECKPOINT)...
s u jitฺ
Successfully created checkpoint table GGS_CHECKPOINT.
GGSCI (EURO)>
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
Tasks
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ
1. On the target server EURO_EAST_GGSCI tab, make sure that the Wallet containing the
user IDs and passwords came over intact from the source host during the previous lab.
GGSCI (EURO)> Info CredentialStore
Reading from ./dircrd/:
Domain: OracleGoldenGate
to
Alias: gguamer
Userid: gguser@amer
ns e
l i ce
Alias: ggueuro
a ble
Userid: gguser@euro
fe r
a ns
GGSCI (EURO)>
n- t r
2. no
On the target EURO_EAST_GGSCI tab, execute the following command:
a
GGSCI (EURO)> Edit Param reast
h a s ideฺ
m )
Your text editor of choice opens the empty reast.prm
G ufile. (Remember, if you prefer some
editor other than the UNIX default ofฺc o t
vi, you cannissue the Set Editor gedit command
s o
for this session.) Add the followingn t
runtime u de
parameters to the text file:
c s
ri this S
Replicat reast e
n a g@ use
AssumeTargetDefs
j itฺ
DiscardFile
u
./dirrpt/reast.dsc, Purge
s
( --HandleCollisions
N ag --End Runtime
jit
Su UserIDAlias ggueuro
Map WEST.*, Target EAST.*;
The double-dashed (commented-out) lines are optional. Save and close the file.
3. On the target EURO_EAST_GGSCI tab, add the Replicat by executing the following
command:
GGSCI (EURO)> Add Replicat reast, ExtTrail ./dirdat/pe
REPLICAT added.
GGSCI (EURO)>
e to
GGSCI (EURO)>
cens
Your details (dates, times, and PIDs) will be different. If the Replicat is not Status l i
RUNNING, then examine the reports.
a ble
fe r
This completes Practice 7-2. Continue now with Practice 7-3.
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
N a
S ujit
Assumptions
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ
For the accounts created when you created the database, random transactions are executed:
point-of-sale debit card transactions, ATM deposits, ATM withdrawals, deposits with branch
tellers, and withdrawals at branch tellers. Another script will be used to simulate a real-time
banking system.
Tasks
1. On the AMER_WEST_GGSCI tab, view the status of the extwest Extract and the pwest
Data Pump Extract:
e to
GGSCI (AMER)> Info ER *
cens
l i
a ble
EXTRACT EXTWEST Last Started 2013-12-02 14:01 Status RUNNING
fe r
Checkpoint Lag 00:00:00 (updated 00:00:01 ago)
a ns
Process ID 24884
n- t r
Log Read Checkpoint Oracle Redo Logs
a no
2013-12-03 07:05:07 Seqno 234, RBA 26998272
h a s ideฺ
SCN 0.5911278 (5911278)
m ) G u
o
ฺc(updated
e t
n 14:01 Status RUNNING
EXTRACT PWEST
s o n
Last Started
t
2013-12-02
d
u 00:00:04 ago)
Checkpoint Lag
c s
00:00:00
S
ri Fileth./dirdat/ew000000
Process ID
e 24885
is
g@ usFirst
Log Read Checkpoint
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With Partitioning, OLAP, Advanced Analytics and Real Application Testing
options
'THEBEFORECOUNTFORWEST.BRANCHIS'||COUNT(*)
----------------------------------------------------------------------------
The BEFORE count for west.branch is 40
e to
1 row created.
cens
l i
...many lines omitted for clarity...
a ble
SQL>
fe r
Note the BEFORE count for the BRANCH table.
a n s
3. Return to the AMER_WEST_GGSCI tab and verify the results. n-
t r
Note: The RBA numbers should be increasing for theaExtract,
o
n but the pump should
stabilize.
h a s i d eฺ
GGSCI (AMER)> Info ER * m ) G u
o
ฺc 2013-12-02
e t
n 14:01 Status RUNNING
n
LastoStarted d
s Stu 00:00:01 ago)
EXTRACT EXTWEST
Checkpoint Lag
r i c s00:00:00
24884 is
(updated
Process ID
@ e Oracle th Redo Logs
a g
Log Read Checkpoint
u s e
ji t ฺ n 2013-12-03
SCN
07:05:07 Seqno 234, RBA 26998272
0.5911278 (5911278)
s u
a g ( EXTRACT PWEST Last Started 2013-12-02 14:01 Status RUNNING
N Checkpoint Lag 00:00:00 (updated 00:00:04 ago)
GGSCI (AMER)> !
EXTRACT EXTWEST Last Started 2013-12-02 14:01 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:04 ago)
Process ID 24884
Log Read Checkpoint Oracle Redo Logs
2013-12-03 07:21:49 Seqno 235, RBA 4100096
SCN 0.5912039 (5912039)
GGSCI (AMER)>
hi Redo07:30:08
Process ID 24884
@ e Oracle
Log Read Checkpoint t Logs
a g u s e
2013-12-03 Seqno 235, RBA 4248064
s u
a g ( EXTRACT PWEST Last Started 2013-12-02 14:01 Status RUNNING
Checkpoint Lag 00:00:00 (updated 00:00:07 ago)
i t N
uj
Process ID 24885
S Log Read Checkpoint File ./dirdat/ew000000
2013-12-03 07:15:19.000000 RBA 2299
GGSCI (AMER)> !
Info extwest
GGSCI (AMER)>
GGSCI (AMER)>
When Extract returns “At EOF, no more records to process,” then Extract has
captured all outstanding redo records.
6. On the AMER_WEST_SQLPLUS tab, execute the following command to get the row counts
e to
for the source BRANCH table:
cens
SQL> set sqlprompt AMER_SQL> l i
AMER_SQL> SELECT count(*) FROM west.branch;
a ble
fe r
COUNT(*)
a ns
----------
n- t r
43
a no
AMER_SQL> h a s ideฺ
m ) matchGtheunumbers above, but it is critical
n ฺ o
It is not critical that your numbers exactly
cthan when
d e nyout started.
that your number be three more
s o start tauSQL*Plus session for the east schema by
stab,
7. On the EURO_EAST_SQLPLUS
executing the following e c
command
s S that rlsqlplus gives you edit history):
ri thi(remember
[OS_prompt
n a g@ u
labs] s e
rlsqlplus east@euro/oracle_4U
j i t ฺ
( s u
If rlsqlplus is already running, then simply connect to the new user:
COUNT(*)
----------
3
EURO_SQL>
count-mismatch is not a problem and you will get to the initial load in a later practice.
This completes Practice 7-3. Continue now with Practice 7-4.
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
Assumptions
You have successfully completed the previous practices in this lab.
Tasks
1. On the fifth tab (oracle@hostname), use the text browser of your choice, such as more,
less, or gedit, to look at the three reports to see if there are any statistics about rows
processed:
e to
ns
[OS_prompt] more $GG_AMER_HOME/dirrpt/EXTWEST.rpt
[OS_prompt] more $GG_AMER_HOME/dirrpt/PWEST.rpt
l i ce
[OS_prompt] more $GG_EURO_HOME/dirrpt/REAST.rpt
a ble
The reports are interesting (barely) but contain no statistics. This is because the processes fe r
are still running. a ns
n- t r
no
2. On the source AMER_WEST_GGSCI tab, check for statistics:
GGSCI (AMER)> Stats extwest a
s ideฺ
h a
) ...Gu
m
Sending STATS request to EXTRACT EXTWEST
c dent
o
n ฺ
Start of Statistics at 2013-12-03 07:55:47.
so to SWEST.BRANCH:
Output to ./dirdat/ew:
s
Extracting from WEST.BRANCH
i c tu
r i s
e forthclarity...
@
...many lines omitted
agstatistics e
s since 2013-12-03 07:15:22 ***
t ฺ n u
ji Total inserts
*** Latest
a g 2.00
uj
Total discards 0.00
S Total operations
End of Statistics.
7.00
GGSCI (AMER)>
GGSCI (EURO)>
e to
These statistics should match the source and the target. cens
l i
4. On the EURO_EAST_GGSCI tab, stop the target processes:
a ble
GGSCI (EURO)> Stop * fe r
a ns
5. On the AMER_WEST_GGSCI tab, stop the source processes:
n- t r
GGSCI (AMER)> Stop *
a no
Note: Stopping with an asterisk does not stop the
h a sManager.
i d eฺ
6. On the fifth tab (oracle@hostname), look m ) the three
at G ureports again to see if there are now
any statistics about rows processed:ฺc o e n t
o n d
r i c ss s Stu
[OS_prompt] more $GG_AMER_HOME/dirrpt/EXTWEST.rpt
[OS_prompt] more
@ e hi
e $GG_AMER_HOME/dirrpt/PWEST.rpt
t
[OS_prompt]
t ฺ n ag more u s$GG_EURO_HOME/dirrpt/REAST.rpt
Instead
( s ujofi more, you can use any text editor or less. The reports now contain plenty of
a gstatistics. Find the section that has similar statistics as the Stats command gave:
N
ujit
***********************************************************************
S Oracle GoldenGate Capture for Oracle
Version 12.1.2.0.0 17185003 OGGCORE_12.1.2.0.0_PLATFORMS_130924.1316_FBO
Linux, x64, 64bit (optimized), Oracle 12c on Sep 25 2013 02:47:30
Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
Starting at 2013-12-02 14:01:16
***********************************************************************
...many lines omitted for clarity...
***********************************************************************
* ** Run Time Statistics ** *
***********************************************************************
Report at 2013-12-03 08:01:23 (activity since 2013-12-03 07:15:22)
Output to ./dirdat/ew:
From Table WEST.BRANCH:
# inserts: 4
# updates: 2
# deletes: 1
# discards: 0
...many lines omitted for clarity...
Each of the three reports contains slightly different information, but all three should contain
the above common statistics.
This completes Practice 7-4. This completes the practices for Lesson 7. Stop here.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
e to
cens
l i
a ble
fe r
a n s
Practices for n t r
-Lesson 8:
n o
Extract s aTraileฺand Files
) a
h 8 uid
ฺ c om ent G
Chapter
s s on tud
e ric this S
n a g@ use
u jitฺ
g ( s
Na
S ujit
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
Tasks
1. On the AMER_WEST_GGSCI tab, exit to the OS prompt, navigate to the source installation
directory $GG_AMER_HOME, and invoke logdump:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ
e to
Logdump 1 > help
cens
Issue the help command to display a list of all commands available in logdump. Similar to l i
GGSCI, there is no good way to make help or any other command pause.
a ble
fe r
2. In logdump, open the <install_path>/dirdat/<trail_id>000000 trail file: (Verify
a n s
the name of the trail file in the dirdat directory.)
n- t r
Logdump 2 > open dirdat/ew000000
a no
Current LogTrail is
h a s ideฺ
)
/u01/app/oracle/product/gg_amer/dirdat/ew000000
m G u
o
ฺc den t
Identifying the File Headers
o n tu
3. View the first record. Useic
r ssn (next)
the
s S
command:
Logdump 3 @ > ne
e t hi
t ฺ n ag us
s u ji
2013/12/02 14:01:18.018.941 FileHeader Len 1409 RBA 0
g ( Name: *FileHeader*
jit Na 3000 030c 3000 0008 4747 0d0a 544c 0a0d 3100 0002 | 0...0...GG..TL..1...
Su 0004
a17d
3200
3400
0004
0037
2000
0035
0000
7572
3300
693a
0008
4544
02f2
5253
12c1
5232
11e4
3650
|
|
..2... ...3.........
.}4..7.5uri:EDRSR26P
313a 3a75 3031 3a61 7070 3a6f 7261 636c 653a 7072 | 1::u01:app:oracle:pr
6f64 7563 743a 6767 5f61 6d65 723a 4558 5457 4553 | oduct:gg_amer:EXTWES
5436 0000 1300 112e 2f64 6972 6461 742f 6577 3030 | T6....../dirdat/ew00
3030 3030 3700 0001 0138 0000 0400 0000 0039 ff00 | 00007....8.......9..
Logdump 4 >
Note that this is the trail file header record.
4. Turn on the FILEHEADER ON option and view the record again:
Logdump 4 > fileheader on
Logdump 5 > pos 0
Reading forward from RBA 0
Logdump 6 > n
Scroll down and notice how you can view the detail on the trail, the machine being used,
the Extract that produced the trail, the database information, and so on.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
3836 5f36 3433 0000 2500 2323 3120 534d 5020 5361 | 86_643..%.##1 SMP Sa
7420 4a75 6e20 3233 2030 323a 3339 3a30 3720 4544 | t Jun 23 02:39:07 ED
5420 3230 3132 3400 0008 0006 7838 | T 20124.....x8
g us
0200 003b 0000 0400 0000 013c 0000 1400 0000 1014 | ...;.......<........
uj ti ฺna
1414 1414 1414 1414 1414 1411 1414 143d 0000 0500 | ...............=....
( s
g ... Many
Na
lines omitted for clarity ...
jit
Su Using the Head and Detail Attributes when Displaying a Record
5. View the first next record:
Logdump 7 > n
Logdump 8 >
This is a standard trail record. A database type of NUMBER is not as easily readable as a
CHAR or VARCHAR. If you are curious, this record is the line
INSERT INTO west.branch VALUES (100, 10543);
from the previous lab’s trans_branch.sql, the “0064” in hex is the branch_number
100 in decimal, and “292f” in hex above equals 10543 in decimal (the new branch_zip).
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
___________________________________________________________________
Hdr-Ind : E (x45) Partition : . (x04)
UndoFlag : . (x00) BeforeAfter: A (x41)
RecLength : 28 (x001c) IO Time : 2013/12/03 07:15:19.000.000
e to
IOType : 5 (x05) OrigNode : 255 (xff)
cens
TransInd : . (x00) FormatType : R (x52)
l i
SyskeyLen : 0 (x00) Incomplete : . (x00)
a ble
AuditRBA : 235 AuditPos : 4057616
fe r
Continued : N (x00) RecCount : 1 (x01)
a ns
n- t r
2013/12/03 07:15:19.000.000 Insert Len
a no
28 RBA 1417
Name: WEST.BRANCH
h a s ideฺ
After Image:
) u Partition 4 G b
ฺ c om ent G
0000 000a 0000 0000 0000 0000 0064 0001 000a 0000 | .............d......
on tud
0000 0000 0000 292f | ......)/
s s
ric this S
Column 0 (x0000), Len 10 (x000a)
Column
e
1 (x0001), Len 10 (x000a)
n a g@ use
u j itฺ
Logdump >
s
gNote( the difference in the display from the output in the last step. (The trail record header
N a area and detail on the columns have been added to the display.)
S ujit Exit logdump.
7. Restart logdump. Notice that the history and the last prompt number is preserved in
~/logdump.hst, but the session information (for example, which trail file) is not preserved. That
is, you can display the commands you ran last session to open a trail file, but the file is not currently
opened. Prove this by entering next. Exit logdump again.
8. For more information about the logdump utility, which reference manual would you use?
___________________________ (Hint: Look in ~/Documents).
This completes Practice 8-1. This completes the practices for Lesson 8. Stop here.
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
e to
cens
l i
a ble
fe r
a n s
Practices for n t r
-Lesson 9:
n o
a eฺInitial Load
Configuring
s
) a
h 9 uid
ฺ c om ent G
Chapter
s s on tud
e ric this S
n a g@ use
u jitฺ
g ( s
Na
S ujit
• Direct Load
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
• Configure a task to load the initial data from two source tables: ACCOUNT and BRANCH
• Configure the delivery of the data to the target
• Execute the initial load of table data
This File to Replicat method uses an Extract process to extract source data into flat files or trails
on the target system. The initial load Replicat task then moves the data from the intermediate
file to the target database.
Big Picture
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
N a
S ujit
The Extract naming convention is eftor (Extract File To Replicat).
Tasks
1. GGSCI for the source was stopped in the previous logdump lab. Start GGSCI on the
AMER_WEST_GGSCI tab. Configure the initial load Extract parameter file by executing the
following commands on the source system to create an Extract named eftor:
[OS_prompt gg_amer] rlggsci
GGSCI (AMER) 1> DBLogin UserIDAlias gguamer
GGSCI (AMER) 2> Set Editor gedit
GGSCI (AMER) 3> Edit Param eftor
jit
ORACLE_SID=amer.
Su ***********************************************************************
Oracle GoldenGate Capture for Oracle
Version 12.1.2.0.0 17185003 OGGCORE_12.1.2.0.0_PLATFORMS_130924.1316_FBO
Linux, x64, 64bit (optimized), Oracle 12c on Sep 25 2013 02:47:30
Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
Starting at 2013-12-03 11:59:43
***********************************************************************
Output to ./dirdat/ACCOUNT.DAT:
Output to ./dirdat/BRANCH.DAT:
a
s ideฺ
[OS_prompt gg_amer]
h a
) table; itGputu them in a remote file. You can see
Note: This did not put the rows in the remote
m
c dent
o
some of it by entering:
[OS_prompt gg_amer]so n ฺ
stringstu$GG_EURO_HOME/dirdat/ACCOUNT.DAT
s
5. On the EURO_EAST_GGSCI e c is S should still be running. Configure the initial load
ri tab,thGGSCI
delivery parameter
n a g@ e
file by executing
u s the following commands on the target system:
s u jitfileฺ name
a. Configure the data load parameters for ACCOUNT by executing the following command:
g ( GGSCI (EURO)>
(The starts with a lowercase L as in “load account.”)
ExtFile ./dirdat/BRANCH.DAT
Map WEST.BRANCH, Target EAST.BRANCH;
Note: This differs from the lacct file in that it has HandleCollisions (that is,
“ignore duplicates”) to accommodate the three pre-existing rows from the previous lab.
Save and close the file. Leave GGSCI running.
6. On the fifth tab, oracle@hostname, execute the Initial Load delivery process by executing
the following commands at the shell prompt from the target installation directory (each
Replicat all on one line, and all lowercase): e to
[OS_prompt gg_amer] cd $GG_EURO_HOME
cens
l i
[OS_prompt gg_euro] ./replicat paramfile dirprm/lacct.prm
a ble
reportfile dirrpt/lacct.rpt
fe r
[OS_prompt gg_euro] ./replicat paramfile dirprm/lbranch.prm
a ns
reportfile dirrpt/lbranch.rpt
n- t r
[OS_prompt gg_euro]
a no
Notes
h a s ideฺ
• There is no message returned to m the)command G uline, neither good nor bad. That
o
ฺc den t
• If for any reason yousneed
n
information is in the target report.
o
s to rerun tuthe replicat (for example, you made a mistake), a
new report wille ricoverlay i s S
@ se
not
rerun thegreplicat. t h the old one. You must first delete the old report, and then
g (su # inserts: 43
N a
uj i t # updates: 0
S #
#
deletes:
discards:
0
0
# insert collisions: 3
• A task to load the initial data from all of the source tables
• The delivery of the data to the target
Big Picture
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u j ti ฺna
g ( s
Assumptions
N athis
ujit An Extract Task is a special process that, once started, reads from each source table row by
For practice, target database instantiation will be performed via Oracle GoldenGate tasks.
S row. This data is transmitted to the Replicat task on the target that inserts each row of data into
the empty database tables. The Task will automatically shut down once all rows are read,
transmitted, and inserted.
This exercise assumes that:
• SQL*Plus is still running on the EURO_EAST_SQLPLUS tab. If not, start it by using
rlsqlplus.
• GGSCI is still running in both the AMER_WEST_GGSCI and EURO_EAST_GGSCI tabs. If
not, start it with rlggsci, and then:
DBLogin UserID gguser, Password oracle_4U
Replicat rini
AssumeTargetDefs
UserIDAlias ggueuro
DiscardFile ./dirrpt/rini.dsc, Purge
Map WEST.*, Target EAST.*;
Save and close the file.
6. On the AMER_WEST_GGSCI tab, execute the initial load process in the source system:
e to
ns
GGSCI (AMER)> Start Extract eini
Sending START request to MANAGER ... l i ce
EXTRACT EINI starting
a ble
fe r
GGSCI (AMER)>
a n s
Note that Start * will not start this kind of an initial load; you n r
t to name it explicitly.
-need
o
n commands:
7. This task displays differently than other Extracts. Enter
s a the eฺ
GGSCI (AMER)> Info All
) h a u i d
GGSCI (AMER)> Info Extract o m* t G
o n ฺc einid e n
GGSCI (AMER)> Info Extract
i c ss s Snot tu
Notice that this initial load r
e Info t h i Extract
Extract does show up in Info All, nor Info with an
asterisk, but does @ e completed). If youeini.
n a g show up in
u s It will show with a Status of STOPPED
(which means
j i t ฺ that it is already are very fast, you may briefly see
s
Status
( u STARTING.
N ag
S ujit
jit N
Su
statistics, nor in the report.
COUNT(*)
----------
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ
1000
COUNT(*)
----------
43
Assumptions
• You successfully completed the previous practices.
• The source and target tables in the WEST and EAST schemas are now identical as a
result of the successful initial load.
• GGSCI and SQL*Plus are all running on both source and targets.
• DBLogin is still in effect on both GGSCI sessions.
e to
ns
Tasks
1. On the source system AMER_WEST_GGSCI tab, start all the processes and make sure they
l i ce
are all running:
a ble
GGSCI (AMER)> Start ER * fe r
a n s
Sending START request to MANAGER ...
n- t r
EXTRACT EXTWEST starting
a no
Sending START request to MANAGER ...
h a s ideฺ
EXTRACT PWEST starting
m ) G u
GGSCI (AMER)> Info Allnฺc
o e n t
o d
Statusric
ssGroups Stu Lag at Chkpt Time Since Chkpt
Program
@ e
e t hi
MANAGER
g us EXTWEST 00:00:00
RUNNING
EXTRACTna RUNNING
j i t ฺ 00:00:05
( s u
EXTRACT RUNNING PWEST 00:01:00 00:00:02
ag GGSCI (AMER)>
N
S ujit 2. On the target system EURO_EAST_GGSCI tab, start all the processes and make sure they
are all running:
GGSCI (EURO)> Start ER *
Sending START request to MANAGER ...
REPLICAT REAST starting
GGSCI (EURO)>
uji
Info All
g ( s
Program Status Group Lag at Chkpt Time Since Chkpt
N a MANAGER RUNNING
GGSCI (EURO)>
ce
----------
559
l i
a ble
AMER_SQL> SELECT count(*) FROM branch_atm;
fe r
COUNT(*)
----------
a ns
563
n- t r
AMER_SQL>
a no
a
b. On the target database EURO_EAST_SQLPLUS tab:
h s ideฺ
[OS_prompt labs] rlsqlplus m ) G u
east@euro/oracle_4U
SQL*Plus: Release 12.1.0.1.0 ฺc o e t
non Wed Dec 4 07:58:18 2013
o n Production
d
SQL> set sqlprompt s
r i c s s Stu
EURO_SQL>
EURO_SQL> SELECT
COUNT(*) g@
e count(*)
e thi FROM account;
1060jitฺn
----------a us
g (su
EURO_SQL> SELECT count(*) FROM account_trans;
Na
ujit
COUNT(*)
----------
S 1500
EURO_SQL>
Source and target row counts should match. Your numbers may be slightly different. (There
is a random number generator as part of the transaction generator function.)
Output to ./dirdat/pe:
s s S t u
2013-12-04 ***
Total deletes
e r i c i s 3.00
...many lines have
g @
been
e th
omitted for clarity...
a
ฺnStatistics.u s
j
End of
u i t
g ( s
N a GGSCI (AMER)>
S ujit
o n
...many lines have been omitted for clarity...
r i c ss s Stu
End of Statistics.
@ e
e t hi
t ฺ n ag us
s ji
GGSCI
uthat
(EURO)>
g (
Notice data pump pwest is from WEST to WEST, but the Replicat reast is from WEST
Na to EAST. Also notice that the Replicat is lagging 2 seconds behind the pump. Your counts
S ujit and times may be slightly different; the important thing is that source WEST matches target
EAST.
This completes Practice 9-3. Continue now with Practice 9-4.
Assumptions
• The Extract, Data Pump, and Replicat are all working from the previous lab
• No other practice depends on this conversion being completed; it is, therefore,
optional.
Tasks
e to
1. Register the Extract with the database. On the AMER_WEST_GGSCI tab, enter:
cens
l i
GGSCI (AMER)> Stop extwest
a ble
Sending STOP request to EXTRACT EXTWEST ...
fe r
Request processed.
a ns
n- t r
no
GGSCI (AMER)> Register Extract extwest Database
a
h a s ideฺ
Extract EXTWEST successfully registered with database at SCN 5988879.
ACCOUNT_NUMBER ACCOUNT_BALANCE
-------------- ---------------
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ
7000 7000
8000 8000
This just makes sure that the GGSCI processes are still working.
4. You want to convert the target process before you convert the source process. On the
target system EURO_EAST_GGSCI tab, enter the following commands:
GGSCI (EURO)> Stop reast
Sending STOP request to REPLICAT REAST ...
e to
Request processed.
cens
l i
GGSCI (EURO)> Alter Replicat reast, Integrated
a ble
REPLICAT (Integrated) altered.
fe r
a ns
GGSCI (EURO)> n- t r
NOTE: Do not restart it yet! a no
5. h a s ideฺ
When all GGSCI processes are stopped, convert the source Extract (not the data pump).
m ) G u
o
ฺc den t
On the source system AMER_WEST_GGSCI tab, enter the following commands:
GGSCI (AMER)> Stop extwest
o n tu ...
Sending STOP requestcs tosEXTRACTS
e r i hi s EXTWEST
Request processed.
@ e t
t ฺ n ag Alteru s
s u ji
GGSCI (AMER)> Extract extwest, Upgrade Integrated TranLog
GGSCI (AMER)>
6. Restart the replicat. On the target system EURO_EAST_GGSCI tab, enter the following
command:
GGSCI (EURO)> Start *
7. Make sure that the replication is still working. On the source database
AMER_WEST_SQLPLUS tab, enter the following DML:
AMER_SQL> INSERT INTO west.account VALUES (9000,9000);
AMER_SQL> COMMIT;
ACCOUNT_NUMBER ACCOUNT_BALANCE
-------------- ---------------
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ
7000 7000
8000 8000
9000 9000
Make sure that the last row was added.
9. The only indication that the Replicat is now integrated (as opposed to classic) is in:
GGSCI (EURO)> View Report reast
where it says:
e to
2013-12-04 13:39:41 INFO OGG-02527 Integrated Replicat does not populate ans
trace table.
l i ce
2013-12-04 13:39:41 INFO OGG-02545 Parameter GROUPTRANSOPS is a
r ble by
ignored
Integrated Replicat when parallelism is greater than 1.
n s fe
n tra
2013-12-04 13:39:48 INFO OGG-02528 REPLICAT REAST -successfully registered
with database as inbound server OGG$REAST.
a no
attached to inbound server OGG$REAST. ha
2013-12-04 13:39:50 INFO OGG-02530 Integrated
eฺ successfully
s idreplicat
m ) G u
o
ฺc ... e n t
o n
... Many lines omitted for clarity
d
tuintegrated (as opposed to classic) is in:
r i c ss sis now
10. The only indication that the Extract
S
GGSCI (AMER)>eInfo extwest
@ e t hi
where it says:ag s
t ฺ n u
Logji Read Checkpoint Oracle Integrated Redo Logs
( s u
N ag GGSCI (AMER)> View Report extwest
and in:
This completes Practice 9-4. This completes the practices for Lesson 9. Stop here.
e to
cens
l i
a ble
fe r
a n s
Practices for n t r
-Lesson 10:
n o
Oracle s aGoldenGate
eฺ
) h a
Parameters u i d
o m t G
o n ฺc Chapter
d e n 10
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
• Have an Extract group automatically start when the Manager process is started.
Answer: __________________________________________________________
• Have all Extract groups automatically restart after abending. Manager should retry the e to
operation three times, waiting one minute between each attempt.
cens
l i
Answer: __________________________________________________________
a ble
• Report the current lag for each Extract/Replicat group every hour to the application log
fe r
file.
a ns
Answer: __________________________________________________________
n- t r
no
• Write an informational message to the application log file if the lag for any
a
h a s ideฺ
Extract/Replicat group exceeds 30 minutes.
Answer: __________________________________________________________
m ) G u
o t
• Write a critical message to the application log file if the lag for any Extract/ Replicat
ฺc den
o
group exceeds 45 minutes. n
c ss s Stu
Answer: __________________________________________________________
r i
2. e t hi
Activate the changes by bouncing (stopping, and starting, or restarting) the Manager
@ e
g us
ti ฺna
process:
GGSCI (AMER)>
Note: You do not have to stop any of the Extracts or Replicats to bounce the Manager.
After the Extracts are running, they are independent of the Manager.
GGSCI (AMER)>
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
N a
S ujit
• Use ports in the range of 15151 through 15199 when starting Oracle GoldenGate
processes. See footnote for checking port availability. 1
Answer: __________________________________________________________
• Have all Replicat groups that have a group name of R* automatically start when the
Manager process is started.
Answer: __________________________________________________________ e to
• Have all Replicat groups automatically restart after abending. Manager should retry the cens
l i
operation three times, waiting one minute between each attempt.
a ble
Answer: __________________________________________________________
fe r
• Delete the remote trail files after the Replicat has finished processing them and the trail
a ns
has been kept for at least two hours.
n- t r
no
Answer: __________________________________________________________
a
• s ideฺ
Report the current lag for each Extract/Replicat group every hour to the application log
h a
file.
m ) G u
o t
Answer: __________________________________________________________
ฺc den
• o n
ss s Stu
Write an informational message to the application log file if the lag for any
i c
Extract/Replicat group exceeds 30 minutes.
r
e t hi
Answer: __________________________________________________________
@ e
g us
ti ฺna
• Write a critical message to the application log file if the lag for any Extract/ Replicat
s u j
group exceeds 45 minutes.
g ( Answer: __________________________________________________________
N a
S ujit
1
Port Availability: The basic UNIX command to check for a single free port is:
netstat -na | grep LISTEN | grep 15001
but it gets trickier when trying to check for a range. Using regex (regular expressions), this will search a range of
15151-15199 inclusive:
netstat -na | grep LISTEN | egrep 1515[1-9]\|151[6-9][0-9]
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
GGSCI (EURO)>
Note: You do not have to stop any of the Extracts or Replicats to bounce the Manager.
e to
After they are running, they are independent of the Manager.
cens
Note: If you do Stop mgr ! (by adding an exclamation point!), it will not prompt you for l i
“Are you sure?” a ble
fe r
3. Verify that the Manager has started:
a ns
GGSCI (EURO)> Info mgr
n- t r
no
Manager is running (IP port easthost.15001, Process ID 22613).
a
h a s ideฺ
GGSCI (EURO)>
m ) G u
o
ฺc den
Your host name and PID will be different. t
o n u Practice 10-3.
r i c ss snowStwith
This completes Practice 10-2. Continue
@ e
e t hi
t ฺ n ag us
( s uji
N ag
S ujit
• Controls whether or not statistics generated by the REPORT parameter are reset when a
new process report is created
e to
• Generates interim runtime statistics in a process report. Set this parameter to report at
cens
one minute after midnight daily.
l i
• Forces report files to age on a regular schedule, instead of when a process starts. Set
a ble
this report roll-over parameter to occur at one minute after midnight daily.
fe r
• a ns
Reports a count of transaction records processed since startup. Set this report
parameter to occur every 60 seconds, and report the number of operations per secondn- t r
and the change in rate.
a no
• a s ideฺ
Writes a message to the report file after processing every 1000 records.
h
• Only extracts data from the ACCOUNT_TRANS m ) tableGif uthe account_trans_type is equal
to "CR" n ฺ c dent
o
s so Stu
Answer: __________________________________________________________
c
e
You can check your answers ri against
t h is a sample file in
a g@ use
~/labs/Section10/solutions/amer/extwest.prm.
n
Look for these parameters later
u itฺ ofbest
in the macro
jSet practices settings MACRO #bpsettings in Practice 12-4: “Modifying an
g ( s
Existing Macros and User Tokens.”
jit Na
Su
GGSCI (AMER)>
m ) G u
3. Clean up the Oracle GoldenGate n labฺc
o e t
n by executing the following GGSCI
environment
o tu d
commands on the target server
r i c ss EURO_EAST_GGSCI
s S tab:
GGSCI (EURO)>eStop ERhi*
g @ e t UserIDAlias ggueuro
GGSCI (EURO)>
a
ฺn(EURO)> s
DBLogin
u
u j
GGSCI i t Delete ER * (confirm the deletion)
( s
g GGSCI (EURO)> Delete CheckpointTable (only on the EURO db)
N a
ujit
GGSCI (EURO)> Stop mgr !
S GGSCI (EURO)> Exit
OS_prompt> rm $GG_EURO_HOME/dirdat/*
OS_prompt> rm $GG_EURO_HOME/dirrpt/*
Do not type the (red comments); those are only for clarification. Shown below is an example
of the dialog from the target (EURO) server:
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
e to
cens
l i
a ble
fe r
a n s
Practices for n t r
-Lesson 11: Data
n o
Selection
s a and
e ฺ Filtering
a
) h 11Gui d
m
co dent
Chapter
n ฺ
c s so Stu
e ri this
n a g@ use
u jitฺ
g ( s
Na
S ujit
achieve parallelism is based on the @RANGE function, which computes a hash value of the
columns specified in the input. The @RANGE function, combined with the FILTER option, allows
the Extract/Replicat processes to split the flow of replicated data into two or more streams.
Assumptions
• You completed the lab practices for all previous lessons.
• Nothing is running in GGSCI at the moment.
• You have two configured Extract processes (extwest and pwest) and one configured
e to
Replicat process (reast). All processes are currently stopped.
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
Replicat processes.
Tasks
1. Create the source and target table range_split. Its definition is stored in the
range_split.sql file. On the fifth tab, oracle@hostname, at an OS prompt, navigate
to the Section 11 directory, and view the script:
[OS_prompt] cat ~/labs/Section11/sqlscripts/range_split.sql
e to
ns
DROP TABLE range_split;
CREATE TABLE range_split
l i ce
( ROW_ID NUMBER NOT NULL PRIMARY KEY,
a ble
split_value NUMBER NOT NULL ,
fe r
split_text VARCHAR2(128) NOT NULL , a ns
n- t r
no
split_date TIMESTAMP DEFAULT systimestamp );
2. a
s ideฺ
You also will create the populate_range_split stored procedure, defined in
h
populate_range_split.sql. View the PL/SQL code:
) a u
o m t G
[OS] cat ~/labs/Section11/sqlscripts/populate_range_split.sql
o n ฺc populate_range_split
d e n
CREATE OR REPLACE PROCEDURE
i c ssIN NUMBER
S tu
( num_rows
e r t s
hiNUMBER )
@
g omitted
, commit_interval
alines s e IN
i
...manyt ฺ n u for clarity...
u j
ag (sThe stored procedure takes two parameters:
− The number of rows to be created
N
S ujit − The commit interval (in number of rows)
The PL/SQL stored procedure defines a cursor used to generate random strings, then
loops until the number of rows to be created has been reached, generating random
numbers and random strings and storing them in the RANGE_SPLIT table.
3. On the AMER_WEST_SQLPLUS tab, connect to the source Oracle database by using
SQL*Plus. If you are already connected as west@amer, skip to the next task.
[OS_prompt labs] rlsqlplus west@amer/oracle_4U
SQL*Plus: Release 12.1.0.1.0 Production on Thu Dec 5 08:28:43 2013
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Last Successful login time: Wed Dec 04 2013 07:58:18 +00:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With Partitioning, OLAP, Advanced Analytics, Real Application Testing options
SQL> set sqlprompt AMER_SQL>
5. Load and compile the stored procedure by using the @ command into the west schema:
AMER_SQL> @Section11/sqlscripts/populate_range_split.sql
Procedure created.
6. Change to the source AMER_WEST_GGSCI tab, and make sure that the GGSCI command
interpreter and manager are started:
[OS prompt ~] cd $GG_AMER_HOME
[OS prompt gg_amer] rlggsci
e to
ns
Oracle GoldenGate Command Interpreter for Oracle
ce
Version 12.1.2.0.0 17185003 OGGCORE_12.1.2.0.0_PLATFORMS_130924.1316_FBO
Linux, x64, 64bit (optimized), Oracle 12c on Sep 25 2013 02:33:54
l i
Operating system character set identified as UTF-8.
a ble
Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
fe r
GGSCI (AMER) 1> Start mgr a ns
Manager started.
n- t r
a no
It may be helpful to eventually define a startup.oby “obey” script file that contains the
a s ideฺ
half-dozen or so common GGSCI housekeeping tasks, such as starting the manager, doing
h
)
DBLogin, setting the default editor, and so on.
m G u
o
ฺc den t
7.
n
You must set the additional logging for the new RANGE_SPLIT table:
o tu
GGSCI (AMER) 2> DBLogin
r i c ss s UserIDAlias
S gguamer
e
Successfully logged into
th i
database.
a g @ s e
GGSCIฺn 3>uAdd TranData WEST.RANGE_SPLIT
j i t (AMER)
u of supplemental redo data enabled for table WEST.RANGE_SPLIT.
g ( s
Logging
***********************************************************************
** Running with the following parameters **
***********************************************************************
DefsFile ./dirdef/rangesplit.def, Purge
UserIDAlias gguamer
Table WEST.RANGE_SPLIT;
Retrieving definition for WEST.RANGE_SPLIT
e to
Definitions generated for 1 table in ./dirdef/rangesplit.def
cens
l i
10. Copy the rangesplit.def file to the EURO target environment, under the dirdef
a ble
directory:
fe r
GGSCI (AMER)> sh cp ./dirdef/*.def $GG_EURO_HOME/dirdef
a ns
GGSCI (AMER)> sh ls $GG_EURO_HOME/dirdef
n- t r
rangesplit.def
a no
In a production environment, you might need to h a
use eฺ instead of cp if the target
s scp iordsftp
is a remote host. m ) G u
o
ฺctab ande t
n to the target EURO database by
11. Change to the EURO_EAST_SQLPLUS
o n tu d connect
using SQL*Plus to create the
r i c sstargetsRANGE_SPLIT
S table. If you are already connected as
east@euro, skip to the
@ e next task.
e t hi
[OS_prompt
n a g uslabs] rlsqlplus east@euro/oracle_4U
a g ( EURO_SQL> @Section11/sqlscripts/range_split.sql
N
ujit
Table created.
S As before, an attempt to drop a non-existent table results in an error that you can safely
ignore.
13. On the AMER_WEST_GGSCI tab, create three Extract processes (erangea, erangeb, and
erangec), which use the FILTER command combined with the @RANGE function to create
three separate trail files. These files will be processed by three separate Replicat
processes, thus achieving parallelism and significantly improving load performance. Note
where the files differ by a, b, c, and by 1, 2, 3:
GGSCI (AMER)> Edit Param erangea
Extract erangea
UserIDAlias gguamer
RmtHost easthost, MgrPort 15001
RmtTrail ./dirdat/ea
Table WEST.RANGE_SPLIT, Filter (@RANGE (1, 3));
RmtTrail ./dirdat/eb
Table WEST.RANGE_SPLIT, Filter (@RANGE (2, 3));
15. Save the parameter file erangeb and create the third parameter file:
GGSCI (AMER)> Edit Param erangec
Extract erangec
UserIDAlias gguamer
RmtHost easthost, MgrPort 15001
e to
RmtTrail ./dirdat/ec
cens
Table WEST.RANGE_SPLIT, Filter (@RANGE (3, 3)); l i
a ble
16. Add the three Extract processes:
fe r
GGSCI (AMER)> Add Extract erangea, TranLog, Begin Now
a n s
EXTRACT added.
n- t r
a no
GGSCI (AMER)> Add Extract erangeb, TranLog, Begin Now
EXTRACT added.
h a s ideฺ
m ) G u
GGSCI (AMER)> Add Extract erangec, TranLog, Begin Now
o
ฺc den t
EXTRACT added.
o n
17. Add the three remote trailic
r ss s Stu
definitions:
GGSCI (AMER)> @ e hi ./dirdat/ea, Extract
eAdd RmtTrail
t erangea
RMTTRAIL
t ฺ n agadded.us
( s uji (AMER)> Add RmtTrail ./dirdat/eb, Extract
GGSCI erangeb
N ag RMTTRAIL added.
S ujit GGSCI (AMER)> Add RmtTrail ./dirdat/ec, Extract
RMTTRAIL added.
erangec
18. Assess the current situation of your Extract processes by entering Info All:
GGSCI (AMER)> Info All
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT STOPPED ERANGEA 00:00:00 00:02:35
EXTRACT STOPPED ERANGEB 00:00:00 00:02:28
EXTRACT STOPPED ERANGEC 00:00:00 00:02:20
s u
REPLICAT
Output to ./dirdat/ea:
End of Statistics.
GGSCI (EURO)> Stats Replicat rrangeb
[omitted similar output…]
GGSCI (EURO)> Stats Replicat rrangec
[omitted similar output…]
Tasks
1. Stop all previous Extract and Replicat processes:
On the source AMER_WEST_GGSCI tab, enter:
GGSCI (AMER)> Stop ER *
On the target EURO_EAST_GGSCI tab, enter:
GGSCI (EURO)> Stop ER *
2. Truncate both source and target tables in SQL*Plus as you will reuse them:
e to
a) On the source database AMER_WEST_SQLPLUS tab, enter:
cens
l i
AMER_SQL> TRUNCATE TABLE west.range_split;
a ble
b) On the target database EURO_EAST_SQLPLUS tab, enter:
fe r
EURO_SQL> TRUNCATE TABLE east.range_split;
a n s
3. On the AMER_WEST_GGSCI tab, create a new parameter filen
r
-t on the source:
o ecord
GGSCI (AMER)> Edit Param ecord
s a n eฺ
Extract ecord
) ha uid
UserIDAlias gguamer
ฺ c om ent G
RmtHost easthost, MgrPort
s s on 15001
t u d
RmtTrail ./dirdat/ed
e r ic his S
@
Table WEST.RANGE_SPLIT;
g e t
Save and tclose
s
ฺna the file. Note
u that there is nothing in the Extract that indicates anything
j i
u about the apply. The only difference between this Extract and the previous
s
“coordinated”
(
N agthree,was removing the Table clause:
ujit
Filter (@RANGE (n, 3))
S and the fact that you needed three of them. Now we only need one Extract.
4. On the EURO_EAST_GGSCI tab, create a new parameter file rcord on the target:
GGSCI (EURO)> Edit Param rcord
Replicat rcord
UserIDAlias ggueuro
SourceDefs ./dirdef/rangesplit.def
DiscardFile ./dirrpt/rrangea.dsc, Append
Map WEST.RANGE_SPLIT, Target EAST.RANGE_SPLIT
ThreadRange (1-3, ROW_ID);
The replicat group name must be five characters or less, or you get the following error:
ERROR: Invalid Coordinated Replicat group name. Must be at most
5 characters..
a
s ideฺ
GGSCI (EURO)> Start ER rc*
h a
Sending START request to MANAGER ...) G u
o m t
REPLICAT RCORD starting
o n ฺc den
r i c ss s Stu
Info ircord
GGSCI (EURO) 41>
@ e th
g s e
i
REPLICAT
j t ฺ na RCORD u Last Started 2013-12-05 12:04 Status RUNNING
( s u
COORDINATED Coordinator MAXTHREADS 3
GGSCI (EURO)>
7. Generate DML traffic. On the AMER_WEST_SQLPLUS source database tab, enter:
AMER_SQL> exec populate_range_split(10000,1000);
Process ID 18375
Log Read Checkpoint File ./dirdat/ed000000
2013-12-06 12:15:08.818086 RBA 3169467
Active Threads:
ID Group Name PID Status Lag at Chkpt Time Since Chkpt
e to
1 RCORD001 18382 RUNNING 00:00:00 00:00:02
cens
2 RCORD002 18383 RUNNING 00:00:00 00:00:02
l i
3 RCORD003 18384 RUNNING 00:00:00 00:00:02
a ble
fe r
Current directory /u01/app/oracle/product/gg_euro
a ns
n- t r
Report file
no
/u01/app/oracle/product/gg_euro/dirrpt/RCORD.rpt
a
Parameter file
s ideฺ
/u01/app/oracle/product/gg_euro/dirprm/rcord.prm
h a
Checkpoint file
) u
/u01/app/oracle/product/gg_euro/dirchk/RCORD.cpr
m G
Checkpoint table
o
GGS_CHECKPOINT
ฺc den t
Process file
o n
/u01/app/oracle/product/gg_euro/dirpcs/RCORD.pcr
Error log
r i c ss s Stu
/u01/app/oracle/product/gg_euro/ggserr.log
@ e
e t hi
t ฺ n ag us
GGSCI (EURO)> Info rcord002
( s uji
REPLICAT RCORD002 Last Started 2013-12-06 08:29 Status RUNNING
a g COORDINATED Replicat Thread Thread 2
i t N
S uj Checkpoint Lag
Process ID
00:00:00 (updated 00:00:06 ago)
18383
Log Read Checkpoint File ./dirdat/ed000000
2013-12-06 08:30:52.000182 RBA 3169467
00:00:09 ago)
Coordinated Total DDLs: 0
Coordinated Total PK-update transactions: 0
Coordinated Total EMI transactions: 0
Total transactions with user-requested coordination: 0
Average Coordination Time: 00:00:00
End of Statistics.
o m t G
GGSCI (EURO)> Statsso nฺc tuden
rcord002
r i c s sS
i
e tothREPLICAT
g @
Sending STATS request
s e
RCORD002 ...
End of Statistics.
End of Statistics.
e to
GGSCI (EURO)>
cens
l i
Notice that the division of labor among the three threads is approximately equal but not
a ble
exactly.
fe r
This completes Practice 11-2. This completes the practices for Lesson 11. Stop here.
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
e to
cens
l i
a ble
fe r
a n s
Practices for n t r
-Lesson 12:
n o
Additional
s a Transformation
eฺ
) h a
Topics u i d
o m t G
o n ฺc Chapter
d e n 12
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
for sharing parameters or other runtime configuration settings across multiple components and
externalizing complex configuration settings to streamline parameter file contents.
The best practice is to create a file or series of files as a macro library and store them in a
specific folder (for example, $OGG_HOME/dirmac).
1. On the fifth oracle@hostname tab, at the OS prompt, edit the
~/labs/Section12/macrolib_shell.mac file in the text editor of your choice (for
example, vi, gedit). Referring to the Oracle GoldenGate Windows and UNIX Reference
Guide (~/Documents/ggate12c_reference_oracle_e29392.pdf), fill in the
e to
ns
<blanks> with the appropriate values to complete the three macros:
− #dbconnect l i ce
− #bpsettings
a ble
fe r
− #funcsmap
a ns
<a> The keyword that starts a macro body
n- t r
<b> The keyword that finishes a macro
a no
a s ideฺ
<c> Reset the statistics when a new report is generated
h
<d> Generates a report every day at onem ) afterGmidnight
minute u
o
ฺccreateda enewt
n one daily at one minute after midnight
o n
<e> Close the current report file and
s between tu different source and target columns
<f> The keyword that maps
r i c srecords
s S
i information about the Oracle GoldenGate
eis used tothreturn
@
<g> The function that
ag us e
t ฺ n
environment
<h> The
( s ujifunction used to identify a user token
g
jit Na
Su
MACRO #bpsettings
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ
BEGIN
<c>
<d>
<e>
ReportCount Every 60 Seconds, Rate
END;
e to
ns
MACRO #funcsmap
PARAMS (#src_table, #target_table)
l i ce
BEGIN
a ble
MAP #src_table, TARGET #target_table,
fe r
<f> (usedefaults,
a ns
gg_commit_ts = <g> ( 'GGHEADER' , 'COMMITTIMESTAMP' ),
n- t r
lag_extract_ms = <h> ( 'TKN-EXTLAG-MSEC' ),
a no
a s ideฺ
lag_replicat_ms = @GETENV ( 'LAG' , 'MSEC' ),
h
) G
src_db_name = @TOKEN ( 'TKN-SRC-DBNAME' ),
m u
o
ฺc den t
src_db_version = @TOKEN ( 'TKN-SRC-DBVERSION' ),
o n
r i c ss s Stu
src_txn_csn = @TOKEN ( 'TKN-TXN-CSN' )
);
@ e
e t hi
END;
n g us
aparameters
After all oft ฺ
ji that the token quotes
the have been set correctly, save and close the file. It is very
s u
g(
important be 'single, straight' quotes. Verify that it has the correct
N a ~/labs/Section12 directory.
parameters by comparing it with the macrolib.mac file, which is also located in the
uj i t
S 2. On the AMER_WEST_GGSCI source tab, create a directory named dirmac. Copy the
macrolib.mac file to this directory:
GGSCI (AMER)> sh mkdir dirmac
GGSCI (AMER)> sh cp ~/labs/Section12/macrolib.mac dirmac
GGSCI (AMER)> sh ls dirmac
macrolib.mac
GGSCI (AMER)>
macrolib.mac
GGSCI (EURO)>
Note: Both the macros and user tokens will be used in subsequent labs.
This completes Practice 12-1. This completes the practices for Lesson 12. Stop here.
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
N a
S ujit
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
e to
cens
l i
a ble
fe r
a n s
Practices for n t r
-Lesson 13:
n o
a eฺ Options
Configuration
s
) a
h 13 uid
ฺ c om ent G
Chapter
s s on tud
e ric this S
n a g@ use
u jitฺ
g ( s
Na
S ujit
Big Picture
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
Assumptions
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ
You have successfully completed the previous lab where you created the macros. If the
SQL*Plus tabs are still signed on as the proper users, you can just execute the script; no need
to exit/restart.
Tasks
N agNote: Supplemental logging has already been enabled for the existing tables in the
S ujit database and will cause many WARNING OGG-00706 messages that can be ignored.
Verify that supplemental logging has been enabled for the new tables: WEST.CUST_ZIP,
WEST.WSHOP_ENCRYPT, and WEST.WSHOP_FUNCS.
ฺ c omPurge
e n tG
***********************************************************************
s s on tud
DefsFile ./dirdef/section13.defs,
ric this S
UserIDAlias gguamer
e
Table WEST.wshop_encrypt;
@ sefor WEST.WSHOP_ENCRYPT.
n g
Retrieving definition
a u
Table ฺWEST.wshop_funcs;
u j i t
g ( s
Retrieving definition for WEST.WSHOP_FUNCS.
N a Table WEST.cust_zip;
ujit
Retrieving definition for WEST.CUST_ZIP.
GGSCI (AMER)>
The defgen utility will report runtime data to the screen. If any errors are reported, fix
them and rerun the utility.
6. On the source AMER_WEST_GGSCI tab, copy the dirdef/section13.defs file to the
same location on the target server:
GGSCI (AMER)> sh cp dirdef/section13.defs $GG_EURO_HOME/dirdef
7. On the EURO_EAST_GGSCI tab, verify that the section13 definition file is there:
GGSCI (EURO)> sh ls -al dirdef/s*
-rw-r----- 1 oracle oinstall 2098 Dec 6 dirdef/section13.defs
This completes Practice 13-1. Continue now with Practice 13-2.
Tasks
1. Before data encryption can occur, encryption keys must be generated using the keygen
utility.
To run keygen and create keys that will be used for password and data transmission
encryption, on the fifth oracle@hostname tab Linux shell session, navigate to the
$GG_AMER_HOME directory. Using the keygen utility, create five keys, with one having 64
bits, one with 128 bits, and three having 256 bits. Then open the file with the text editor of e to
your choice:
cens
l i
[OS_prompt] cd $GG_AMER_HOME
a ble
[OS_prompt gg_amer] ./keygen 64 1 > ENCKEYS
fe r
[OS_prompt gg_amer] ./keygen 128 1 >> ENCKEYS
a ns
[OS_prompt gg_amer] ./keygen 256 3 >> ENCKEYS
n- t r
[OS_prompt gg_amer] gedit ENCKEYS
a no
h
The double greater-than “>>” appends the standard a s outputidtoeaฺ file.
m ) G u
2. Name the keys MyKey1 through MyKey5
different. Save and close the file: nฺc
o by adding
e n t the prefixes. Your hex numbers will be
o d
i
MyKey1 0x449FFE730EF5634F
r c ss s Stu
e t hi
MyKey2 0x1F1914181FDE5B2048A11E5B0F712377
@ e
MyKey3 a
n g us
0xBEE3A6170DCA34671DBF8D12524DD403312ECE240529CA5C37A7540C7F790642
t ฺ
( s uji 0xB177611C9714FB1DC1A6936BA8CAE2359B0D642EF3FB1609CAD9914DA13BA45E
MyKey4
agCopy this file to the same location on the target (GG_EURO_HOME) system:
MyKey5 0x4EB616219242DA1B110026107AAB910530AC224BC874E40E0421B9113114A008
N
ujit
3.
S [OS_prompt gg_amer] cp ENCKEYS $GG_EURO_HOME
Verify that the file is there in the target installation directory:
[OS_prompt gg_amer] more $GG_EURO_HOME/ENCKEYS
MyKey1 0x449FFE730EF5634F
MyKey2 0x1F1914181FDE5B2048A11E5B0F712377
MyKey3 0xBEE3A6170DCA34671DBF8D12524DD403312ECE240529CA5C37A7540C7F790642
MyKey4 0xB177611C9714FB1DC1A6936BA8CAE2359B0D642EF3FB1609CAD9914DA13BA45E
MyKey5 0x4EB616219242DA1B110026107AAB910530AC224BC874E40E0421B9113114A008
[OS_prompt gg_amer]
MACRO #bpsettings
BEGIN
... Many lines omitted for clarity ...
Note: All the way from Userid through MyKey3 is all one line with no line breaks.
e. Save the file and exit.
ujit
);
S Save and close the file.
6. On the source server AMER_WEST_GGSCI tab, add the Extract group and two local Extract
Trails by executing the following GGSCI commands:
GGSCI (AMER)> DBLogin UserIDAlias gguamer
Successfully logged into database.
GGSCI (AMER)>
Notice this Extract group will have two trails: one encrypted (ex) and one plain text (ec).
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Your text editor opens the empty pfuncs.prm file. Add the following runtime parameters to
the text file:
Extract pfuncs
RmtHost easthost, MgrPort 15001, Compress
RmtTrail ./dirdat/px
Passthru
Table WEST.*;
Save and close the file. e to
8. On the source server AMER_WEST_GGSCI tab, add the Extract group by executing the cens
l i
following commands:
a ble
GGSCI (AMER)> Add Extract pfuncs, ExtTrailsource ./dirdat/ex
fe r
EXTRACT added.
a ns
n- t r
no
GGSCI (AMER)> Add RmtTrail ./dirdat/px, Extract pfuncs
a
RMTTRAIL added.
h a s ideฺ
GGSCI (AMER) >
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
t ฺ n ag us
( s uji
ag
N
S ujit
The text editor of your choice opens the empty pfunca.prm file. Add the following runtime
parameters to the text file:
Extract pfunca
RmtHost easthost, MgrPort 15001, Compress
RmtTrail ./dirdat/pc
Passthru
Table WEST.*;
e to
10. On the source server AMER_WEST_GGSCI tab, add the Extract group by executing the
cens
l i
following commands:
a ble
GGSCI (AMER)> Add Extract pfunca, ExtTrailsource ./dirdat/ec
fe r
GGSCI (AMER)> Add RmtTrail ./dirdat/pc, Extract pfunca
a ns
n- t r
Creating the Oracle GoldenGate Checkpoint Table
a no
a s ideฺ
On the target server, Replicat checkpoints to a special table created in the database. This
h
) u
checkpoint table ensures that the Replicat checkpoint is part of the transaction and is used to
m G
o t
ensure data integrity. If it does not already exist, create the checkpoint table:
ฺc den
o n
ss s Stu
11. On the target server EURO_EAST_GGSCI tab, start GGSCI and execute the following
r i c
startup commands. If you are still logged in to GGSCI from a previous lab, skip this task
e t hi
and just continue with the next task.
@ e
g us
ti ฺna
[OS_prompt gg_euro] rlggsci
uj
( s
g GGSCI
N a (EURO) 1> DBLogin UserIDAlias ggueuro
NoList
Include ./dirmac/macrolib.mac
List
Replicat rfunca
#dbconnect ()
SourceDefs ./dirdef/section13.defs
DiscardFile ./dirrpt/rfunca.dsc, Purge
e to
#bpsettings ()
cens
#funcsmap (WEST.WSHOP_FUNCS, EAST.WSHOP_FUNCS)
l i
Map WEST.CUST_ZIP, TARGET EAST.CUST_CITY_STATE,
a ble
SQLEXEC (ID ZIPLKUP,
fe r
QUERY ' SELECT zip_city, zip_state FROM east.zip_lookup WHERE
a ns
zip = :vzip ',
n- t r
PARAMS (vzip = cust_zip)),
a no
ColMap (usedefaults,
h a s ideฺ
)
cust_city = @GETVAL (ZIPLKUP.zip_city),
m G u
o
ฺc den
cust_state = @GETVAL (ZIPLKUP.zip_state) t
); s o n tu
r i c s s S
@ e straight'
Note the QUERY has 'single,
e t hi quotes. Save and close the file.
t ฺ n ag > uEdit
13. On the EURO_EAST_GGSCI s tab, execute the command:
s u ji
GGSCI (EURO) Param rfunc
( text editor of your choice opens the empty rfunc.prm file. Add the following runtime
gThe
a
N parameters to the text file:
u j i t
S Replicat rfunc
UserIDAlias ggueuro
AssumeTargetDefs
DiscardFile ./dirrpt/rfunc.dsc, Purge
DecryptTrail AES256 KeyName MyKey3
Map WEST.*, Target EAST.*;
Save and close the file.
14. On the EURO_EAST_GGSCI tab, add the Replicats by executing the following commands:
GGSCI (EURO)> Add Replicat rfunc, ExtTrail ./dirdat/px
GGSCI (EURO)> Add Replicat rfunca, ExtTrail ./dirdat/pc
15. Ensure on both systems that the manager is up and running (if not, start the Manager):
GGSCI (both)> Info mgr
GGSCI (both)> Start mgr
e to
GGSCI (AMER)>
cens
l i
Verify that all process from this practice are running by executing the Info ER *
a ble
command. You do not care if other processes from previous labs (such as erange*) are
fe r
stopped.
a ns
17. In the GG_EURO_HOME window, start all the Replicats:
n- t r
GGSCI (EURO) > Start ER rf*
a no
Sending START request to MANAGER ...) h
as uideฺ
REPLICAT RFUNC starting
ฺ c om ent G
s n tud
oMANAGER
r i
Sending START request c sto
s S ...
REPLICAT RFUNCA e
startingth i
a g @ s e
n u
s u jitฺ (EURO) >
GGSCI
( that all process are running by executing the Info ER * command. You do not care
gVerify
Na if other processes from previous labs (such as rrange*) are stopped.
S ujit Note: The Replicats may already be running if the mgr.prm was not deleted in an earlier
lab.
This completes Practice 13-2. Continue now with Practice 13-3.
s u j 8 ZcDzHjttaYQHUciWpAnMqVSav
g ( 9 bDsUBZNWwrHADHqOhMQrlSlXN
N a 10 lLNtcVEHsclSGwUHPUfqNEhAd
AMER_SQL>
Your text will be different, but you should have 10 rows of 25 encrypted characters each.
ROW_NUMBER ROW_TEXT
---------- -------------------------
1 AWUpbEBePRhIKhRuKBJsrweLW
2 yoHddMMKXlGpQLuKSDTRqSSoX
e to
3 ziJvSXUJxEiNqapSPAxdoVUNL
cens
4 JnweLVnqmYfjfhjLXeCUAlTTP l i
5 UGoIkLswswiqxoqHtaFXBaYcf
a ble
fe r
6 JVFgfYHDSUFyjjQbSWeXBfXca
a ns
7 XntsrAQJOQqREvPDwvXZYVsbB
n- t r
no
8 ZcDzHjttaYQHUciWpAnMqVSav
9 bDsUBZNWwrHADHqOhMQrlSlXN
a
s ideฺ
10 lLNtcVEHsclSGwUHPUfqNEhAd
) h a u
o m t G
10 rows selected.
o n ฺc den
r i c ss s Stu
hiof encrypted equivalent data.
EURO_SQL>
@ e 10 rows t
Each table should
ag us
contain e
Validatinguthe t ฺ n
ji Token, Macro, and SQLEXEC Information
4. g
( s
N a Inuser-defined
the GG_AMER_HOME terminal window, view the efuncs.prm parameter file. Four
ujit
tokens will be added to each record captured for this table.
S • TKN-EXTLAG-MSEC uses the @GETENV function (all GoldenGate function names begin
with the @ character) to get the Extract database lag from the GoldenGate
environment.
• TKN-SRC-DBNAME gets the source database name from the database environment.
• TKN-SRC-DBVERSION gets the source database version from the database
environment.
• TKN-TXN-CSN gets the commit sequence number for the transaction from the
database.
NOLIST
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ
INCLUDE ./dirmac/macrolib.mac
LIST
Replicat rfunca
#dbconnect ()
SourceDefs ./dirdef/section13.defs
DiscardFile ./dirrpt/rfunca.dsc, Purge
#bpsettings ()
#funcsmap (WEST.wshop_funcs, EAST.wshop_funcs)
e to
Map WEST.CUST_ZIP, TARGET EAST.CUST_CITY_STATE,
cens
SQLEXEC (ID ZIPLKUP,
l i
QUERY ' SELECT zip_city, zip_state FROM EAST.zip_lookup
a ble
WHERE zip = :vzip ',
fe r
PARAMS (vzip = cust_zip) ),
a ns
ColMap (usedefaults,
n- t r
cust_city = @GETVAL (ZIPLKUP.zip_city),
a no
a s ideฺ
cust_state = @GETVAL (ZIPLKUP.zip_state)
h
);
m ) G u
o
ฺc den t
o n
GGSCI (EURO)>
r i c ss s Stu
Note: The QUERY must
@ e t hi straight' quotes.
ehave 'single,
ag for the
The Map statement
t ฺ n u swshop_funcs table uses the #funcsmap macro:
u ji #funcsmap
MACRO
s
(
ag BEGIN
PARAMS (#src_table, #target_table)
jit N
Su Map #src_table, TARGET #target_table,
ColMap (usedefaults,
gg_commit_ts = @GETENV ( 'GGHEADER' , 'COMMITTIMESTAMP' ),
lag_extract_ms = @TOKEN ( 'TKN-EXTLAG-MSEC' ),
lag_replicat_ms = @GETENV ( 'LAG' , 'MSEC' ),
src_db_name = @TOKEN ( 'TKN-SRC-DBNAME' ),
src_db_version = @TOKEN ( 'TKN-SRC-DBVERSION' ),
src_txn_csn = @TOKEN ( 'TKN-TXN-CSN' )
);
END;
This macro uses two column conversion functions: @GETENV to get the commit timestamp
from the GoldenGate header record and Replicat lag from the Oracle GoldenGate
environment, and @TOKEN to get the tokens set by the source Extract. The @GETENV
quotes must be 'single straight' quotes.
Also notice that for the rfunca parameters, the Map statement for EAST.CUST_ZIP uses
the SQLEXEC option to query a lookup table.
m ) G u
10 rows selected. o
ฺc den t
o n
r i c ss s Stu
thi
SQL>
@ e
Your SCNs g
a will e
be different.
us execute the following query:
t ฺ n
Still iniEURO_EAST_SQLPLUS,
uj
b.
10 rows selected.
EURO_SQL>
GG_COMMIT_TS
---------------------------------------------------------------------------
09-DEC-13 02.37.03.000396 PM
09-DEC-13 02.37.03.000396 PM
09-DEC-13 02.37.03.000396 PM
09-DEC-13 02.37.03.000396 PM
09-DEC-13 02.37.03.000396 PM
e to
09-DEC-13 02.37.03.000396 PM
cens
09-DEC-13 02.37.03.000396 PM
l i
09-DEC-13 02.37.03.000396 PM
a ble
09-DEC-13 02.37.03.000396 PM
fe r
09-DEC-13 02.37.03.000396 PM
a ns
n- t r
10 rows selected.
a no
h a s ideฺ
EURO_SQL>
m ) G u
d. ฺ o
c den
Back on the source database AMER_WEST_SQLPLUS t tab, execute the following query:
n
so Stwest@amer/oracle_4U
u
[OS_prompt labs] rlsqlplus
r i c s s
e. e
Verify the ZIP codes:
@ e t hi
AMER_SQL>
t ฺ n agSELECTu s* FROM cust_zip;
ji
g (suCUST_ID CUST_ZIP
N a ---------- ----------
uj i t 1 80033
S 2 70117
3 94105
4 80202
5 70001
AMER_SQL>
f. Verify the SQLEXEC functionality by executing the following query on the target database
EURO_EAST_SQLPLUS tab:
EURO_SQL>
7. Stop the processes for Practice 13-3 and clean up:
a. On the source system AMER_WEST_GGSCI tab, enter the following commands:
e to
ns
GGSCI (AMER)> Stop ER *
GGSCI (AMER)> Delete ER * !
l i ce
GGSCI (AMER)> sh rm dirdat/*
a b le
fe r
s
b. On the target system EURO_EAST_GGSCI tab, enter the following commands:
n
GGSCI (EURO)> Stop ER *
n - tra
GGSCI (EURO)> Delete ER * !
a no
GGSCI (EURO)> sh rm dirdat/*
h a s ideฺ
This completes Practice 13-3. Continue now with) Practice 13-4.
u
o m t G
o n ฺc den
r i c ss s Stu
@ e
e t hi
t ฺ n ag us
( s uji
N ag
S ujit
Tasks
1. On the AMER_WEST_GGSCI tab, open the Wallet:
GGSCI (AMER)> Open Wallet
Opened wallet at location 'dirwlt'.
2. On the AMER_WEST_GGSCI tab, add a master key: (You need only one, but you can have
more than one.)
e to
GGSCI (AMER)> Add MasterKey
cens
Master key 'OGG_DEFAULT_MASTERKEY' added to wallet at location 'dirwlt'. l i
a ble
fe r
GGSCI (AMER)> Info MasterKey
a ns
Masterkey Name: OGG_DEFAULT_MASTERKEY
n- t r
no
Creation Date: Mon Dec 9 15:10:14 2013
a eฺ
s idStatus:
Version: Creation Date:
Mon Dec 9 15:10:14 )2013
h a u Current
1
o m t G
3. The Wallet cannot be explicitly closed,
o n ฺc nor does
d e nit need to be. You can still copy it at this
point. If this really bothers you,
i c tu GGSCI to completely release the Wallet. On
syou canSExit
scopy
the AMER_WEST_GGSCI e rtab,
t h i s
the Wallet single-sign-on file from source to target:
a
GGSCI (AMER)>
n g@ sh u s e dircrd/cwallet.sso $GG_EURO_HOME/dircrd
cp
s
GGSCI
u jitฺ (AMER)> sh cp dirwlt/cwallet.sso $GG_EURO_HOME/dirwlt
4. g ( that the master key made it to the target. On the EURO_EAST_GGSCI tab, execute
Verify
a
N the following commands:
u j i t
S GGSCI (EURO)> Open Wallet
GGSCI (EURO)> Info MasterKey
The information should match on both the source and the target. If you had a shared disk,
this extra step to copy would not be necessary.
5. You are going to use the original extwest, pwest, and reast from the earlier labs. The
two files that need to be modified are the Extract extwest and data pump pwest; the
replicat is okay as is.
On the AMER_WEST_GGSCI tab, edit the extwest and make sure that the last Table line
is a wildcard (as in Lab 6), not restricted (as in Lab 10).
GGSCI (AMER)> Edit Param extwest
Extract extwest
ExtTrail ./dirdat/ew
UserIDAlias gguamer
--Table WEST.ACCOUNT_TRANS, Where (ACCOUNT_TRANS_TYPE = "CR");
Table WEST.*;
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
a g@ starting
EXTRACT EXTWEST
n u s e
s u jitฺ START request to MANAGER ...
Sending
50 80071
EURO_SQL>
11. View the report for the pump. You should see the encryption type at the very end. On the
AMER_WEST_GGSCI tab, enter the following command:
GGSCI (AMER)> View Report pwest
...many lines omitted for clarity...
2013-12-09 16:04:26 INFO OGG-05519 Output trail file encryption: AES256.
e to
This was much simpler than the previous ENCKEYS method. The Wallet method is the
cens
l i
preferred method if available. The only reason that the previous method was shown first is
a ble
that not all Oracle GoldenGate platforms support the Wallet.
fe r
12. Clean up the Oracle GoldenGate environment by executing the following GGSCI
a ns
commands on both the source and target servers in the OGG HOME directories:
n- t r
GGSCI (both)> Stop ER *
a no
a s ideฺ
GGSCI (both)> DBLogin UserID gguser, Password oracle_4U
h
GGSCI (both)> Delete ER *
m ) G u (confirm the delete)
o
ฺc den t (only for the EURO db)
GGSCI (both)> Stopss o n
GGSCI (EURO)> Delete CheckpointTable
mgr ! tu
i
GGSCI (both)>eExit his
r c S
t
g@rm u./dirdat/*
e
[OS_PROMPT]
n a s
u jitฺ
[OS_PROMPT]
s
rm ./dirrpt/*
(
gDo not type the (red comments). If you wanted to automate this cleanup, then stop both
Na GGSCI sessions and run ~/labs/setup/kill-all-ogg.sh from the fifth
S ujit oracle@hostname tab.
This completes Practice 13-4. This completes the practices for Lesson 13. Stop here.
e to
cens
l i
a ble
fe r
a n s
Practices for n t r
-Lesson 14:
n o
a eฺ Replication
Bidirectional
s
) a
h 14 uid
ฺ c om ent G
Chapter
s s on tud
e ric this S
n a g@ use
u jitฺ
g ( s
Na
S ujit
Big Picture
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
In the preceding diagram, e
@ t
the AMER and
e hi two
EURO databases are exact copies of one another. Your
n a gEach data
application is load-balanced
u s
across the data centers so that each data center services 50%
In a two-way active-active (bidirectional) replication environment, you must avoid data looping,
where data changes replicated from system A to system B are replicated back to system A.
There are several loop detection and avoidance methods. You will configure each Extract
process to ignore transactions originated by its local Replicat user. This is done by setting the
TranLogOptions ExcludeUser parameter in the Extract parameter file.
Note: If at any time or for any reason you exit GGSCI, make sure you re-DBLogin when you
restart GGSCI. You can do this easily by entering:
GGSCI (BOTH)> Obey /home/oracle/labs/setup/startup.oby
e to
Tasks
cens
l i
1. Note that AMER is no longer the only source database and EURO is no longer the only target
a ble
database. Pay particular attention then to which tab you are entering the commands into.
fe r
On the AMER_WEST_SQLPLUS tab, navigate to the Section14/Practice14-
a ns
1/sqlscripts directory to run the script. To create the AMER database, execute the
n- t r
following commands:
a no
h a s ideฺ
[OS_prompt labs] rlsqlplus west@amer/oracle_4U
m ) G u
SQL> set sqlprompt AMER_SQL> o
ฺc den t
o n
ss s Stu
AMER_SQL> set echo on
e r i c i
AMER_SQL> @Section14/Practice14-1/sqlscripts/ database.sql
AMER_SQL> /*@ t h
n a g use Script to create the source database tables
s u jitฺSQL> This will simulate a banking database used with an OLTP
AMER_ SQL>
g ( AMER_
N a application
a ble
Scroll down the terminal window to see what objects were created, and what SQL
fe r
statements were executed.
a ns
3. On the EURO_EAST_SQLPLUS tab, navigate to the same Section14/Practice14-1/
n- t r
no
sqlscripts directory to run the same scripts. To create the EURO database, execute the
a
following commands:
h a s ideฺ
)
[OS_prompt labs] rlsqlplus east@euro/oracle_4U
m G u
o
ฺc den t
o n
sson s Stu
SQL> set sqlprompt EURO_SQL>
r i c
hi
EURO_SQL> set echo
EURO_SQL> @
e t
a g u s e
@Section14/Practice14-1/sqlscripts/ database.sql
EURO_
j i n /*
tฺSQL>
u
(sEURO_SQL> Script to create the source database tables
a g
i t N EURO_SQL> This will simulate a banking database used with an OLTP
S uj application
... Many lines omitted for clarity ...
Scroll down the terminal window to see that the same objects were created for schema
east as for west, and the same SQL statements were executed.
a ble
Scroll down the terminal window to see what objects were created, and what SQL
fe r
statements were executed.
a ns
n- t r
Creating the Replicat Checkpoint Table on AMER
a no
h a s ideฺ
Replicat checkpoints to a special table created in the database. This checkpoint table ensures
that the Replicat checkpoint is part of the transaction and is used to ensure data integrity. You
m ) G u
already had configured one for EURO (but it was deleted as part of the last cleanup).
o
c Todecreate
ฺAMER. t
n the GLOBALS parameter file, on the
5. Make sure GGSCI is not running in
o n tu command:
r i c
AMER_WEST_GGSCI tab, execute ss the s S
following
e
[OS_prompt gg_amer]
@ e t hi GLOBALS
vi
ag or any
You can usengedit
t ฺ u stext editor instead of vi. Input the following parameter line:
( s uji
CheckpointTable GGS_CHECKPOINT
N agNote: The file name must be all uppercase with no extension. Save and close the file.
S ujit 6. To create the checkpoint table on the AMER database server, on the AMER_WEST_GGSCI
tab, start GGSCI and execute the following commands:
[OS_prompt gg_amer] more GLOBALS
CheckpointTable GGS_CHECKPOINT
following commands:
[OS_prompt gg_euro] rlggsci
e to
GGSCI (EURO) 2> Add CheckpointTable
cens
l i
No checkpoint table specified, using GLOBALS specification (GGS_CHECKPOINT)...
a ble
Successfully created checkpoint table GGS_CHECKPOINT.
fe r
a ns
GGSCI (EURO) 3> set editor gedit
n- t r
This is optional…
no
Note: If the checkpoint table already exists, you will receive an error message. If so, issue
a
h a s ideฺ
the Delete CheckpointTable command, confirm the deletion, and then try adding the
checkpoint table again.
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
N a
S ujit
Many of these were already enabled. Had you originally done SchemaTranData, the
added tables would have automatically been picked up. Validate table-level supplemental
logging is on by executing the following command in the GG_AMER_HOME terminal window:
GGSCI (AMER) > Info TranData WEST.*
9. On the EURO_EAST_GGSCI database server tab, execute the following commands:
GGSCI (EURO) > Add TranData EAST.*
All of these were new (as compared to AMER’s TranData). Validate that table-level
e to
supplemental logging is on by executing the following command in the GG_EURO_HOME
cens
terminal window:
l i
GGSCI (EURO) > Info TranData EAST.*
a ble
Dropping a table and re-creating it will cause you to need to re-add the TranData, fe r
a ns
because TranData does not persist across a DDL TABLE DROP/CREATE. However,
SchemaTranData does effectively persist (well, actually it gets re-added) across a TABLE n- t r
DROP/CREATE. a no
h a s ideฺ
Creating the Oracle GoldenGate Components
m ) onGAMER u
o
ฺc Extract, e t
n Data Pump Extract, and Replicat on the
s o n
In this practice, you will configure the Manager,
tu d
AMER instance.
r i c s s S
From the previous practices,
@ e t hi still
ethisyoupractice,
should have a number of parameter files already created
for the AMER database.
n a g usFor you will be using:
s u jitฺ
• mgr.prm
a g• ( extwest.prm
N • pwest.prm
S ujit You will modify those three parameter files for this practice and create a number of new entries
for both the AMER and EURO databases.
GGSCI (AMER)>
12. On the AMER_WEST_GGSCI tab, modify the extract file by executing the following
e to
ns
command:
GGSCI (AMER) > Edit Param extwest
l i ce
b
Add the following parameter on an empty line just before the first Table statement:
a le
TranLogOptions ExcludeUser gguser fe r
n s
n - tra
Edit and verify that the extwest.prm file looks similar to the following:
Extract extwest
a no
ExtTrail ./dirdat/ew
h a s ideฺ
UserIDAlias gguamer
m ) G u
StatOptions ResetReportStats o
ฺc den t
Report At 00:01 s o n tu
ReportRollover rAt i c s00:01 s S
@ e 1000
e t hi Records
ReportCount
t ฺ n ag Every
Every
u s 60 Seconds, Rate
uji
ReportCount
GGSCI (AMER)>
14. On the AMER_WEST_GGSCI tab, configure the Extract Data Pump to read from the
dirdat/ew (“Extract West”) local Extract Trail, transmit the data to the EURO server, and
write it to the ./dirdat/pe (“Pump East”) Remote Trail:
e to
Execute the following command:
cens
GGSCI (AMER)> Edit Param pwest
l i
Verify that the file includes the following: (EncryptTrail is optional.)
a ble
fe r
Extract pwest
a ns
EncryptTrail AES256 This is optional…
n- t r
RmtHost easthost, MgrPort 15001, Compress
a no
RmtTrail ./dirdat/pe
h a s ideฺ
Passthru
m ) G u
Table WEST.*; o
ฺc den t
o n
Save and close the file.
r i c ss s Stu
15. Add the Extract groupe
@ t
by executing
e hi the following commands:
n ag Add
GGSCI (AMER)>
t ฺ u s Extract pwest, ExtTrailSource ./dirdat/ew
( s uji added.
EXTRACT
GGSCI (AMER)>
16. To set up Oracle GoldenGate Delivery on the AMER database, you must configure the
Replicat component. On the AMER_WEST_GGSCI tab, execute the following command:
GGSCI (AMER)> Edit Param rwest
The text editor of your choice opens the empty rwest.prm file. Add the following runtime
parameters to the text file:
Replicat rwest
AssumeTargetDefs
DiscardFile ./dirrpt/rwest.dsc, Purge
UserIDAlias gguamer
Map EAST.*, Target WEST.*;
Save and close the file.
GGSCI (AMER)>
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ
GGSCI (EURO)>
22. On the EURO_EAST_GGSCI tab, configure the Extract Data Pump to read from the
dirdat/ee local Extract Trail, transmit the data to the AMER server, and write it to the
dirdat/pw Remote Trail:
From a GGSCI prompt, execute the following command:
e to
GGSCI(EURO)> Edit Param peast
cens
Your text editor of choice opens the empty peast.prm file. Add the following runtime l i
parameters to the text file:
a ble
fe r
Extract peast
a ns
RmtHost westhost, MgrPort 15000, Compress
n- t r
RmtTrail ./dirdat/pw
a no
Passthru
h a s ideฺ
Table EAST.*;
m ) G u
o
ฺc den t
Save and close the file.
o n
s add the u group by executing the following
tExtract
23. On the EURO_EAST_GGSCIs tab, S
r i c s
commands:
@ e
e t hi
ag Add
GGSCI (EURO)>
t ฺ n u s Extract peast, ExtTrailSource ./dirdat/ee
( s uji
EXTRACT added.
to
Sending START request to MANAGER ...
EXTRACT EXTWEST starting
ns e
Sending START request to MANAGER ...
l i ce
EXTRACT PWEST starting
a ble
Sending START request to MANAGER ...
fe r
REPLICAT RWEST starting
a ns
n- t r
GGSCI (AMER)>
a no
h a s ideฺ
For EURO, the processes should all end in EAST:
GGSCI (EURO)> Start ER *
m ) G u
o
ฺc ...den t
o n
Sending START request to MANAGER
r i c s s Stu
EXTRACT EEAST starting s
i ...
e tothMANAGER
@
Sending START request
ag us
EXTRACT PEAST starting e
t ฺ n
( s uji START request to MANAGER ...
Sending
N
ujit
GGSCI (EURO)>
S
uj i t
S EXTRACT PEAST
Checkpoint Lag
Last Started 2013-12-10 14:24
00:00:00 (updated 00:00:01 ago)
Status RUNNING
Process ID 461
Log Read Checkpoint File ./dirdat/ee000000
First Record RBA 1413
EURO_SQL> @Section14/Practice14-1/sqlscripts/trans_generator_east.sql
29. After a minute (West takes longer than East), the transaction generator scripts complete.
Then execute the GGSCI command on each system:
GGSCI (BOTH)> Info ER *
This will display information for the two Replicats. When the Log Read Checkpoint RBA
value returned stops (slows) incrementing for the Replicats, all the captured data has been
applied.
e to
ns
Compare the RBA values with those you wrote down earlier, after you started the Replicats
and Extracts. The RBA values should now be much higher.
l i ce
30. Execute the command on the AMER_WEST_GGSCI tab to get operation counts per table for
a ble
the change data capture Extract:
fe r
GGSCI (AMER)> Stats extwest, Total
a n s
On the EURO_EAST_GGSCI tab, execute the same commandnfor
r
-t the Replicat.
o
GGSCI (EURO)> Stats reast, Total
s a n eฺ
ha (on EURO)
The counts for the Extract (on AMER) and Replicat
) u id numbers should match.
31. Do the same for the EEAST Extract andothe
c mRWESTn G The transaction counts for
t Replicat.
these components should match as ฺ e
on tud tab to get operation counts per table for
well.
s sEURO_EAST_GGSCI
is S
Execute the command on c
e i the
rExtract: h
the change data capture
g@ Stats t
e eeast, Total
a
GGSCI (EURO)>
n u s
s jitฺ
On theuAMER_WEST_GGSCI tab, execute the same command for the Replicat.
(
g GGSCI (AMER)> Stats rwest, Total
a
N The counts for the Extract (on EURO) and Replicat (on AMER) numbers should match.
S ujit Because TranLogOptions ExcludeUser GGUSER was specified in the Extract
parameter files on both AMER and EURO, it ensured that changes made by the local Replicat
user will not be extracted along with changes made by other users on that site.
32. Clean up the Oracle GoldenGate environment by executing the following GGSCI command.
This one script will reset both the source and target servers:
a. Exit both GGSCI prompts. This is necessary for the kill shell script.
b. On the fifth tab oracle@hostname, at the OS prompt, run:
[OS_prompt] ~/labs/setup/kill-all-ogg.sh
This completes Practice 14-1. Continue now with Practice 14-2.
Conflicts occur when the timing of simultaneous changes results in one of the following out-of-
sync conditions:
• A replicated insert attempts to add a row that already exists in the target.
• The Before image of a replicated update does not match the current row in the target.
• A replicated delete attempts to remove a row that does not exist in the target.
For example, UserA on DatabaseA updates a row, and UserB on DatabaseB updates the same
row. If UserB’s transaction occurs before UserA’s transaction is synchronized to DatabaseB,
e to
there will be a conflict on the replicated transaction.
cens
In this practice, you will set up a very simple Oracle GoldenGate configuration to demonstrate l i
net change value. Conflict detection and conflict resolution will be implemented to maintain
a ble
accurate inventory counts when the application uses update statements to decrement inventory.
fe r
The premise for this demonstration is an online retail environment where:
a ns
1. The warehouse is stocked with 20 widgets. If the quantity on hand goes to 0, the item n- t r
no
is tagged as out of stock in our online ordering system.
a
a s ideฺ
2. Customer A places an order for 15 widgets that is routed through the AMER (also
h
known as West) database.
m ) G u
o
ฺc den
• The SQL statement executed is: t
o n
r i c ss s Stu
UPDATE products SET qty_in_stock = qty_in_stock + 10
hi
WHERE products_name = 'widget' AND qty_in_stock = 20;
@ e t
e
3. Customer B simultaneously places an order for 4 widgets that is routed through the
g us
ti ฺna
EURO (also known as East) database.
• ujThe SQL statement executed is:
g ( s
N a UPDATE products SET qty_in_stock = qty_in_stock + 4
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
Tasks
h a s ideฺ
m ) G u
Creating the Table and Data in the ฺDatabase o
c den t
o
1. On the AMER_WEST_SQLPLUSstab, create
n tuthe table in the AMER database by executing the
following commands. If r i c sare stillsconnected
S
e you
t h i as west@amer, then just run the .sql
script:
n a g@ use
j i tฺ
[OS_prompt
u
labs] rlsqlplus west@amer/oracle_4U
ns fe
4. On the EURO_EAST_GGSCI tab, execute the following commands to enable supplemental
t r a
logging:
no n-
[OS_prompt gg_euro] rlggsci a
sOracleideฺ
Oracle GoldenGate Command Interpreter for
h a
GGSCI (EURO) 1> DBLogin c o m) nt Gggueuro
UserIDAlias
u
Successfully logged into o
s nฺ tude
database.
GGSCI (EURO) e
cs is S EAST.PRODUCTS, Cols (product_name,
2>ri Add TranData
g @ e th modified_ts)
vendor,
s
qty_in_stock,
ฺnofa supplemental
u
u j i
Loggingt redo data enabled for table WEST.PRODUCTS.
N a
uj i t GGSCI (EURO) 3> Info TranData EAST.PRODUCTS
S Logging of supplemental redo log data is enabled for table EAST.PRODUCTS.
Columns supplementally logged for table EAST.PRODUCTS: PRODUCT_NUMBER,
PRODUCT_NAME, VENDOR, QTY_IN_STOCK, MODIFIED_TS.
GGSCI (AMER)>
7. On the EURO_EAST_GGSCI tab, verify that the Manager parameter file is configured:
GGSCI (EURO)> Edit Param mgr
Verify that at least the following parameters are present:
Port 15001
PurgeOldExtracts ./dirdat/*, UseCheckpoints
e to
Save and close this file.
cens
8. Start the East Manager process: l i
GGSCI (EURO)> Start mgr
a ble
fe r
Manager started.
a ns
n- t r
no
GGSCI (EURO)> Info manager
a
Manager is running (IP port easthost.15001, Process ID 18408).
s ideฺ
) h a u
GGSCI (EURO)>
o m t G
o n ฺc den
Setting Up Change Data Capture
i c ss on tu
AMER
S
9. On the AMER_WEST_GGSCI r i
e tab,thexecutes the following command to create and edit the
a @
g us
parameter file for the “Extracte West Conf lict” group, ewconf:
n
jitฺ (AMER)> Edit Param ewconf
GGSCI
s u
( text editor of your choice opens the empty ewconf.prm file. Add the following runtime
a gThe
jit N parameters to the text file:
Su Extract ewconf
ExtTrail ./dirdat/wf
UserIDAlias gguamer
GetUpdateBefores
TranLogOptions ExcludeUser gguser
Table WEST.PRODUCTS GetBeforeCols(On Update All);
Check the Reference for Oracle GoldenGate in ~/Documents. Write down the purpose of
the GetUpdateBefores parameter:
Answer:_________________________________________________________________
Save and close the file.
GGSCI (AMER)>
11. On the AMER_WEST_GGSCI tab, set up the Extract Data Pump on the AMER database by
executing the following command:
GGSCI (AMER)> Edit Param pwconf
The text editor of your choice opens the empty pwconf.prm file. Add the following runtime
e to
parameters to the text file:
cens
Extract pwconf l i
a ble
RmtHost easthost, MgrPort 15001, Compress
fe r
RmtTrail ./dirdat/pf
a ns
Passthru
n- t r
Table WEST.*;
a no
Save and close the file.
h a s ideฺ
12. On the AMER_WEST_GGSCI tab, add the m ) PumpGExtract
Data u group by executing the
o
c dData
following commands. Configure the ฺExtract e t
nPump to read from the dirdat/wf local
o n
r i c s s Stuserver, and write it to the dirdat/pf Remote
Extract Trail, transmit the datasto the AMER
Trail:
@ e
e t hi pwconf, ExtTrailSource ./dirdat/wf
t ฺ n ag us
GGSCI (AMER)> Add Extract
uji
EXTRACT added.
( s
g GGSCI (AMER)> Add RmtTrail ./dirdat/pf, Extract pwconf
N a
ujit
RMTTRAIL added.
Replicat reconf
AssumeTargetDefs
DiscardFile ./dirrpt/reconf.dsc, Purge
UserIDAlias ggueuro
AllowDupTargetMap
IgnoreUpdates
Map WEST.*, Target EAST.*;
GetUpdates
e to
IgnoreInserts
cens
l i
IgnoreDeletes
a ble
Map WEST.products, Target EAST.products,
fe r
CompareCols(On Update All),
a ns
ResolveConflict (UpdateRowExists, n- t r
a no
(delta_resolution_method, UseDelta, Cols (qty_in_stock)),
(max_resolution_method,
h a s ideฺ
UseMax (modified_ts), Cols
(vendor, modified_ts)),
m ) G u
o
ฺc den t
(Default, Overwrite));
o n u
This Map statement performs
r i c ssthe conflict
s S tdetection and resolution on the WEST.PRODUCTS
e
table for transactions performed t h
oni the EAST.PRODUCTS table. For all update operations, a
@ e
ag againstusthe target table and the data from the qty_in_stock column is
query is executed
returned.jitฺn
(
If thes u
Before (source) and current (target) values for qty_in_stock are not equal (that is,
N aga conflict is detected), the source table value for qty_in_stock is subtracted from the
jit
Su source Before image qty_in_stock value. The result is then subtracted from the current
target qty_in_stock value (returned from the query), and the result is applied to the
target table.
Save and close the file.
15. On the EURO_EAST_GGSCI tab, add the Replicat by executing the following command:
GGSCI (EURO)> Add Replicat reconf, ExtTrail ./dirdat/pf
REPLICAT added.
GGSCI (EURO)>
The text editor of your choice opens the empty eeconf.prm file. Add the following runtime
parameters to the text file:
Extract eeconf
ExtTrail ./dirdat/eg
UserIDAlias ggueuro
GetUpdateBefores
TranLogOptions ExcludeUser gguser
Table EAST.PRODUCTS GetBeforeCols(On Update All);
e to
17. On the EURO_EAST_GGSCI tab, add the Extract group by executing the following
cens
l i
commands. Add the Extract group eeconf to start extracting now and to write to a trail file
a ble
in the dirdat directory with a name of eg.
fe r
GGSCI (EURO)> Add Extract eeconf, TranLog, Begin Now
a ns
EXTRACT added.
n- t r
a no
h a s ideฺ
GGSCI (EURO)> Add ExtTrail ./dirdat/eg, Extract eeconf
EXTTRAIL added.
m ) G u
GGSCI (EURO)> o
ฺc den t
o n tuthe Extract Data Pump to read from the
s configure
18. On the EURO_EAST_GGSCIs tab, S
r i c s
dirdat/eg local Extract
@ e hi the data to the AMER server, and write it to the
e Trail,ttransmit
dirdat/pg Remote
t ฺ n ag Edit
Trail:
u s
s u ji
GGSCI (EURO)> Param peconf
( text editor of your choice opens the empty peconf.prm file. Add the following runtime
gThe
a
N parameters to the text file:
u j i t
S Extract peconf
RmtHost westhost, MgrPort 15000, Compress
RmtTrail ./dirdat/pg
Passthru
Table EAST.*;
Save and close the file.
19. On the EURO_EAST_GGSCI tab, add the Extract group by executing the following
commands:
GGSCI (EURO)> Add Extract peconf, ExtTrailSource ./dirdat/eg
EXTRACT added.
GGSCI (EURO)>
GGSCI (AMER)>
21. On the AMER_WEST_GGSCI tab, configure the Replicat delivery component:
GGSCI (AMER)> Edit Param rwconf
The text editor of your choice opens the empty rwconf.prm file. Add the following runtime
parameters to the text file:
Replicat rwconf
e to
AssumeTargetDefs
cens
DiscardFile ./dirrpt/rwconf.dsc, Purge l i
a ble
UserIDAlias gguamer
fe r
AllowDupTargetMap
a ns
IgnoreUpdates
n- t r
Map EAST.*, Target WEST.*;
a no
GetUpdates
h a s ideฺ
IgnoreInserts
m ) G u
IgnoreDeletes o
ฺc den t
o n
r i c ss s Stu
Map EAST.products, Target WEST.products,
@ e
e t hi
CompareCols(On Update All),
g us
ti ฺna
ResolveConflict (UpdateRowExists,
GGSCI (AMER)>
a
2013-12-11 09:47:48 Seqno 307, RBA 8429056
s ideฺ
) h a
SCN 0.6297903 (6297903)
u
EXTRACT PWCONF Last Startedm
c o t G
2013-12-11
n
09:47 Status RUNNING
Checkpoint Lag
o nฺ (updated
00:00:00
s t u de00:00:05 ago)
sFile ./dirdat/wf000000
c is S
Process ID 20713
e r i h
Log Read Checkpoint
g@ usFirst t
e Record RBA 1415
n a
s u jitฺ RWCONF Last Started 2013-12-11 09:47 Status RUNNING
REPLICAT
N Process ID 20714
GGSCI (AMER)>
c s
s00:00:00 S
Checkpoint Lag
r i
e 20784 hi s (updated
Process ID
@ e t
t ฺ n ag usFile
Log Read Checkpoint ./dirdat/pf000000
a g ( GGSCI (EURO)>
N
S ujit If any Oracle GoldenGate group shows a status of STOPPED or ABEND, view the report file,
correct any errors, and then restart the group.
24. SQL*Plus should still be running for both instances AMER and EURO. Set the screen size to
be friendlier:
a. On the AMER_WEST_SQLPLUS tab, enter:
AMER_SQL> set lines 200
AMER_SQL> set pages 40
b. On the EURO_EAST_SQLPLUS tab, enter:
EURO_SQL> set lines 200
EURO_SQL> set pages 40
( s uTotal 8.00
S Total operations
Total CDR conflicts
8.00
4.00
CDR resolutions succeeded 4.00
CDR UPDATEROWEXISTS conflicts 4.00
...many lines omitted for clarity...
e to
cens
l i
a ble
fe r
a n s
Practices for n t r
-Lesson 15: DDL
n o
a eฺ
Replication
s
) h a u id
ฺ c omChapter
e n t15G
s s on tud
e ric this S
n a g@ use
u jitฺ
g ( s
Na
S ujit
Practices Overview
In this practice, you will support the synchronization of DDL operations in homogeneous,
unidirectional environments.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit
Assumptions
To enable DDL capture, several modifications must be made to the source database;
specifically, the creation of five tables in a tablespace with sufficient space to allow growth of the
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ
marker and history tables, a database trigger and associated packages, and a user role.
Before attempting to set up DDL capture, all open sessions in the database must be closed
(which requires a database outage in a production environment).
Tasks
To set up the source database for DDL capture, execute the following on the
AMER_WEST_SQLPLUS tab:
1. Choose which schema DDL objects will be created in. (For this practice, the GGUSER e to
schema will be used because it exists on both the source and the target.) Using the text
cens
l i
editor of your choice, edit the GLOBALS file, located in the source Oracle GoldenGate home
a ble
directory, and add the following parameter: GGSCHEMA GGUSER.
fe r
[OS_prompt labs] cd $GG_AMER_HOME
a ns
[OS_prompt gg_amer] gedit GLOBALS n- t r
CheckpointTable GGS_CHECKPOINT a no
GGSCHEMA GGUSER h a s ideฺ
m ) G u
Save and close the file. o
ฺc SQL*Plus e n t
2. On the AMER_WEST_SQLPLUSstab, o nstart t u d as sysdba:
c s S
ri trlsqlplus
e
[OS_prompt gg_amer] h is / as sysdba
@
ag DBA
3. Execute the following e
scommands:
t ฺ n u
( s uji GRANT EXECUTE ON UTL_FILE TO gguser;
SQL>
a g Grant succeeded.
N
S ujit SQL>
You will be prompted for the name of a schema for the Oracle GoldenGate
database objects.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ
e to
MARKER TABLE
-------------------------------
cens
l i
le
OK
r a b
MARKER SEQUENCE
-------------------------------
ns fe
OK
t r a
Script complete. no n-
a
s ideฺ
SQL>
) h a u
o m t G
o n ฺc den
r i c ss s Stu
@ e
e t hi
t ฺ n ag us
( s uji
ag
N
S ujit
You will be prompted for the name of a schema for the Oracle GoldenGate
database objects.
NOTE: For an Oracle 10g source, the system recycle bin must be disabled. For
Oracle 11g and later, it can be enabled.
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.
to
Working, please wait ...
Spooling to file ddl_setup_spool.txt
ns e
Checking for sessions that are holding locks on Oracle Golden Gate metadata
l i ce
tables ...
a ble
Check complete.
fe r
a ns
Using GGUSER as a Oracle GoldenGate schema name.
n- t r
no
Working, please wait ...
a
s ideฺ
DDL replication setup script complete, running verification script...
) h a u
Please enter the name of a schema for the GoldenGate database objects:
Setting schema name to GGUSER
o m t G
o n ฺc den
CLEAR_TRACE STATUS:
r i c ss s Stu
Line/pos
@ e
e t hi Error
No errorsag s
---------------------------------------- ------------------------------------
i t ฺn u No errors
s j
u Many lines omitted for clarity ...
g ( ...
N a
ujit
Analyzing installation status...
Script complete.
SQL>
To use a different role name, quit this script and then edit the params.sql
script to change the gg_role parameter to the preferred name.
You will be prompted for the name of a schema for GoldenGate database objects.
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.
e to
PL/SQL procedure successfully completed.
cens
l i
le
Role setup script complete
Grant this role to each user assigned to the Extract, GGSCI, and Manager
r a b
processes, by using the following SQL command:
ns fe
GRANT GGS_GGSUSER_ROLE TO <loggedUser>
t r a
where <loggedUser> is the user assigned to the GoldenGate processes.
SQL> no n-
a eฺ
sGGSUSER_ROLE
7. As specified in the role_setup.sql output, h
) a
grant
u i d to the Oracle
GoldenGate database user:
ฺ c om ent G
SQL> GRANT ggs_ggsuser_role
s s on tuTOd gguser;
Grant succeeded.
e ric this S
g@ use
SQL>
n a
jitฺ@ddl_enable.sql
8. Enable DDL triggers:
s u
g ( Trigger altered.
SQL>
N a
S ujit SQL>
9. Make the ddl_pin script part of the database startup. It must be invoked with the Oracle
GoldenGate DDL username. (This script improves the performance of the DDL trigger and
requires the Oracle dbms_shared_pool system package.)
SQL> @ddl_pin GGUSER
SQL> exit
[OS_prompt]
Exit SQL*Plus. The database is now set up and enabled for DDL capture. Had you been
using Integrated Extract, none of these @scripts for triggers would have been necessary
because Integrated Extract supports DDL replication by default.
This completes Practice 15-1. Continue now with Practice 15-2.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Tasks
Housekeeping Considerations
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2017, Oracle and/or its affiliatesฺ
For continuing operations, the DDL marker, history, and trace tables must be monitored and
routinely cleared of old or nonessential data.
1. On the AMER_WEST_GGSCI tab, start GGSCI:
[OS_prompt gg_amer] rlggsci
GGSCI (AMER) 1> set editor gedit
2. On the AMER_WEST_GGSCI tab, edit the mgr.prm parameter file. Add the following three
lines to the end of the file:
e to
UserIDAlias gguamer
cens
l i
PurgeMarkerHistory MinKeepDays 3, MaxKeepDays 5
a ble
PurgeDDLHistory MinKeepDays 3, MaxKeepDays 5
fe r
a ns
Port 15000 n- t r
a no
PurgeOldExtracts ./dirdat/*, UseCheckpoints, MinKeepDays 1
DynamicPortList 15100-15150
h a s ideฺ
UserIDAlias gguamer m ) G u
o
ฺc den t
n
PurgeMarkerHistory MinKeepDays 3, MaxKeepDays 5
o
c ss s Stu
PurgeDDLHistory MinKeepDays 3, MaxKeepDays 5
r i
@ e t hi lines in your file slightly differ from the book. The
Do not be concerned ifethe existing
g is touadd
purpose of thisatask
n s the last three lines that are for PurgeMarkerHistory and
t ฺ
uji
PurgeDDLHistory.
( s
Save and close the file.
3. ag
On the AMER_WEST_GGSCI tab, stop and restart the Oracle GoldenGate Manager:
N
S ujit GGSCI (AMER)> Stop mgr !
GGSCI (AMER)> Start mgr
Note: To prevent the DDL trace file from consuming excessive disk space, run the
@ddl_cleartrace.sql script on a regular basis. This script deletes the file, but Oracle
GoldenGate will create it again. This script must be run manually or via cron.
5. On the EURO_EAST_SQLPLUS tab, navigate to the same ~/labs, and execute the same
SQL script to clean out the target schema:
e to
[OS_prompt] cd ~/labs
cens
[OS_prompt labs] rlsqlplus east@euro/oracle_4U l i
@Section15/sqlscripts/drop_tables.sql
a ble
PL/SQL procedure successfully completed. fe r
a ns
EURO_SQL> SELECT * FROM user_tables;
n- t r
no rows selected
a no
Leave SQL*Plus running.
h a s ideฺ
6. Dropping the tables in the previous stepsm ) haveGalso
should u cleared the TranData
o
c den t
(transaction data). Verify this on theฺAMER_WEST_GGSCI tab:
o n tu
GGSCI (AMER)> DBLogin
r i c ss UserIDAlias
s S gguamer
Successfully logged
@ e hi
into database.
e t
GGSCI (AMER)>
n g Info
aviable u s TranData WEST.*
ji
ERROR:t ฺ
s u No tables matched specification.
a g ( GGSCI (AMER)>
N
S ujit Note: The last step of the practice verifies that the TranData comes back automatically.
7. To set up Oracle GoldenGate Change Data Capture on the source server
AMER_WEST_SQLPLUS tab, configure the change data capture extract (eddl.prm) with the
following parameters:
GGSCI (AMER)> Edit Param eddl
The text editor of your choice opens the empty eddl.prm file. Enter the following
parameters:
Extract eddl
ExtTrail ./dirdat/ed
UserIDAlias gguamer
-- DDL Include Mapped ObjName "WEST.*" <-- This won’t work!
DDL Include Mapped ObjName WEST.*
DDLOptions AddTranData, Report
Table WEST.*;
Save and close the file.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
EXTTRAIL added.
GGSCI (AMER)>
9. On the source AMER_WEST_GGSCI tab, configure the Extract Data Pump (pddl.prm) to
read from the dirdat/ed local Extract Trail, transmit the data to the target server, and
write it to the dirdat/pd Remote Trail:
GGSCI (AMER)> Edit Param pddl
The text editor of your choice opens the empty pddl.prm file. Add the following runtime
e to
parameters to the text file:
cens
Extract pddl l i
RmtHost easthost, MgrPort 15001, Compress
a ble
fe r
RmtTrail ./dirdat/pd
a ns
Passthru
n- t r
Table WEST.*;
a no
Save and close the file.
h a s ideฺ
10. Add the Extract group by executing the following
m ) GGSCI G u commands:
o
ฺc pddl, e t
nExtTrailSource ./dirdat/ed
GGSCI (AMER)> Add Extract
s o n u d
t./dirdat/pd,
GGSCI (AMER)> Add sRmtTrail S
e r i c i s
Extract pddl
@
11. On the target EURO_EAST_GGSCI
g e th tab, Replicat checkpoints to a special table created in
the database.a
ฺnandThis s
u table ensures that the Replicat checkpoint is part of the
checkpoint
j i t
u Table.
transaction is used to ensure data integrity. If it does not already exist, create the
( s
Checkpoint
N agOn the target server EURO_EAST_GGSCI tab, start GGSCI and execute the following
S ujit commands:
[OS_prompt gg_euro] rlggsci
GGSCI (EURO) 1> set editor gedit
GGSCI (EURO) 2> DBLogin UserIDAlias ggueuro
GGSCI (EURO) 3> Info CheckpointTable
GGSCI (EURO) 4> Add CheckpointTable
Note: Because this is a frequent-enough sequence, it is useful to create an Obey file with
these commands that could be invoked by entering:
GGSCI> Obey /home/oracle/labs/setup/startup.oby
Replicat rddl
DiscardFile ./dirrpt/rddl.dsc, Purge
AssumeTargetDefs
UserIDAlias ggueuro
DDL Include Mapped
Map WEST.*, Target EAST.*;
Save and close the file.
e to
13. Add the Replicat by executing the following GGSCI command:
cens
l i
GGSCI (EURO)> Add Replicat rddl, ExtTrail ./dirdat/pd
a ble
14. Verify that the mgr process is running on both the AMER_WEST_GGSCI tab and the
fe r
EURO_EAST_GGSCI tab.
a ns
n- t r
no
GGSCI (BOTH)> Info mgr
a
s ideฺ
If the manager process is not already running, start it, and then verify that it is running:
) h a u
GGSCI (BOTH)> Start mgr
GGSCI (BOTH)> Info mgr ฺc o m n t G
o n d e
To start the Extract and Replicat
i c tu issue the following command on both the
ss processes,
S
e
AMER and EURO instances. r t hi s
@
ag us e
t ฺ n
( s uji
N ag
jit
Su
to
Log Read Checkpoint Oracle Redo Logs
2013-12-11 17:42:51 Seqno 308, RBA 22850048
ns e
SCN 0.6319581 (6319581)
l i ce
EXTRACT PDDL Last Started 2013-12-11 17:42 Status RUNNING
a ble
Checkpoint Lag 00:00:00 (updated 00:00:01 ago)
fe r
Process ID 29973
a ns
Log Read Checkpoint File ./dirdat/ed000000
n- t r
no
First Record RBA 1411
a
GGSCI (AMER)> h a s ideฺ
m ) G u
On EURO: o t
GGSCI (EURO)> Startso
nฺc
ER * tud
en
r i c s sS
i ...
e tothMANAGER
REPLICAT a
@
Sending START request
g starting
s e
t ฺ n RDDL
u
( s uji (EURO)> Info ER *
GGSCI
a g
N
ujit
REPLICAT RDDL Last Started 2013-12-11 17:42 Status RUNNING
S Checkpoint Lag
Process ID
00:00:00 (updated 00:00:08 ago)
29995
Log Read Checkpoint File ./dirdat/pd000000
First Record RBA 0
GGSCI (EURO)>
Table created.
Table created.
Table created.
Table created.
Table created.
AMER_SQL>
16. On the AMER_WEST_SQLPLUS tab, execute the following SQL script:
e to
AMER_SQL> @Section15/sqlscripts/seed_database.sql
cens
l i
PL/SQL procedure successfully completed.
a ble
fe r
AMER_SQL> a ns
n- t r
no
17. On the AMER_WEST_SQLPLUS tab, execute the following SQL script:
a
a s ideฺ
AMER_SQL> @Section15/sqlscripts/trans_generator.sql
h
m ) G u
o
PL/SQL procedure successfully completed.
ฺc den t
o n tu
AMER_SQL>
ss s Sgenerator
rictransaction
Wait a few seconds forethe
t h i to complete.
n a g@ use
s
18. On(the
jitฺ
Validating the Results
uEURO_EAST_SQLPLUS tab, execute the following query:
g
a EURO_SQL> SELECT table_name FROM user_tables;
i t N
S uj TABLE_NAME
------------------------------
ACCOUNT
ACCOUNT_TRANS
BRANCH
TELLER
TELLER_TRANS
BRANCH_ATM
6 rows selected.
SQL>
Six tables should have been created/replicated in the EAST schema.
Output to ./dirdat/ed:
e to
ns
Extracting from GGUSER.GGS_MARKER to GGUSER.GGS_MARKER:
n
... Many lines omittedofor
End of Statistics.ri
c ss s Stu
@ e
e t hi
GGSCI n
t ฺ ag us
(AMER)>
The s
( uji output should show mapped DDL operations followed by transaction counts for
Stats
a gall tables where data was captured.
N
S ujit
no
TRANS_NUMBER, TELLER_TRANS_TS.
GGSCI (AMER)> a
s ideฺ
This completes Practice 15-2. This completes the h a
) practicesufor Lesson 15. Stop here.
o m t G
o n ฺc whether
If you are in a classroom, ask the instructor
d e nyou should leave the PCs running or not,
signed in, or logged off.
r i c ss s Stu
@ e
e t hi
t ฺ n ag us
( s uji
g
jit Na
Su
e to
cens
l i
a ble
fe r
a ns
n- t r
a no
h a s ideฺ
m ) G u
o
ฺc den t
o n
r i c ss s Stu
@ e
e t hi
g us
u jti ฺna
g ( s
Na
S ujit