Vous êtes sur la page 1sur 32

IMPORTANT PARAMETERS OF

GOLDENGATE 11gR2

DATE-02/01/2017

PROJECT-PAG EAST

AUTHOR-ARIJIT CHAKRABORTY

SERVICE PRACTICE-ORACLE

1
Confidentiality Statement
Include the confidentiality statement within the box provided. This
has to be legally approved
Confidentiality and Non-Disclosure Notice
The information contained in this document is confidential and
proprietary to TATA Consultancy Services. This information may not
be disclosed, duplicated or used for any other purposes. The
information contained in this document may not be released in
whole or in part outside TCS for any purpose without the express
written permission of TATA Consultancy Services.

Tata Code of Conduct


We, in our dealings, are self-regulated by a Code of Conduct as
enshrined in the Tata Code of Conduct. We request your support in
helping us adhere to the Code in letter and spirit. We request that
any violation or potential violation of the Code by any person be
promptly brought to the notice of the Local Ethics Counselor or the
Principal Ethics Counselor or the CEO of TCS. All communication
received in this regard will be treated and kept as confidential.

2
Table of Content

1. INTRODUCTION...........................................................................................................................................................4
2. PROCESSES & PARAMETER FILES.................................................................................................................................5
3. PARAMETERS IN MANAGER PROCESSES......................................................................................................................6
4. PARAMETERS IN EXTRACT & REPLICAT PROCESSES .....................................................................................................8
5. SUMMARY...................................................................................................................................................................21

3
1. INTRODUCTION

Oracle Golden gate is a software package for real time data replication between heterogeneous
environments.

It supports different db products (oracle & non oracle) & OS platforms. Support matrix can be obtained
from Metalink.

It is a part of ODI suite which is a part Oracle Fusion Middleware.

Supports only logical replication, just like SQL apply of logical data guard but the db & the Goldengate
processes are mutually exclusive i.e abending of a GG process doesnt affect the db.

Much faster replication than Physical standby.

Replication works via capturing from source(via extract process)& delivering the same to the target(via
replicat process).

4
2. PROCESSES & PARAMETER FILES

Goldengate replication supports mainly three configurable processes.Apart from these


three, collector process is not configurable.
o Manager
o Extract
o Replicat

In Goldengate, processes are represented by it's correspoinding parameter files.So to


configure a process means to configure it's parameter files.

Parameter file comes with .prm extension.Generally each of the parameter filename is
denoted as processname.prm.

By default Goldengate stores all of the .prm files inside of $GG_HOME/dirprm/ directory.

All parameter files can be modified by using simple editor e.g-vi editor in case of unix
platforms.

It is a good practice to stop the process before making the changes.After necessary
modification, process should be restarted to make the changes to affect the replication.

We can create multiple extract & replicat processes.So for n no of processes, n no of


parameter files will be generated.

5
3. PARAMETERS IN MANAGER PROCESS

In our testing environment one source & one target db is set up along with GG unidirectional replication with
changed data capture mode.The setup has been done on linux x86_64 platform.Db version is 11g release 2 & GG
version is 11.2.1.0.3.

A)Parameter file of manager process at source is as follows.

B)Manager process at target side is as follows.

6
7
From the above pictures,we can see the parameters used in mgr process are as follows,

1)AUTOSTART, AUTORESTART-

Used to automate the starting & stopping of extract & replicat processes.Can be specified on bouth source &
target site.

2)WAITMINUTES n-

Used to define the time needed by the mgr to restart the extract & replicat processes after a failed attempt.Can be
specified on bouth source & target site.

3)RETRIES n-

No of attempts by the mgr process to restart the other processes.Can be specified on bouth source & target site.

4)PURGEOLDEXTRACTS-

Automtically deletes the old trail files. Can be specified on bouth source & target site

5)MINKEEPHOURS-

Min hours to keep the trail files. Can be specified on bouth source & target site.Parameter is used with
PURGEOLDEXTRACTS.

