Você está na página 1de 10

Oracle GoldenGate 11g

Fundamentals for Oracle


Student Guide

D66519GC10
Edition 1.0
February 2011
D72291

Copyright 2011, Oracle and/or its affiliates. All rights reserved.


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
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.
Trademark Notice
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective
owners.

Author
Karen Kehn
Technical Contributors and Reviewers
Glenn Goodrich, Eric Siglin, Sue Jang, Loren Penton, Randy Richeson, Heike Hundt, Viktor
Tchemodanov, Joe Greenwald, Deirdre Matishak
This book was published using:

Oracle Tutor

Table of Contents
Introduction to Oracle GoldenGate 11g: Fundamentals for Oracle .............................................................1-1
Introduction to Oracle GoldenGate 11g: Fundamentals for Oracle ...............................................................1-2
Objectives ......................................................................................................................................................1-3
Oracle GoldenGate 11g .................................................................................................................................1-4
Key Capabilities and Technology Differentiators ............................................................................................1-5
Value Propositions for Oracle GoldenGate ....................................................................................................1-6
Oracle GoldenGate Topologies ......................................................................................................................1-7
Oracle Middleware for Business Intelligence .................................................................................................1-8
Oracle Data Integrator EE and Oracle GoldenGate ......................................................................................1-9
Oracle GoldenGate for Real-Time Data Warehousing ..................................................................................1-10
Oracle GoldenGate Solutions for Oracle Database........................................................................................1-11
Oracle GoldenGate for Oracle Database Eliminate Downtime for Migrations and Application Upgrades ......1-12
Oracle GoldenGate for Oracle Database Eliminate Downtime During Oracle Database Upgrades ...............1-13
Oracle GoldenGate for Oracle Database Eliminate Unplanned Downtime with Active Data Guard
and Oracle GoldenGate ..............................................................................................................................1-14
Oracle GoldenGate for Oracle Database Improve Production System Performance and Lower Costs .........1-15
Oracle GoldenGate for Operational Reporting ...............................................................................................1-16
Oracle GoldenGate for Oracle Database Increase Return on Investment (ROI) on Existing Servers
and Synchronize Global Data......................................................................................................................1-17
Quiz................................................................................................................................................................1-18
Summary ........................................................................................................................................................1-20
Technology Overview ......................................................................................................................................2-1
Technology Overview.....................................................................................................................................2-2
Objectives ......................................................................................................................................................2-3
Oracle GoldenGate: Modular Building Blocks ................................................................................................2-4
Supported Databases and Operating Systems ..............................................................................................2-10
Oracle GoldenGate Product Line ...................................................................................................................2-11
Oracle GoldenGate Veridata ..........................................................................................................................2-12
GoldenGate Director: Overview .....................................................................................................................2-13
Adapter Integration Options for Oracle GoldenGate .....................................................................................2-14
Oracle GoldenGate for Flat File .....................................................................................................................2-15
Oracle GoldenGate Application Adapter for Java...........................................................................................2-16
JMS Messaging Capture ................................................................................................................................2-17
Quiz................................................................................................................................................................2-18
Summary ........................................................................................................................................................2-20
Oracle GoldenGate Architecture.....................................................................................................................3-1
Oracle GoldenGate Architecture ....................................................................................................................3-2
Objectives ......................................................................................................................................................3-3
Oracle GoldenGate Uses ...............................................................................................................................3-4
Oracle GoldenGate Components ...................................................................................................................3-5
Oracle GoldenGate Logical Architecture ........................................................................................................3-6
Oracle GoldenGate Process Groups..............................................................................................................3-7
GGSCI ...........................................................................................................................................................3-8
Parameter Files ..............................................................................................................................................3-9
Change Data Capture and Delivery ...............................................................................................................3-10
Change Data Capture and Delivery Using a Data Pump ..............................................................................3-11
Online Versus Batch Operation ......................................................................................................................3-12
Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Oracle GoldenGate 11g Fundamentals for Oracle Table of Contents


i

Running an Initial Load ..................................................................................................................................3-13


