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 to a replicated record using SQLEXEC


In this recipe we will look into how we can use SQLEXEC to populate a column using an SQL statement in the GoldenGate replication.

Getting ready

For this recipe we will use the EMP table that is delivered in the SCOTT schema with Oracle binaries. In the target environment, the EMP table has an extra column called AVG_SAL which will be the average salary of an employee's department calculated using SQL ran by SQLEXEC.

Source EMP Table

Target EMP Table

EMPNO

EMPNO

ENAME

ENAME

JOB

JOB

MGR

MGR

HIREDATE

HIREDATE

SAL

SAL

COMM

COMM

DEPTNO

DEPTNO

 

AVG_SAL

How to do it...

We will follow the following steps to demonstrate the use of the SQLEXEC command.

Run the following in the source environment:

  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.EMP;
  2. The Datapump process parameter file should look as follows:

    EXTRACT...