Académique Documents
Professionnel Documents
Culture Documents
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.
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.
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.
Replication works via capturing from source(via extract process)& delivering the same to the target(via
replicat process).
4
2. PROCESSES & 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.
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.
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,
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....-
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,
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.
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
14)SOURCEDEFS
15)COLMAP
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,
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,
20
5B)Now, insert the pre specified value,
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).
These are different tokens.Here, 'TIME', 'OPERATION', & 'BEFORE_AFTER' are column names which will be
populated from the trail headers.
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.
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
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.
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