Initial Load ......................................................................................................................................................3-14
Checkpoints ...................................................................................................................................................3-15
Checkpointing ................................................................................................................................................3-17
Commit Sequence Number (CSN) .................................................................................................................3-18
Discussion Questions .....................................................................................................................................3-19
Quiz................................................................................................................................................................3-20
Summary ........................................................................................................................................................3-21
Installing Oracle GoldenGate ..........................................................................................................................4-1
Installing Oracle GoldenGate .........................................................................................................................4-2
Objectives ......................................................................................................................................................4-3
System Requirements ....................................................................................................................................4-4
Operating System Requirements ...................................................................................................................4-5
Downloading Oracle GoldenGate...................................................................................................................4-8
Installation on UNIX, Linux, or z/OS ...............................................................................................................4-9
Installation on Windows .................................................................................................................................4-10
GoldenGate Directories ..................................................................................................................................4-11
Oracle GoldenGate Documentation ...............................................................................................................4-13
GGSCI Command Interface ...........................................................................................................................4-14
GGSCI Commands ........................................................................................................................................4-15
GGSCI Examples ...........................................................................................................................................4-19
OBEY Files ....................................................................................................................................................4-20
New Oracle GoldenGate 11gR1 GGSCI Miscellaneous Commands .............................................................4-21
Running GoldenGate from the OS Shell ........................................................................................................4-22
Discussion Questions .....................................................................................................................................4-23
Summary ........................................................................................................................................................4-24
Practices ........................................................................................................................................................4-25
Configuration Overview and Preparing the Environment ............................................................................5-1
Configuration Overview and Preparing the Environment ..............................................................................5-2
Objectives ......................................................................................................................................................5-3
Configuring Oracle GoldenGate .....................................................................................................................5-4
Preparing the Environment: Oracle Database ................................................................................................5-6
TRANDATA Command ..................................................................................................................................5-7
Preparing the Environment: Oracle Database ................................................................................................5-8
Preparing the Environment: Manager Overview.............................................................................................5-9
Preparing the Environment: Configuring Manager .........................................................................................5-10
Preparing the Environment: Sample Manager Parameter File ......................................................................5-11
Preparing the Environment: Overview of Source Definitions .........................................................................5-12
Preparing the Environment: Running DEFGEN .............................................................................................5-13
Quiz................................................................................................................................................................5-14
Summary ........................................................................................................................................................5-16
Practices ........................................................................................................................................................5-17
Configuring Change Capture ..........................................................................................................................6-1
Configuring Change Capture .........................................................................................................................6-2
Objectives ......................................................................................................................................................6-3
Step 2: Change Capture ................................................................................................................................6-4
Extract Overview ............................................................................................................................................6-5
Data Pump Overview .....................................................................................................................................6-6
Data Pumps: One-to-Many Trails ...................................................................................................................6-8
Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Oracle GoldenGate 11g Fundamentals for Oracle Table of Contents


ii

Data Pumps: One-to-Many Target Systems ..................................................................................................6-9


Setting Up Change Capture ...........................................................................................................................6-10
ADD EXTRACT Command ............................................................................................................................6-11
ADD EXTRACT Examples .............................................................................................................................6-12
Editing Extract Parameters ............................................................................................................................6-13
Overview of Trails ..........................................................................................................................................6-14
Adding a Local or Remote Trail ......................................................................................................................6-15
Starting the Extract.........................................................................................................................................6-16
Primary Extract Configuration for Oracle ........................................................................................................6-17
Data Pump Configuration for Oracle ..............................................................................................................6-18
Automatic Storage Management (ASM).........................................................................................................6-19
Ensuring ASM Connectivity ............................................................................................................................6-20
Discussion Questions .....................................................................................................................................6-21
Summary ........................................................................................................................................................6-23
Practice 6-1 Overview: ...................................................................................................................................6-24
Configuring Initial Load ...................................................................................................................................7-1
Configuring Initial Load ..................................................................................................................................7-2
Objectives ......................................................................................................................................................7-3
Step 3. Initial Load .........................................................................................................................................7-4
Initial Load: Advantages of GoldenGate Methods ..........................................................................................7-5
Initial Load: Resource Limitations ..................................................................................................................7-6
Prerequisites for Initial Load ...........................................................................................................................7-7
Initial Load: Oracle GoldenGate Methods ......................................................................................................7-8
Initial Load: File to Replicat ............................................................................................................................7-9
Initial Load: File to Database Utility ................................................................................................................7-10
Initial Load: Direct Load .................................................................................................................................7-11
Initial Load: Direct Bulk Load (to Oracle) ........................................................................................................7-13
Discussion Questions .....................................................................................................................................7-14
Summary ........................................................................................................................................................7-15
Practices ........................................................................................................................................................7-16
Configuring Change Delivery ..........................................................................................................................8-1
Configuring Change Delivery .........................................................................................................................8-2
Objectives ......................................................................................................................................................8-3
Step 4. Change Delivery ................................................................................................................................8-4
Replicat Overview ..........................................................................................................................................8-5
Change Delivery Tasks ..................................................................................................................................8-6
Sample Configuration.....................................................................................................................................8-7
Avoiding Collisions with Initial Load ...............................................................................................................8-8
Handling Collisions with Initial Load ..............................................................................................................8-9
Discussion Questions .....................................................................................................................................8-10
Summary ........................................................................................................................................................8-11
Practices ........................................................................................................................................................8-12
Extract Trail and Files ......................................................................................................................................9-1
Extract Trail and Files ....................................................................................................................................9-2
Objectives ......................................................................................................................................................9-3
Overview of Extract Trails and Files ...............................................................................................................9-4
Extract Trails and Files Distribution ................................................................................................................9-5
Extract Trails and Files Contents ...................................................................................................................9-6
Extract Trails and Files Cleanup ....................................................................................................................9-7
Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Oracle GoldenGate 11g Fundamentals for Oracle Table of Contents