6)USECHECKPOINTS-

Parameter is used with PURGEOLDEXTRACTS.GG maintains a checkpointtable to contain the record of the
transactions.Mgr process automatically deletes the unused trails by using the checkpoints of the transactions to
understand which trails to keep & which aren't.Can be specified on bouth source & target site.Parameter is used
with PURGEOLDEXTRACTS.

8
4. PARAMETERS IN EXTRACT & REPLICAT PROCESSES

We have created four extract & five replicat processes in the test setup.
A)Content of first & second extract processes are as follows,

B)Content of first & second pump process are as follows

9
C)Content of first & second replicat processes are as follows

10
From the above files, different parameters are depicted as follows,

1)USERID...,PASSWORD....

Login credentials specified for Goldengate users to connect to the database.Need to be specified on every parameter

files.

2)GETAPPLOPS-

This parameter tells extract to capture data from external application. Need to be specified on source site.

3)WARNLONGTRANS n hours

Warning would be captured in trail file if any transaction exceeds n hours.Can be specified on both source & target.

4)DDLINCLUDE....-

Parameter is used to capture ddl replication.Need to be specified on the source site.

5)GETREPLICATES-

Parameter is used so that extract captures data from replicat.It is useful for bidirectional replication. Need to be
specified on both source & target.

6)RANGE -

Range is generally used along with mapping statement.Here.first two processes are capturing data from same
source.Range is used to divide the incoming traffic into two equal streams between the two extract processes.In
general, RANGE is defined as RANGE(n1,n2) where n1 denotes the no of the process & n2 denotes total no of
processes.Here n1 is 1 & 2 but n2 is equal to 2.It can be defined on both source & target.But it would be beneficial to
use it at source param file as replicat needs to read the whole trail file to divide the traffic.

7)PASSTHRU-

It is used so that pump process forward the traffic to replicat by not checking whether the table definitions at source
& target are same or different.It is used in extract pump process.

8)ASSUMETARGETDEFS-

Assuming source & target table definitions are same.Need to be specified in replicat.

9)DDLERROR-

It is an errorhandler. It is used with RETRYOP & MAXRETRIES parameter.It is used to ignore a particular ddlerror. Need
to be specified in replicat. MAXRETRIES denotes max no of retries caused by replicat to send the data into target after
abending.

10)COMPRESS,COMPRESSTHRESHOLD-

11
This parameter is used in source.It denotes the transferred data should be compressed & the threshold byte to be
defined.It is useful to improve the transfer time of the data when source & target site are far apart from each other.

11)BATCHSQL

With BATCHSQL parameter, replicat places similar type of sql operations in a queue.Thus,speed of replication
increases.BATCHSQL comes with different parameters like BATCHESPERQUEUE,OPSPERBATCH etc.It must be specified
in replicat parameter file.

Different approach should be taken where table definition of source & target is different.Seperate processes need to
be created to handle tables with different table definition.It is described in the following steps,

D)Source table is as follows,

12
E)Target table is as follows

F)We have to create a new parameter file containing the definition of source table.

13
G)Generate the definition file of the table at source using defgen utility.

14
E)Copy the generated file from source to target.Replicat should be pointed to that file.

F)Replication is now working fine.

15
Parameters used in the above processes are as follows,

12)DEFSFILE-

It points to the definition file of the source table to be generated.Must be specified at source

13)DEFGEN

Utility to generate the definition file at source.

14)SOURCEDEFS

It is used to point to the location of definition file at target.

15)COLMAP

It is used for column mapping.

G)Content of extract3 is as follows

16
H)Content of replicat3 are as follows

17
Different parmeters are used as follows,

1)GETUPDATEBEFORES-

Used to include the before images of the records in trail files.Used in source.

2)NOCOMPRESS-

Used in source.This parameter tell the extract to write the column values of all records in the trail, not only the
primary key.

3)GETENV(GGHEADER,LOGRBA)

