Académique Documents
Professionnel Documents
Culture Documents
D66519GC10
Edition 1.0
April 2011
Author
Karen Kehn
Disclaimer
This document contains proprietary information and is protected by copyright and other intellectual
property laws. You may copy and print this document solely for your own use in an Oracle training
course. The document may not be modified or altered in any way. Except where your use constitutes
"fair use" under copyright law, you may not use, share, download, upload, copy, print, display,
perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part
without the express authorization of Oracle.
The information contained in this document is subject to change without notice. If you 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 warranted to be error-free.
Restricted Rights Notice
Heike Hundt
Viktor Tchemodanov
Joe Greenwald
Deirdre Matishak
Editors
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 applicable:
U.S. GOVERNMENT RIGHTS
The U.S. Governments rights to use, modify, reproduce, release, perform, display, or disclose these
training materials are restricted by the terms of the applicable Oracle license agreement and/or the
applicable U.S. Government contract.
Daniel Milne
Trademark Notice
Richard Wallis
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be
trademarks of their respective owners.
Publishers
Nita Brozowski
Joseph Fernandez
Objectives
After completing this lesson, you should be able to:
Describe Oracle GoldenGate features and functionality
Identify key capabilities and differentiators
Describe Oracle GoldenGate high-availability and disaster
tolerance solutions
Describe Oracle GoldenGate real-time data integration
solutions
1-2
1-3
1-4
1-5
Broadcast
Data Distribution
1-6
Bidirectional
Standby DB or
Active-Active for HA
Integration/Consolidation
Data Warehouse
Peer-to-Peer
Load Balancing,
Multimaster
Cascading
Data Marts
Oracle
Applications
Custom
Applications
MDM
Applications
Business
Intelligence
Activity
Monitoring
SOA
Platforms
Data Services
Data Federation
Oracle GoldenGate
ELT/ETL
Real-Time Data
Data Profiling
Data Transformation
Log-Based CDC
Data Parsing
Replication
Data Cleansing
Data Lineage
Data Verification
Storage
1-7
Service Bus
Data Warehouse/
Data Mart
OLTP
System
OLAP Cube
Flat Files
Web 2.0
ELT
Transformation
Oracle GoldenGate
Real-Time Data
Heterogeneous Sources
Oracle GoldenGate
1-8
Heterogeneous Targets
BI Application
Production
OLTP Databases
1-9
Capture
tx5
Source Trail
tx4
LAN/WAN/
Internet
tx3
tx2
tx1
Target Trail
Deliver
ODI
Data
Warehouse
1 - 10
Upgrade/migrate/
maintain database,
hardware, OS,
and/or application.
Minimizes risk with
fall-back option
Improves success
with phased user
migration
1 - 11
Siebel CRM
v6 or 7
Siebel CRM
v6 or 7
Capture
Delivery
Route
LAN/WAN/Web/IP
Non Oracle DB
Delivery
Fallback
Data Flow
Capture
Oracle
DB
Zero database
downtime for
upgrades from 8i,
9i, or 10g to 11g
Leverage new
features of Oracle
Database 11g
without impacting
business
operations.
Minimize risks by
using the failback
option.
1 - 12
Zero Downtime
Database Upgrades
Switchover
Application
Real-Time Updates
Capture
Delivery
Route
LAN/WAN/Web/IP
Oracle
8i/9i/10g
Delivery
Post-Switchover
Data Flow
Capture
Oracle
11g
Disaster Recovery
and Data Protection
Switchover
Application
Non-Oracle
platforms
Delivery
Route
LAN/WAN/Web/IP
Source
Cross-OS and
Oracle database
version
requirements
1 - 13
Real-Time Updates
Capture
Active-active
configurations
Can be
used for
reporting,
testing,
etc.
Delivery
Post-Switchover
Data Flow
Capture
Standby
1 - 14
Read-only
activity
Application
Real-Time Data
Route
LAN/WAN/Web/IP
Delivery
Oracle
Replica
Operational Reporting
OLTP
Application
Reporting
Application
Real-Time Data
Capture
Production
Database
1 - 15
Trail File
Trail File
Delivery
Route
LAN/WAN/Web/IP
Reporting
Instance
Application
Application
Capture
Source &
Target DB
Delivery
Route
LAN/WAN/Web/IP
Delivery
1 - 16
Source &
Target DB
Capture
Quiz
Which statements are true about Oracle GoldenGate? (Select
more than one.)
a. GoldenGate is an Oracle Database product that supports
other Oracle products.
b. GoldenGate is a middleware product that does not require
an Oracle database.
c. GoldenGate captures changes from the Oracle Redo logs
or non-Oracle transaction logs and moves them to another
database.
d. GoldenGate can support high availability.
1 - 17
Quiz
Oracle GoldenGate is middleware software for business
intelligence, and it is designed to support a heterogeneous
database environment.
a. True
b. False
1 - 18
Summary
In this lesson, you should have learned how to:
Describe Oracle GoldenGate features and functionality
Describe Oracle GoldenGate solutions for real-time
business intelligence
Describe Oracle GoldenGate for continuous availability
1 - 19
Technology Overview
Objectives
After completing this lesson, you should be able to:
Describe Oracle GoldenGate functionality and components
List supported databases and platforms
Describe the Oracle GoldenGate product line
2-2
Extract
Source
Oracle and non-Oracle
Database(s)
2-3
LAN/WAN Internet
TCP/IP
Target
Oracle and non-Oracle
Database(s)
Extract
Source
Oracle and non-Oracle
Database(s)
2-4
Trail
LAN/WAN Internet
TCP/IP
Target
Oracle and non-Oracle
Database(s)
Extract
Source
Oracle and non-Oracle
Database(s)
2-5
Trail
Pump
LAN/WAN Internet
TCP/IP
Target
Oracle and non-Oracle
Database(s)
Extract
Source
Oracle and non-Oracle
Database(s)
2-6
Trail
Trail
Pump
LAN/WAN Internet
TCP/IP
Target
Oracle and non-Oracle
Database(s)
Source
Oracle and non-Oracle
Database(s)
2-7
Trail
Trail
Pump
LAN/WAN Internet
TCP/IP
Replicat
Target
Oracle and non-Oracle
Database(s)
Source
Oracle and non-Oracle
Database(s)
2-8
Trail
Trail
Pump
LAN/WAN Internet
TCP/IP
Bidirectional
Replicat
Target
Oracle and non-Oracle
Database(s)
Windows
Linux
Sun Solaris
HP NonStop
HP-UX
HP TRU64
HP OpenVMS
IBM AIX
IBM z/OS
z/linux
Description
2 - 10
Oracle GoldenGate
Veridata performs highspeed, low-impact data
comparisons between
homogeneous and
heterogeneous
databases.
Veridata identifies and
reports data
discrepancies without
interrupting those
systems or the business
processes that they
support.
2 - 11
GoldenGate
GoldenGate
Director
Synchronize
Synchronize
GoldenGate
2 - 12
Synchronize
Synchronize
GoldenGate
GoldenGate
2 - 13
Source
Log
Primary
Extract
Trail
Data Pump
Extract
Extract
Flat File
User Exit
Control File
Trail
Manager
Manager
Data Files
2 - 14
Manager
Network
VAM
Message Extract
Capture
Source
Application
JMS
Messages
Collector
Trail
Source definitions
Trail
Gendef
Replicat
Target Database
2 - 15
2 - 16
Quiz
Which statements are true?
a. The Extract process can capture committed changes from
the transaction logs and write them to a trail file.
b. The Data Pump process can capture committed changes
from the transaction logs and write them to a trail file.
c. The Data Pump process can move data from a local trail
file to a remote trail file.
d. The Replicat process can move changes from a local trail
file to the database.
2 - 17
Quiz
What products make-up the Oracle GoldenGate product line?
(Select all that apply.)
a. Oracle GoldenGate Veridata
b. Oracle GoldenGate Director
c. Oracle GoldenGate Application Adapters (that is, Flat File
and Java adapters)
2 - 18
Summary
In this lesson, you should have learned how to:
List the building blocks that make up GoldenGate
functionality
List the supported platforms and infrastructure
Describe the Oracle GoldenGate product line
2 - 19
Objectives
After completing this lesson, you should be able to:
Describe the logical Oracle GoldenGate architecture and
components
Describe Oracle GoldenGate process groups
Explain change capture and delivery
Explain initial data load
Contrast batch and online operations
Explain Oracle GoldenGate checkpointing
Describe the commit sequence number (CSN)
Describe Oracle GoldenGate files
3-2
3-3
3-4
Network
Initial Load
Replicat
Extract
Manager
Collector
Extract
Data source for change
synchronization:
Transaction log or
vendor access module
Replicat
Trail or File
(Optional)
Data
Pump
3-5
Manager
Change Synchronization
Target
DB
3-6
GGSCI
3-7
Parameter Files
3-8
By default, parameter files are saved to the dirprm subdirectory of the Oracle GoldenGate directory.
Network
(TCP/IP)
Extract
Transaction
Log
Replicat
Trail
Manager
3-9
Server
Collector
Manager
Target
DB
Network
(TCP/IP)
Server
Collector
Extract
Transaction
Log
(Optional)
Replicat
Remote
Trail
Data
Pump
Manager
3 - 10
Manager
Target
DB
3 - 11
File to Replicat
Extract writes to a file that Replicat applies using SQL.
3 - 12
Initial Load
Network
(TCP/IP)
Extract
Replicat
Source
Database
Tables
Target
DB
Server
Collector
Or DB bulk
load utility
Files
Manager
3 - 13
Manager
Checkpoints
Begin, TX 1
Insert, TX 1
Begin, TX 2
Begin, TX 2
Update, TX 1
Insert, TX 2
Insert, TX 2
Commit, TX 2
Commit, TX 2
Begin, TX 3
Begin, TX 3
Insert, TX 3
Insert, TX 3
Begin, TX 4
Commit, TX 3
Current
Write
Position
Commit, TX 3
Delete, TX 4
Current Read
Position
Source
Database
Capture
Commit Ordered
Source Trail
Capture
Checkpoint
3 - 14
Checkpoints
Begin, TX 1
Insert, TX 1
Begin, TX 2
Begin, TX 2
Update, TX 1
Insert, TX 2
Insert, TX 2
Commit, TX 2
Commit, TX 2
Capture
Checkpoint
Begin, TX 3
Insert, TX 3
Insert, TX 3
Begin, TX 4
Commit, TX 3
Begin, TX 3
Current
Write
Position
Pump
Checkpoint
Begin, TX 2
Insert, TX 2
Commit, TX 2
Current
Write
Position
Current
Read
Position
Commit, TX 3
Delete, TX 4
Current Read
Position
Source
Database
Capture
Capture
Checkpoint
3 - 15
Commit Ordered
Source Trail
Pump
Commit Ordered
Target Trail
Pump
Checkpoint
Checkpointing
Begin, TX 1
Insert, TX 1
Begin, TX 2
Begin, TX 2
Update, TX 1
Insert, TX 2
Insert, TX 2
Commit, TX 2
Insert, TX 3
Insert, TX 3
Commit, TX 3
Begin, TX 3
Current
Write
Position
Delivery
Checkpoint
Begin, TX 2
Insert, TX 2
Commit, TX 2
Capture
Checkpoint
Begin, TX 3
Begin, TX 4
Pump
Checkpoint
Commit, TX 2
Current
Write
Position
Current
Read
Position
Current
Read
Position
Commit, TX 3
Delete, TX 4
Current Read
Position
Source
Database
Commit Ordered
Source Trail
Capture
Capture
Checkpoint
3 - 16
Pump
Commit Ordered
Target Trail
Pump
Checkpoint
Delivery
Target
Database
Delivery
Checkpoint
3 - 17
Discussion Questions
1. How is Oracle GoldenGate different from simply replicating
database operations?
2. What is the purpose of checkpointing?
3 - 18
Quiz
Which of the following statements is true?
a. GoldenGate checkpoints are stored in an Oracle control
file.
b. The CKPT background process records the GoldenGate
checkpoint.
c. The GoldenGate checkpoint supports GoldenGate
recovery.
d. There is likely to be only one GoldenGate checkpoint file.
3 - 19
Summary
In this lesson, you should have learned how to:
Describe the uses of Oracle GoldenGate
Explain change capture and delivery (with and without a
data pump)
Explain initial data load
Contrast batch and online operation
Explain Oracle GoldenGate checkpointing
Describe Oracle GoldenGate parameters, process groups,
and GGSCI commands
3 - 20
Objectives
After completing this lesson, you should be able to:
Download the required Oracle GoldenGate Media Pack
Understand how to install Oracle GoldenGate on Linux,
UNIX, and Windows
Run Oracle GoldenGate commands from the Oracle
GoldenGate Software Command Interface (GGSCI)
Identify the types of GGSCI commands available
Use an OBEY file
4-2
System Requirements
Operating system
A number of combinations are certified for the database
version and operating system. Check the documentation for
certification requirements.
4-3
Memory requirements
The amount of memory that GoldenGate requires depends
on the number of concurrent processes that will be running.
Each Extract and Replicat process needs approximately 25
MB to 55 MB of memory.
Swap space must be sufficient for each Oracle GoldenGate
Extract and Replicat process. This can be determined after
setting up one Extract or Replicat.
4-4
Disk requirements
50 MB to 150 MB free disk space depending on the
database and platform
Trail files: You can assign a separate disk for trial files.
The default size is 10 MB, but to optimize space you can use
the PURGEOLDEXTRACTS parameter.
TCP/IP
Configure the system to use TCP/IP services, including DNS.
Configure one port for communication between the Manager
process and other Oracle GoldenGate processes.
Configure a range of ports for local Oracle GoldenGate
communications.
4-5
4-6
4-7
Installation on Windows
4-8
GoldenGate Directories
Directory
Contents
dirchk
dirdat
dirdef
dirpcs
dirprm
Parameter files
dirrpt
dirsql
SQL scripts
dirtmp
4-9
4 - 11
To re-execute a command:
GGSCI> !
4 - 12
GGSCI Commands
MANAGER
EXTRACT
REPLICAT
ADD
ALTER
EXTTRAIL
RMTTRAIL
TRANDATA
CHECKPOINT
TABLE
TRACE
TABLE
CLEANUP
DELETE
KILL
LAG
INFO
ER
REFRESH
SEND
START
STATS
STATUS
STOP
4 - 13
GGSCI Commands
Commands
Parameters
Database
DDL
DUMPDDL [SHOW]
4 - 15
GGSCI Examples
4 - 17
OBEY Files
4 - 18
4 - 19
4 - 20
Discussion Questions
1.
2.
3.
4.
4 - 21
Summary
In this lesson, you should have learned how to:
Download the required Oracle GoldenGate Media Pack
Install Oracle GoldenGate on Linux, UNIX, and Windows
Locate and use Oracle GoldenGate documentation
Run GoldenGate commands from the GGSCI prompt, from
OBEY files, and from the OS shell
4 - 22
Practices
The practices for this lesson cover the following topics:
Preparing for the course labs
Installing Oracle GoldenGate
Introducing the GGSCI command-line interface
4 - 23
Objectives
After completing this lesson, you should be able to:
Describe the high-level configuration steps
Configure and start the Manager process
Configure supplemental logging on the database and at
the table level
Generate a source definitions file
Prepare a source database for transaction capture
5-2
2. Change capture
3. Initial load
4. Change delivery
5-3
Target
DB
Data Pump
Extract
Transaction
Log
Local
Trail
2. Change Capture
5-4
Replicat
Remote
Trail
4. Change Delivery
RESOURCE
CONNECT
CREATE TABLE
EXECUTE on DBMS_FLASHBACK
package
5-5
TRANDATA Command
5-6
5-7
5-8
5-9
5 - 10
5 - 11
UNIX example:
Windows example:
5 - 12
Quiz
ADD TRANDATA enables supplemental logging of key values in
the transaction logs whenever a row change occurs.
a. True
b. False
5 - 13
Quiz
Both the extract and replicat users require the DBA role for the
database.
a. True
b. False
5 - 14
Summary
In this lesson, you should have learned how to:
Describe the high-level configuration steps
Configure and start the Manager process
Generate a source definitions file
Prepare a source database for transaction capture
5 - 15
Practices
This practices for this lesson cover the following topics:
Preparing your environment
Creating the GLOBALS parameter file
Configuring and starting the GoldenGate Manager
Using the TRANDATA option
5 - 16
Objectives
After completing this lesson, you should be able to:
Describe what the Extract process does
Configure and start an Extract process
Configure and start an Extract data pump
Add local and remote trails
Configure Extract to access logs on Oracle Automatic
Storage Management (ASM)
6-2
Target
DB
Data Pump
Extract
Transaction
Log
Local
Trail
2. Change capture
6-3
Replicat
Remote
Trail
4. Change delivery
Extract Overview
6-4
6-5
Trail
Primary
Extract
Data Pump
Trail
Trail
Trail
6-7
Data Pump
Trail
Primary
Extract
Data Pump
Trail
Trail
Data Pump
Trail
6-8
6-9
6 - 10
Create a data pump Extract group named pump that reads from
the GoldenGate trail c:\ggs\dirdat\lt.
ADD EXTRACT pump, EXTTRAILSOURCE c:\ggs\dirdat\lt
6 - 11
6 - 12
Overview of Trails
6 - 13
When created, all file names in a trail begin with the same
two characters. Then, as additional files are needed, each
name is appended with a unique six-digit serial number.
Trails are stored in the dirdat sub-directory of the Oracle
GoldenGate directory.
6 - 14
6 - 15
Source
Database
EXTRACT finance
USERID login, PASSWORD pw
EXTTRAIL /ggs/dirdat/lt
TABLE SALES.ORDERS;
TABLE SALES.INVENTORY;
Transaction
Log
Extract
/ggs/dirdat/lt000000
/ggs/dirdat/lt000001
Trail
6 - 16
Local Trail
Data Pump
Remote Trail
/ggs/dirdat/rt000000
/ggs/dirdat/rt000001
6 - 17
EXTRACT pump
PASSTHRU
RMTHOST <target>, MGRPORT <port>
RMTTRAIL ./dirdat/rt
TABLE SALES.ORDERS;
TABLE SALES.INVENTORY;
6 - 18
ASM
Instance
DB
Instance
Data Access
6 - 19
Discussion Questions
1.
2.
3.
4.
6 - 20
Discussion Questions
6. What is a data pump?
7. What is the advantage of using a data pump?
8. Why might you use multiple data pumps for one source
trail?
9. What parameter is used to identify the remote target
system?
10. What other parameter is commonly used on data pumps?
6 - 21
Summary
In this lesson, you should have learned how to:
Configure and start an Extract process
Add local and remote trails
Configure and start a data pump
Understand the parameters to connect to an ASM instance
6 - 22
6 - 23
Objectives
After completing this lesson, you should be able to:
Describe Oracle GoldenGate initial load methods
Understand the prerequisites required before initiating an
initial load
Explain the advantages of Oracle GoldenGate methods
Configure an initial load by using Oracle GoldenGate
7-2
Extract
Transaction
Log
Local
Trail
2. Change capture
7-3
Replicat
Remote
Trail
4. Change delivery
7-4
7-5
7-6
Load Method
File to Replicat
Trail (canonical
format)
Database utility
Direct load
Replicat (directly)
Replicat (directly)
Replicat via
SQL*Loader API
7-7
Extract
Replicat
Files
Source
Database
7-8
Target
DB
SQL*
Loader
File
BCP
File
SSIS
Manager
Extract
Source
Database
7-9
Target
DB
Manager
Extract
Replicat
Target
DB
Source
Database
7 - 10
Extract
Manager
Replicat
SQL* Loader
API
Oracle
Target
Source
Database
Extract parameters:
RMTTASK REPLICAT, GROUP <name>
Replicat parameters:
BULKLOAD
7 - 12
Discussion Questions
1. What are the GoldenGate methods for initial load?
2. What GoldenGate command arguments specify that
Extract and Replicat run as batch tasks (for example, for
initial load)?
7 - 13
Summary
In this lesson, you should have learned how to:
Describe Oracle GoldenGate initial load methods
Explain the advantages of Oracle GoldenGate methods
Configure an initial load by using Oracle GoldenGate
7 - 14
Practices
This practices for this lesson cover the following topics:
Setting up the initial load by using the File to Replicat
method
Setting up the initial data load by using the Direct Load
method
7 - 15
Objectives
After completing this lesson, you should be able to:
Explain what the Replicat process does
Configure and start a Replicat process
Configure Replicat to handle collisions between changes
and the initial-load data
8-2
Target
DB
Data Pump
Extract
Transaction
Log
Local
Trail
Replicat
Remote
Trail
2. Change capture
8-3
4. Change delivery
Replicat Overview
8-4
8-5
Sample Configuration
Trail
Replicat
Target
DB
8-6
Avoiding Collisions
with Initial Load
8-7
Handling Collisions
with Initial Load
After all of the change data generated during the load has
been replicated, turn off HANDLECOLLISIONS:
GGSCI> SEND REPLICAT <group> NOHANDLECOLLISIONS
GGSCI> EDIT PARAMS <group> (to remove parameter)
8-8
Discussion Questions
1. What does Replicat do?
2. When is ASSUMETARGETDEFS valid?
3. How does Replicat know the layout of the source tables
when source and target schemas differ?
4. What commands are used to create and start a Replicat
group?
5. What GGSCI command creates a GoldenGate checkpoint
table on the target database?
6. What is the purpose of the DISCARDFILE?
7. What parameter manages conflicts between initial load
and change replication? Where is it specified?
8-9
Summary
In this lesson, you should have learned how to:
Explain what the Replicat process does
Configure and start a Replicat process
Configure Replicat to handle collisions between changes
and the initial load data
8 - 10
Practices
The practices for this lesson cover the following topics:
Setting up the checkpoint table on the target system
Setting up GoldenGate delivery
Generating data and starting GoldenGate processes
8 - 11
Objectives
After completing this lesson, you should be able to:
Describe and contrast Extract trails and files
Describe the formats that Extract trails and files may have
View Extract trails and files with Logdump
Reverse the sequence of operations in an Extract trail or
file (to back out changes)
9-2
9-3
9-4
9-5
9-6
Trail Format
9-7
9-8
Extract Information
- GoldenGate version
- Group name
- Hostname
- Hardware type
- OS type and version
- DB type, version, and
character set
9-9
9 - 10
The input and output trails of a data pump must have the
same compatibility level.
9 - 11
FORMATASCII
9 - 12
B,1997-02-17:14:09:46.421335,8,1873474,
I,A,TEST.CUSTOMER,CUSTNAME,'Eric',LOCATION,'San
Fran',BALANCE,550,
V,A,TEST.CUSTOMER,CUSTNAME,'Eric',BALANCE,100,
C,
9 - 13
FORMATSQL
9 - 14
9 - 15
FORMATXML
9 - 16
9 - 17
Logdump Utility
To access help:
Logdump 1> help
9 - 18
Opening a Trail
9 - 19
Setting up a View
9 - 20
012f
0000
0031
653a
6163
6972
0000
3000
0016
7572
6d63
6c65
6461
0800
0008
3300
693a
6361
3a73
742f
01e2
660d
000c
7465
7267
6f75
6572
4039
0a71
02f1
6c6c
6172
7263
3030
0000
3100
7834
7572
3a67
6536
3030
0c00
0006
eac7
6961
6773
0000
3030
0000
0001
7f3f
6e3a
3a67
1700
3700
0000
Length 587
Length 303
Length 103
Length
88
Length
85
Length
4
Length 587
Len
587 RBA 0
3200
3400
3a68
6773
112e
0005
001d
Info x00
|
|
|
|
|
|
|
0../0...f..q1.....2.
......3.....x4...?4.
.7.1uri:tellurian::h
ome:mccargar:ggs:ggs
Oracle:source6......
/dirdat/er0000007...
.8......@9..........
Length
303
3000 012f 3000 0008 660d 0a71 3100 0006 0001 3200 | 0../0...f..q1.....2.
etc.
9 - 21
9 - 22
Operation
type and the
time that the
record was
written
Source
table
Image type:
could be a
before or
after image
9 - 23
Column
information
Record
data,
in hex
Record data,
in ASCII
9 - 24
9 - 25
10562
55
300
1578
12
300
1590
229178
78
600
2324
14
600
23388
Filtering by a Filename
Logdump 7 > filter include filename TCUST*
Logdump 8 > filter match all
Logdump 9 > n
_______________________________________________________________
Hdr-Ind
:
E (x45)
Partition :
. (x00)
UndoFlag
:
. (x00)
BeforeAfter:
A (x41)
RecLength :
56 (x0038) IO Time
: 2002/04/30 15:56:40.814
IOType
:
5 (x05)
OrigNode
:
108 (x6c)
TransInd
:
. (x01)
FormatType :
F (x46)
SyskeyLen :
0 (x00)
Incomplete :
. (x00)
AuditRBA
: 105974056
2002/04/30 15:56:40.814 Insert
Len
56
Log RBA 1230
File: TCUSTMER
Partition 0
After Image:
3220 2020 4A61 6D65 7320 2020 2020 4A6F 686E 736F| 2 James
Johnso
6E20 2020 2020 2020 2020 2020 2020 4368 6F75 6472| n Choudr
616E 7420 2020 2020 2020 2020 2020 4C41
| LA
Filtering suppressed
9 - 26
18 records
9 - 27
9 - 29
9 - 30
9 - 31
Source
Database
Extract
ext1
File
Reverse
input
SPECIALRUN TRANLOG
BEGIN
END
GETUPDATEBEFORES
NOCOMPRESSDELETES
Filter criteria (if any)
EXTFILE or RMTFILE
(Table statements)
9 - 32
File
Replicat
rep1
output
9 - 33
9 - 34
Discussion Questions
1. What is a trail?
2. In what formats are Extract trails and files written?
3. What GoldenGate utility enables you to view trail contents?
9 - 35
Summary
In this lesson, you should have learned how to:
Describe and contrast Extract trails and files
Describe the formats that Extract trails and files may have
View Extract trails and files with Logdump
Reverse the sequence of operations in an Extract trail or
file (to back out changes)
9 - 36
Practice
This practice for this lesson covers using the Logdump utility.
9 - 37
Objectives
After completing this lesson, you should be able to:
Edit parameter files
Contrast GLOBALS with process parameters
Describe commonly used parameters for GLOBALS,
Manager, Extract, and Replicat
10 - 2
10 - 3
10 - 4
10 - 5
GLOBALS Parameters
GLOBALS parameters:
Control things common to all processes in a GoldenGate
instance
Can be overridden by parameters at the process level
10 - 6
10 - 7
PORT 7809
DYNAMICPORTLIST 90019100
AUTOSTART ER *
AUTORESTART EXTRACT *, WAITMINUTES 2, RETRIES 5
LAGREPORTHOURS 1
LAGINFOMINUTES 3
LAGCRITICALMINUTES 5
PURGEOLDEXTRACTS /ggs/dirdat/rt*, USECHECKPOINTS
10 - 8
Parameter Summary
General
Port Management
Process Management
Event Management
Database Login
Maintenance
10 - 9
10 - 10
10 - 11
EXTRACT ODS
USERID GoldenGateUser, PASSWORD password
RMTHOST manhattan, MGRPORT 7809
RMTTRAIL /ggs/dirdat/rt
TABLE SALES.ORDERS;
TABLE SALES.INVENTORY;
10 - 12
Parameter Summary
General
Processing Method
Database Login
Routing Data
Formatting Data
10 - 13
Parameter Summary
Custom Processing
Reporting
Error Handling
Tuning
Maintenance
Security
10 - 14
10 - 15
10 - 16
10 - 17
10 - 18
Error handling
Various optional parameter settings
10 - 19
REPLICAT SALESRPT
USERID ggsuser, PASSWORD ggspass
ASSUMETARGETDEFS
DISCARDFILE /ggs/dirrpt/SALESRPT.dsc, APPEND
MAP HR.STUDENT, TARGET HR.STUDENT
WHERE (STUDENT_NUMBER < 400000);
MAP HR.CODES, TARGET HR.CODES;
MAP SALES.ORDERS, TARGET SALES.ORDERS,
WHERE (STATE = CA AND OFFICE = LA);
10 - 20
Parameter Summary
General
Processing Method
Database Login
Selecting, Converting,
and Mapping Data
Routing Data
Defines the name of the Extract file or trail that contains data
to be replicated
10 - 21
Parameter Summary
Custom Processing
Reporting
Error Handling
Tuning
Maintenance
Security
10 - 22
10 - 23
Discussion Questions
1.
2.
3.
4.
10 - 25
Summary
In this lesson, you should have learned how to:
Edit parameter files
Contrast GLOBALS with process parameters
Describe commonly used parameters for GLOBALS,
Manager, Extract, and Replicat
10 - 26
Practices
This practices for this lesson cover the following topics:
Modifying source Manager parameters
Modifying the target Manager parameters
Modifying the Extract parameters on the source database
10 - 27
Objectives
After completing this lesson, you should be able to:
Select and filter data for replication
Map columns between different schemas
Use built-in functions
Use SQLEXEC to interact directly with a database
11 - 2
11 - 3
11 - 4
Selects
TABLE or MAP
Table
TABLE
11 - 5
WHERE
Row
FILTER
COLS | COLSEXCEPT
Columns
11 - 6
Example
PRODUCT_AMT
Comparison operators
Numeric values
Literal strings
Field tests
Conjunctive operators
11 - 7
Only rows where the amount was part of the operation and
has a value that is not NULL:
WHERE (AMOUNT @PRESENT AND AMOUNT <> @NULL);
11 - 8
11 - 9
11 - 10
11 - 11
Replicat #2
MAP SALES.ACCOUNT,
TARGET SALES.ACCOUNT, FILTER (@RANGE (2,3));
Replicat #3
MAP SALES.ACCOUNT,
TARGET SALES.ACCOUNT, FILTER (@RANGE (3,3));
11 - 12
11 - 13
11 - 14
11 - 15
11 - 16
11 - 17
Functions: Overview
11 - 18
Description
CASE
EVAL
IF
COLSTAT
COLTEST
VALONEOF
11 - 19
@IF Function
Function
Description
DATE
DATEDIFF
DATENOW
11 - 21
@DATE Function
11 - 22
Description
COMPUTE
NUMBIN
NUMSTR
STRCAT
STRCMP
STREQ
STREXT
STRFIND
STRLEN
11 - 23
Description
STRLTRIM
STRNCAT
STRNCMP
STRNUM
STRRTRIM
STRSUB
STRTRIM
STRUP
11 - 24
@STRCAT Function
11 - 25
@STREXT Function
11 - 26
Other Functions
Function
Description
BINARY
Keeps source data in its original binary format in the target when source
column is defined as character
BINTOHEX
GETENV
GETVAL
HEXTOBIN
HIGHVAL,
LOWVAL
Emulate COBOL functions that allow you to set a numeric limit on string or
binary data types
RANGE
Divides a workload into multiple groups of data, while ensuring the same row
will always be sent to the same process. RANGE uses a hash against primary
key or user-defined columns.
TOKEN
Maps environmental values that are stored in the user token area to the
target column
11 - 27
@RANGE Function
Note:
11 - 28
Overview of SQLEXEC
11 - 29
11 - 31
11 - 32
SQL Server
Sybase
Ingres
DB2
SQL Server/Sybase/Teradata
CHAR
VARCHAR2
DATE
All numeric types
LOBS up to 200
bytes
CHAR
VARCHAR2
DATE
All numeric types
BLOB data types
CHAR
VARCHAR
DATETIME
All numeric types
11 - 34
11 - 35
11 - 36
11 - 37
Parameter Syntax
Purpose
Executes a query
11 - 38
Quiz
SQLEXEC can communicate only via a SQL query.
a. True
b. False
11 - 39
Quiz
What is required if you are configuring column mapping or
transformation on the target system ? (Select one.)
a. Source-definitions file
b. Target-definitions file
c. Both a source-definitions file and a target-definitions file
d. Neither, because transformations never occur on the
target
11 - 40
Summary
In this lesson, you should have learned how to:
Select and filter data for replication
Map columns between different schemas
Use built-in functions
Use SQLEXEC to interact directly with a database
11 - 41
Objectives
After completing this lesson, you should be able to:
Create and invoke macros
Set and retrieve user tokens
Run user exits in GoldenGate processes
Replicate Oracle sequences
12 - 2
Overview of Macros
12 - 3
Creating Macros
12 - 4
Invoking a Macro
First, define the macro:
EXTRACT EXSALES
MACRO #make_date
PARAMS (#year, #month, #day)
BEGIN
@DATE(YYYY-MM-DD, CC, @IF(#year < 50, 20, 19),
YY, #year, MM, #month, DD, #day)
END;
12 - 5
12 - 6
12 - 7
12 - 8
12 - 9
12 - 10
Source
Option
General
LAG
LASTERR
JULIANTIMESTAMP
RECSOUTPUT
GoldenGate
GGENVIRONMENT
GGFILEHEADER
GGHEADER
RECORD
GoldenGate environment
Trail file header
Trail record header
Trail record location
Database
DBENVIRONMENT
TRANSACTION
Database environment
Source transaction
Operating
System
OSVARIABLE
OS environmental variable
12 - 11
12 - 12
12 - 13
12 - 14
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
jemhadar
EXTORA
AFTER
2003-03-24 17:08:59.000000
3604496
4058
SOURCE.CUSTOMER
INSERT
57
BEGIN
1
0
1229
8
ORA901
GGOODRIC
9.0.1.0.0
ora901
AAABBAAABAAAB0BAAF
12 - 15
12 - 16
12 - 17
12 - 18
12 - 19
12 - 20
12 - 21
12 - 22
12 - 23
Quiz
User _______ are a set of variables.
a. Macros
b. Tokens
c. Exits
d. Procedures
12 - 24
Quiz
User exits can be used for tables being processed by a data
pump Extract in pass-through mode.
a. True
b. False
12 - 25
Summary
In this lesson, you should have learned how to:
Create and invoke macros
Set and retrieve user tokens
Run user exits in GoldenGate processes
Replicate Oracle sequences
12 - 26
Practices
The practice for this lesson covers modifying an existing set of
macros and user tokens.
12 - 27
Configuration Options
Objectives
After completing this lesson, you should be able to use the
following:
BATCHSQL to speed delivery
13 - 2
Overview of BATCHSQL
13 - 3
BATCHSQL Syntax
13 - 4
BATCHSQL Results
13 - 6
Compression Options
13 - 7
Example of Compression
13 - 8
Encryption Overview
Encrypting and decrypting data can be done by using the
following methods:
Message encryption
Encrypts the messages sent over TCP/IP
Uses Blowfish, a symmetric 64-bit block cipher from CounterPane
Internet Security
The data is automatically decrypted by Server Collector before
saving the data to the trail.
13 - 9
Encryption Overview
Extract
Network
(TCP/IP)
Server
Collector
Replicat
Trail
Message Encryption
(Blowfish)
Trail or Extract File Encryption
(GoldenGate)
Parameters
Parameters
Database Password Encryption
13 - 10
Message Encryption
1. Run the GoldenGate KEYGEN utility to generate random
hex keys:
C:\GGS> RUN KEYGEN <key length> <number of keys>
13 - 11
Message Encryption
4. In the Extract parameter files, use the RMTHOST ENCRYPT
and KEYNAME parameters:
RMTHOST West, MGRPORT 7809, ENCRYPT BLOWFISH,
KEYNAME superkey
13 - 12
ENCKEYS
Extract
ENCKEYS
Network
(TCP/IP)
Server
Collector
Replicat
Trail
Extract Parameters:
RMTHOST
MGRPORT...
ENCRYPT BLOWFISH,
KEYNAME <keyname>
Startup command:
server -p <port>
-ENCRYPT BLOWFISH
-KEYNAME <keyname>
Message Encryption
(Blowfish)
13 - 13
Extract
Network
(TCP/IP)
Server
Collector
Replicat
Trail
Extract Parameters:
ENCRYPTTRAIL
<table statements>
Replicat Parameters:
DECRYPTTRAIL
<map statements>
Trail or Extract File
Encryption
13 - 14
For example:
GGSCI> ENCRYPT PASSWORD goldenpassword
No key specified, using default key...
Encrypted password: AACAAAAAAAAAAAOARAQIDGEEXAFAQJ
13 - 15
For example:
GGSCI> ENCRYPT PASSWORD MyPass, ENCRYPTKEY DRKEY
Encrypted password: AACAAAAAAAAAAAIAJFGBNEYGTGSBSHVB
2. Enter the key name and value in the ENCKEYS file. For
example :
##Key name
Key value
drkey
0x11DF0E2C2BC20EB335CB98F05471A737
13 - 16
ENCKEYS
Extract
(user-defined key)
(user-defined key)
Server
Collector
Network
(TCP/IP)
Extract Parameters:
[ SOURCEDB ] , USERID
, PASSWORD <encrypted password>
, ENCRYPTKEY DEFAULT | <keyname>
Replicat
Replicat Parameters:
[ TARGETDB ] , USERID
, PASSWORD <encrypted password>
, ENCRYPTKEY DEFAULT | <keyname>
Password Encryption
13 - 17
ENCKEYS
13 - 18
13 - 19
Reports Logs
Discards Chkpts
Reports Logs
EVENT
PROCESSING
EVENT
PROCESSING
Extract
Transaction
Log
13 - 20
Discards Chkpts
Replicat
Network
(TCP/IP)
Target
Trail
13 - 21
Log
Warning
TX1
TX2
Replicat
Heartbeat
TX4
13 - 22
Target
Trail
Copyright 2011, Oracle and/or its affiliates. All rights reserved.
Event Actions:
Automated Switchover Example
Switchover
Application
Application
1.
Extract
Source
Trans
Log
Network
(TCP/IP)
Replicat
Replicat
Trail
Target
Extract
Trail
13 - 23
2.
3.
Trans
Log
Event Actions:
Automated Synchronization Example
Application
Application
ETL
ETL
2a. 2a.
1.
Extract
Source
Trans
Log
Replicat
2.
Network
(TCP/IP)
3.
Replicat
Trail
Target
Extract
Trail
13 - 24
Trans
Log
Quiz
Key names and values can be stored in:
a. GLOBALS
b. ENCKEYS
c. SOURCEDEFS
d. DEFSFILE
13 - 25
Quiz
Only the ENCRYPTTRAIL extract parameter should be set to
encrypt and decrypt the records in the trail file.
a. True
b. False
13 - 26
Summary
In this lesson, you should have learned how to use the
following:
BATCHSQL to speed delivery
13 - 27
Practices
The practices for this lesson cover the following topics:
Setting up the database and source definitions file
GoldenGate encryption
13 - 28
Bidirectional Replication
Objectives
After completing this lesson, you should be able to:
Describe bidirectional configuration
Detect and avoid loops
Handle bidirectional issues such as loop detection and
handling conflicts
Handle identity types
14 - 2
Bidirectional Flowchart
Network
(TCP/IP)
Extract
Source
Replicat
Target
Trail
Transaction
Log
Source
Target
Network
(TCP/IP)
Replicat
Extract
Trail
14 - 3
Transaction
Log
14 - 4
14 - 5
Loop detection
Detect whether GoldenGate or the application
performed the operation.
Conflict avoidance, detection, and resolution
Detect whether an update occurred on both the source
and target before the changes were applied by
GoldenGate.
Determine the business rules on how to handle
collisions.
Sequence numbers and identity data types
Truncate table operations
14 - 6
14 - 7
14 - 8
14 - 9
14 - 10
14 - 11
Conflict Resolution
Addressing conflict resolution depends on your business rules.
For example:
Apply the net difference instead of the after value.
Map the data to an exception table for manual resolution.
Accept or ignore the change based on date and time.
14 - 12
Time
14 - 13
14 - 14
14 - 15
14 - 16
Quiz
Oracle GoldenGate supports bidirectional synchronization only
for homogeneous environments.
a. True
b. False
14 - 17
Quiz
Which parameters in Oracle can be used instead of a trace
table to allow loop detection? (Select all that apply.)
a. EXCLUDEUSER
b. IGNORETRUNCATES
c. EXCLUDEUSERID
d. USEREXCLUDE
14 - 18
Summary
In this lesson, you should have learned how to:
Handle loop detection in a bidirectional environment
Understand conflict resolution by applying net differences
Understand the limitations of using Oracle sequence
numbers and truncate operations in a bidirectional
configuration
14 - 19
Practices
The practices for this lesson cover the following topics:
Two-way active-active data replication
Conflict detection
14 - 20
DDL Replication
Objectives
After completing this lesson, you should be able to:
Understand the concept of DDL replication
Explain the requirements for Oracle DDL replication
Describe GoldenGate options for DDL replication
Explain how to activate DDL capture
15 - 2
15 - 3
15 - 4
15 - 5
15 - 6
Clusters
Functions
Indexes
Packages
Procedure
15 - 7
tables
tablespaces
roles
sequences
synonyms
triggers
types
views
materialized views
users
DDL Scopes
MAPPED
Is specified in a TABLE or MAP statement
Operations: CREATE, ALTER, DROP, RENAME, GRANT*,
REVOKE*
Objects: TABLE*, INDEX, TRIGGER, SEQUENCE*,
MATERIALIZED VIEW*
UNMAPPED
Does not have a TABLE or MAP statement
OTHER
TABLE or MAP statements do not apply.
DDL operations other than those listed above
Examples: CREATE USER, CREATE ROLE, ALTER
TABLESPACE
15 - 8
15 - 9
DDL Parameter
15 - 10
15 - 12
Error Handling
Replicat syntax:
DDLERROR
{<error> | DEFAULT} {<response>}
[RETRYOP MAXRETRIES <n> [RETRYDELAY <delay>]]
{INCLUDE <clause> | EXCLUDE <clause>}
[, IGNOREMISSINGTABLES | ABENDONMISSINGTABLES]
[, RESTARTCOLLISIONS | NORESTARTCOLLISIONS]
Where <response> can be IGNORE, ABEND, or DISCARD
15 - 13
Mapping Schemas
MAPSESSIONSCHEMA allows the mapping of a source
session schema to another schema on the target:
15 - 16
Extract
Replicat
15 - 17
15 - 18
Quiz
Which of the following statements are true? (Select all that
apply.)
a. Oracle GoldenGate supports the synchronization of only
DDL changes
b. Oracle GoldenGate supports the synchronization of only
DML changes
c. Oracle GoldenGate supports the synchronization of both
DDL and DML changes
15 - 20
Quiz
What parameter in DDLOPTIONS supports DDL replication in an
active-active bidirectional configuration?
a.
b.
c.
d.
15 - 21
MAPPSESSIONSCHEMA
IGNOREAPPLOPS
UPDATEMETADATA
NOCROSSRENAME
Summary
In this lesson, you should have learned how to:
Understand how DDL operations are categorized into
scopes
Use the DDL and DDLOPTIONS parameters
15 - 22
Practices
The practice for this lesson covers DDL replication.
15 - 23
Objectives
After completing this lesson, you should be able to:
Use command permissions
Manage trail files
Automate the process setup
Handle TCP/IP errors
Use reporting and statistics
Monitor processes, lags, and error messages
16 - 2
16 - 3
File Contents
Explanation
Comment line
START REPLICAT * * NO
* EXTRACT 200 * NO
16 - 4
16 - 5
16 - 6
TCPERRS File
# TCP/IP error handling parameters
# Default error response is abend
#
# Error Response Delay(csecs) Max Retries
ECONNABORTED RETRY 1000 10
ECONNREFUSED RETRY 1000 12
ECONNRESET RETRY 500 10
ENETDOWN RETRY 3000 50
ENETRESET RETRY 1000 10
ENOBUFS RETRY 100 60
ENOTCONN RETRY 100 10
EPIPE RETRY 500 10
ESHUTDOWN RETRY 1000 10
ETIMEDOUT RETRY 1000 10
NODYNPORTS RETRY 100 10
16 - 7
16 - 8
16 - 9
What It Shows
INFO {EXTRACT |
REPLICAT} <group>
[DETAIL]
INFO MANAGER
INFO ALL
STATS {EXTRACT |
REPLICAT} <group>
STATUS {EXTRACT |
REPLICAT} <group>
STATUS MANAGER
Run status
LAG {EXTRACT |
REPLICAT} <group>
16 - 10
What It Shows
INFO {EXTTRAIL |
RMTTRAIL} <path name>
SEND MANAGER
SEND {EXTRACT |
REPLICAT}
VIEW GGSEVT
<command> ER
<wildcard>
16 - 11
16 - 12
Process Reports
Process reports (depending on the process) allow you to view
the following:
Parameters in use
Table and column mapping
Database information
Run-time messages and errors
Run-time statistics for the number of operations
processed
16 - 13
16 - 14
Discard Files
16 - 15
16 - 16
16 - 17
Quiz
What tool would you use to determine whether all of the
GoldenGate processes are up and running? (Select all that
apply.)
a. TCPERRS
b. CMDSEC
c. GGSCI
d. Process report
16 - 18
Quiz
What files are used to capture information about Oracle
GoldenGate operations that have failed?
a. Discard files
b. Purge trail files
c. TCPERRS files
16 - 19
Summary
In this lesson, you should have learned how to:
Purge trail files
Handle TCP/IP errors with the TCPERRS file
16 - 20