iii

Trail Format ....................................................................................................................................................9-8


Record Header Area ......................................................................................................................................9-9
Record Data Area ..........................................................................................................................................9-10
Setting the Compatibility Level .......................................................................................................................9-11
Alternative Trail Formats ................................................................................................................................9-12
FORMATASCII...............................................................................................................................................9-13
FORMATASCII Sample Output ......................................................................................................................9-14
FORMATSQL .................................................................................................................................................9-15
FORMATSQL Sample Output ........................................................................................................................9-16
FORMATXML.................................................................................................................................................9-17
FORMATXML Sample Output ........................................................................................................................9-18
Logdump Utility ..............................................................................................................................................9-19
Opening a Trail...............................................................................................................................................9-20
Setting up a View ...........................................................................................................................................9-21
Viewing the Trail File Header .........................................................................................................................9-22
Viewing Trail Records ....................................................................................................................................9-23
Counting Records in the Trail .........................................................................................................................9-25
Filtering by a Filename ...................................................................................................................................9-27
Locating a Hex Data Value ............................................................................................................................9-28
Saving Records to a New Trail .......................................................................................................................9-30
Keeping a Log of Your Session ......................................................................................................................9-31
Overview of the Reverse Utility ......................................................................................................................9-32
Overall Process of the Reverse Utility ............................................................................................................9-33
Reverse: Overall Process ..............................................................................................................................9-34
Sample Parameter Files .................................................................................................................................9-35
Discussion Questions .....................................................................................................................................9-36
Summary ........................................................................................................................................................9-37
Practice ..........................................................................................................................................................9-38
Oracle GoldenGate Parameters ......................................................................................................................10-1
Oracle GoldenGate Parameters .....................................................................................................................10-2
Objectives ......................................................................................................................................................10-3
Oracle GoldenGate Parameter Files ..............................................................................................................10-4
Using Parameter Files ....................................................................................................................................10-5
GLOBALS Versus Process Parameters .........................................................................................................10-6
GLOBALS Parameters ...................................................................................................................................10-7
Manager Parameters: Overview.....................................................................................................................10-8
Sample Manager Parameter File ...................................................................................................................10-9
Manager Parameter Categories .....................................................................................................................10-10
Extract Parameter Overview ..........................................................................................................................10-11
Extract Parameter Defaults ............................................................................................................................10-12
Sample Extract Parameter File ......................................................................................................................10-13
Extract Parameter Categories ........................................................................................................................10-14
Extract Example: TABLE Parameter ..............................................................................................................10-16
Extract Example: TRANLOGOPTIONS Parameter ........................................................................................10-17
Replicat Parameter Overview.........................................................................................................................10-19
Replicat Parameter Defaults ..........................................................................................................................10-20
Sample Replicat Parameter File.....................................................................................................................10-21
Replicat Parameter Categories ......................................................................................................................10-22
Replicat Example: MAP Parameter ................................................................................................................10-24
Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Oracle GoldenGate 11g Fundamentals for Oracle Table of Contents


