Book Image

Oracle Goldengate 11g Complete Cookbook

By : Ankur Gupta
Book Image

Oracle Goldengate 11g Complete Cookbook

By: Ankur Gupta

Overview of this book

Oracle Goldengate 11g Complete Cookbook is your complete guide to all aspects of Goldengate administration. The recipes in this book will teach you how to setup Goldengate configurations for simple and complex environments requiring various filtering and transformations. It also covers various aspects of tuning and troubleshooting the replication setups using exception handling, custom fields, and logdump utility.The book begins by explaining some basic tasks like Installation and Process groups setup. You will then be introduced to some further topics including DDL replication and various options to perform Initial Loads. You will then learn some advanced administration tasks such as Multi Master replication setup and conflict resolution. Further recipes, contain the cross platform replication and high availability options for Goldengate.
Table of Contents (16 chapters)
Oracle GoldenGate 11g Complete Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding custom fields for a replicated record using tokens


In this recipe we will look at how we use GoldenGate tokens to add additional information to an extracted record and map it to the table in the target environment.

Getting ready

For this recipe, we will use the following CUST table. This table is created in the source and target databases under the SCOTT schema. In the target database, the table has an additional column to denote the name of the source database from which this change originated.

Source CUST Table

Target CUST Table

CUST_ID

CUST_ID

ACCOUNT_ID

ACCOUNT_ID

CUST_NAME

CUST_NAME

BALANCE

BALANCE

 

CHANGE_ORIGIN

How to do it...

Steps to be performed in the source environment are as follows:

  1. Create an Extract process parameter file as follows:

    EXTRACT EGGTEST1
    USERID GGATE_ADMIN@DBORATEST, PASSWORD GGATE_ADMIN
    EXTTRAIL /u01/app/ggate/dirdat/st
    TABLE scott.CUST, TOKENS (TK_ORIGIN = @GETENV("DBENVIRONMENT" , "DBNAME" ));
  2. The Datapump process parameter file should be as follows...