It is known as Goldengate token.Here, library table is maintained at both source & target.But at target site,an
extra column RBA has been specified to get the value of RBA after some sql operation at source.It captures data
from the header of the trail files.It is described as follows,

3A)Source table library after an insertion,

18
3B)Target table library after the insertion

19
4)SQLEXEC-

It is used to perform some sql operation from GG parameter files.It must be defined in replicat.

5)EVENTACTIONS-

It used to perform some sql level (e.g-triggering action) or os level(e.g-running some script) from GG
processes.Here, eventaction is specified such as the insertion of a pre specified column value will abend the
replicat.It is described as follows,

5A)Eventaction clause is as follows,

20
5B)Now, insert the pre specified value,

5C)Now, we can see that the replicat is abended.

21
I)We have created an extra replicat process RDEST4 which will capture data from trail files generated by third
extract.Content of this process are as follows,

22
This process is used to generate a table which will contain informations(timestamp of an operation,Optype &
before & after value of columns) of the operations going on in source table in extract3.The parameters included in
this file are as follows,

1)INSERTALLRECORDS-

It is used in replicat to insert not only the current values,but also the previous records using point in time
snapshot.Generally, it goes with GETUPDATEBEFORES parameter in extract(specified in extract3 here).

2)TIME = @GETENV("GGHEADER", "COMMITTIMESTAMP"),OPERATION = @GETENV("GGHEADER", "OPTYPE"),

BEFORE_AFTER = @GETENV("GGHEADER", "BEFOREAFTERINDICATOR")-

These are different tokens.Here, 'TIME', 'OPERATION', & 'BEFORE_AFTER' are column names which will be
populated from the trail headers.

How the target table is getting populated is described as follows,

2A)Column values f the target table are as follows,after some insert operations are done at source

23
5)SUMMARY
Several parameters have been excluded from our scope of discussion.

The parameters discussed here are as follows,

1)AUTOSTART,AUTORESTART

2)WAITMINUTES

3)RETRIES

4)PURGEOLDEXTRACTS

24
5)MINKEEPHOURS

6)USECHECKPOINTS

7)DBLOGIN

8)GETAPPLOPS

9)WARNLONGTRANS

10)DDLINCLUDE

11)GETREPLICATES

12)RANGE

13)PASSTHRU

14)ASSUMETARGETDEFS

15)ERRORHANDLER

16)COMPRESS

17)BATCHSQL

19)DEFGEN(DEFSFILE,SOURCEDEFS)

20)COLMAP

21)GETUPDATEBEFORES

22)TOKENS

23)EVENTACTIONS

24)INSTALLALLRECORDS.

Contact

For more information, contact gsl.cdsfiodg@tcs.com(Email Id of ISU)

About Tata Consultancy Services (TCS)

Tata Consultancy Services is an IT services, consulting and business solutions organization that delivers real results to global business,
ensuring a level of certainty no other firm can match. TCS offers a consulting-led, integrated portfolio of IT and IT-enabled infrastructure,
engineering and assurance services. This is delivered through its unique Global Network Delivery Model TM, recognized as the benchmark of

25
excellence in software development. A part of the Tata Group, Indias largest industrial conglomerate, TCS has a global footprint and is listed
on the National Stock Exchange and Bombay Stock Exchange in India.

For more information, visit us at www.tcs.com.

IT Services
Business Solutions
Consulting

All content / information present here is the exclusive property of Tata Consultancy Services Limited (TCS). The content / information contained here is correct at the
time of publishing. No material from here may be copied, modified, reproduced, republished, uploaded, transmitted, posted or distributed in any form without prior
written permission from TCS. Unauthorized use of the content / information appearing here may violate copyright, trademark and other applicable laws, and could result
in criminal or civil penalties. Copyright 2011 Tata Consultancy Services Limited

-------------------------*------------------------------

26
27
28
29
30
31
32

Vous aimerez peut-être aussi