iv

Discussion Questions .....................................................................................................................................10-26


Summary ........................................................................................................................................................10-27
Practices ........................................................................................................................................................10-28
Data Selection and Filtering ............................................................................................................................11-1
Data Selection and Filtering ...........................................................................................................................11-2
Objectives ......................................................................................................................................................11-3
Overview of Data Mapping and Manipulation .................................................................................................11-4
Types of Definition Files .................................................................................................................................11-5
Data Selection: Overview ...............................................................................................................................11-6
Data Selection: WHERE Clause ....................................................................................................................11-8
Data Selection: WHERE Clause Examples ....................................................................................................11-10
Data Selection: FILTER Clause .....................................................................................................................11-11
Data Selection: FILTER Clause Examples .....................................................................................................11-12
Data Selection: RANGE Function ..................................................................................................................11-13
Data Selection: RANGE Function Examples ..................................................................................................11-14
Column Mapping: Overview ...........................................................................................................................11-16
Column Mapping: Example ............................................................................................................................11-17
Column Mapping: Building History .................................................................................................................11-18
Data Transformation Using Functions ............................................................................................................11-19
Functions: Overview.......................................................................................................................................11-20
Functions: Performing Tests on Column Values ............................................................................................11-21
@IF Function .................................................................................................................................................11-22
Functions: Working with Dates .......................................................................................................................11-23
@DATE Function ...........................................................................................................................................11-24
Functions: Working with Strings and Numbers ..............................................................................................11-25
@STRCAT Function ......................................................................................................................................11-27
@STREXT Function.......................................................................................................................................11-28
Other Functions..............................................................................................................................................11-29
@RANGE Function ........................................................................................................................................11-30
Overview of SQLEXEC ..................................................................................................................................11-31
SQLEXEC: Basic Functionality ......................................................................................................................11-33
SQLEXEC: DBMS and Data Type Support ....................................................................................................11-34
SQLEXEC: Using with a LOOKUP Stored Procedure ....................................................................................11-36
SQLEXEC: Using with a Lookup Stored Procedure .......................................................................................11-37
SQLEXEC: Using with a SQL Query ..............................................................................................................11-38
SQLEXEC: Using Within a TABLE or MAP Statement...................................................................................11-39
SQLEXEC: Using as a Stand-Alone Statement .............................................................................................11-40
Quiz................................................................................................................................................................11-41
Summary ........................................................................................................................................................11-43
Additional Transformation Topics ..................................................................................................................12-1
Additional Transformation Topics ...................................................................................................................12-2
Objectives ......................................................................................................................................................12-3
Overview of Macros .......................................................................................................................................12-4
Creating Macros .............................................................................................................................................12-5
Invoking a Macro ............................................................................................................................................12-6
Reusing Parameter Sets ................................................................................................................................12-7
Creating Macro Libraries ................................................................................................................................12-9
Tracing Macro Expansion ..............................................................................................................................12-10
Overview of User Tokens ...............................................................................................................................12-11
Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Oracle GoldenGate 11g Fundamentals for Oracle Table of Contents


v

Environmental Values Available to @GETENV .............................................................................................12-12


User Tokens Display ......................................................................................................................................12-13
Using User Tokens.........................................................................................................................................12-14
Viewing User Exits in Logdump......................................................................................................................12-15
Overview of User Exits ...................................................................................................................................12-16
Uses for User Exits ........................................................................................................................................12-17
User Exits: High-Level Processing Logic .......................................................................................................12-18
Implementing User Exits ................................................................................................................................12-19
User Exit Parameters .....................................................................................................................................12-20
Sample User Exits..........................................................................................................................................12-21
Calling User Exits ...........................................................................................................................................12-22
Overview of Oracle Sequences ......................................................................................................................12-23
Quiz................................................................................................................................................................12-25
Summary ........................................................................................................................................................12-27
Practices ........................................................................................................................................................12-28
Configuration Options .....................................................................................................................................13-1
Configuration Options ....................................................................................................................................13-2
Objectives ......................................................................................................................................................13-3
Overview of BATCHSQL ................................................................................................................................13-4
BATCHSQL Syntax ........................................................................................................................................13-5
BATCHSQL Results .......................................................................................................................................13-7
Compression Options .....................................................................................................................................13-8
Example of Compression ...............................................................................................................................13-9
Encryption Overview ......................................................................................................................................13-10
Message Encryption.......................................................................................................................................13-12
Options: Message Encryption ........................................................................................................................13-14
Trail or Extract File Encryption .......................................................................................................................13-15
Password Encryption: Method 1.....................................................................................................................13-16
Password Encryption: Method 2.....................................................................................................................13-17
Summary of Password Encryption .................................................................................................................13-18
Event Marker System .....................................................................................................................................13-19
Uses for Event Actions ...................................................................................................................................13-20
Event Actions Flowchart .................................................................................................................................13-21
Implementing Event Actions ...........................................................................................................................13-22
Event Actions: Heartbeat Example.................................................................................................................13-23
Event Actions: Automated Switchover Example.............................................................................................13-24
Event Actions: Automated Synchronization Example.....................................................................................13-25
Quiz................................................................................................................................................................13-26
Summary ........................................................................................................................................................13-28
Practices ........................................................................................................................................................13-29
Bidirectional Replication .................................................................................................................................14-1
Bidirectional Replication .................................................................................................................................14-2
Objectives ......................................................................................................................................................14-3
Bidirectional Flowchart ...................................................................................................................................14-4
Capabilities of a Bidirectional Configuration ...................................................................................................14-5
Issues to Consider for a Bidirectional Configuration......................................................................................14-6
Preventing Data Looping ................................................................................................................................14-7
Loop Detection Techniques ...........................................................................................................................14-9
Conflict Avoidance and Detection ..................................................................................................................14-11
Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Oracle GoldenGate 11g Fundamentals for Oracle Table of Contents


vi

Conflict Detection by Filter .............................................................................................................................14-12


Conflict Resolution .........................................................................................................................................14-13
Conflict Resolution: Example .........................................................................................................................14-14
Conflict Resolution by Applying Net Differences ............................................................................................14-15
Oracle Sequence Numbers ............................................................................................................................14-16
Truncate Table Operations ............................................................................................................................14-17
Quiz................................................................................................................................................................14-18
Summary ........................................................................................................................................................14-20
Practices ........................................................................................................................................................14-21
DDL Replication ...............................................................................................................................................15-1
DDL Replication .............................................................................................................................................15-2
Objectives ......................................................................................................................................................15-3
Overview of DDL Replication .........................................................................................................................15-4
DDL Replication Requirements and Restrictions ...........................................................................................15-5
Characteristics for DDL Replication ...............................................................................................................15-9
DDL Scopes ...................................................................................................................................................15-10
Using Unqualified Object Names ...................................................................................................................15-11
DDL Parameter ..............................................................................................................................................15-12
DDL String Substitution ..................................................................................................................................15-14
Error Handling ................................................................................................................................................15-15
DDLOPTIONS for Oracle ...............................................................................................................................15-16
Mapping Schemas .........................................................................................................................................15-18
Supporting DDL in an Active-Active Bidirectional Configuration ...................................................................15-19
Activating Oracle DDL Capture ......................................................................................................................15-20
Quiz................................................................................................................................................................15-22
Summary ........................................................................................................................................................15-24
Practices ........................................................................................................................................................15-25
Tuning and Troubleshooting...........................................................................................................................16-1
Tuning and Troubleshooting ..........................................................................................................................16-2
Objectives ......................................................................................................................................................16-3
Using Command Security ..............................................................................................................................16-4
Sample CMDSEC Statements .......................................................................................................................16-5
Managing Trail Files .......................................................................................................................................16-6
Handling TCP/IP Errors ..................................................................................................................................16-7
TCPERRS File ...............................................................................................................................................16-8
Troubleshooting Oracle GoldenGate..............................................................................................................16-9
Monitoring Oracle GoldenGate Processing ....................................................................................................16-10
Obtaining Process Information Through GGSCI ............................................................................................16-11
Using the Error Log ........................................................................................................................................16-13
Process Reports.............................................................................................................................................16-14
Sample Extract Process Report .....................................................................................................................16-15
Discard Files ..................................................................................................................................................16-16
Sample Discard File .......................................................................................................................................16-17
Using the System Logs ..................................................................................................................................16-18
Quiz................................................................................................................................................................16-19
Summary ........................................................................................................................................................16-21

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Oracle GoldenGate 11g Fundamentals for Oracle Table of Contents


vii

Você também pode gostar