Sunteți pe pagina 1din 23

GOLDENGATE BIDIRECTIONAL REPLICATION

SETUP FROM UNIDIRECTIONAL SETUP


11/03/2017

PRODUCT ALLIANCE GROUP EAST

SERVICE PRACTICE-ORACLE

arijit.chakraborty1@tcs.com
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.

TCS Internal 2
Table of Content

1. INTRODUCTION ......................................................................................................................................................... 4
2. TYPES OF REPLICATION & BIDIRECTIONAL REPLICATION..........................................................................................5

2.1 BIDIRECTIONAL REPLICATION...............................................................................................................................6

3. IMPORTANT CONSIDERATIONS.................................................................................. Error! Bookmark not defined.


4. STEPS TO CONFIGURE ............................................................................................................................................... 8

TCS Internal 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 doesn’t 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).

TCS Internal 4
2. TYPES OF REPLICATION & BIDIRECTIONAL REPLICATION
Bidirectional replication is among six types of replication mode supported by Goldengate software. Types of
replication mode are

i) Unidirectional-Two databases would be there, between which one acts as source & other as target. Changes of
data applied to source will be replicated to target on real time basis.

ii) Bidirectional-Both of source & target will be active. Changes applied to any side will be replicated to other side.
Hence, both can act as source or target.

iii) Broadcast-Replication will happen from source to multiple targets.

iv) Consolidation-Data from multiple source will be replicated to single target.

v)Cascading-Here, data will be replicated from source to target.If there is another target database,then
configuration of replication can be done from first target to second target.

vi)Peer to Peer-Here, replication can happen between three databases on bidirectional basis.

TCS Internal 5
2.1BIDIRECTIONAL REPLICATION

i)In Bidirectional replication, both systems has identical data that can be replicated to each other as per user’s
choice.

ii) Change of data from one system can be replicated to other system from both side.Hence, it is also called active
active replication.

iii) Goldengate has three processes. Extract process at source captures data change from source db. Then captured
data will be applied to datapump process & then replicate process applies data to the target after taking it from
pump.

iv) In bidirectional replication, both ends can act as either source or target. So, at both end, extract, datapump &
replicat process exists.

TCS Internal 6
3. IMPORTANT CONSIDERATIONS

Some important measures should be taken before setting up active active bidirectional replication.

i) BATCHSQL mode is not supported in case of bidirectional replication. This parameter should be commented.

ii) LOB, User defined datatypes are not supported in case of bidirectional replication.

iii) Insertion into table using sequences are nót supported. An odd even approach could be taken to insert values i.e
defining a sequence which insert values to one table when it is even & insert values to another table when it is odd.

iv)Infinite data looping may occur in case of bidirectional replication i.e sql changes applied via replicate can again be
extracted & applied to the other end, thus creating an infinite loop. To avoid infinite data looping, we can use the
parameter ‘TRANLOGOPTION ‘ EXCLUDEUSER <GOLDENGATE USER>’ at extract.Then extract process will ignore the
transactions applied by replicate. Another method is setting ‘GETREPLICATE’at one end & ÍGNOREREPLICATE’ at
another end.

v) Truncate table operation is supported only in one direction. We can set the parameter ‘GETTRUNCATE’ to one
direction & ÍGNORETRUNCATE’ to another direction.

vi) Bidirectional replication works with Windows & Unix only.

vii) Timestamp column should be added apart from primary key as by using it’s values Goldengate performs conflict
detection & resolution.

viii) Conflict occur when updation, deletion or insertion of same row is performed from both side. That’s why
‘RESOLVECONFLICT’ parameter is used on both replicate parameter file which will use timestamp column values to
resolve conflict.

ix)’GETBEFORECOLS(ON UPDATE/DELETE KEYINCLUDING(COLUMN_NAMES))’ is used in extract on both side to


capture the before values of the given sql operations by considering all the columns as keys. This key value is
calculated by goldengate itself for conflict detection & resolution.
4. STEPS TO CONFIGURE

i) Here we have considered an unidirectional CDC has already been configured. In this example , source schema is
OGGSEND & target schema is OGGRECV. The table in these schema is PATIENT_RECORDS.At first,check whether
goldengate user (OGGUSR)& tablespace(OGGTB) is present in target table or not.

TCS Internal 8
ii) Add timestamp column on the table to be replicated. Same activity should be performed on the source schema
also.It has columns ‘ID, PAN CARD NO & NAME(primary key)’.

TCS Internal 9
iii)Add timestamp column on source table also.

TCS Internal 10
iv) This step is optional. We can create trigger on both source & target table so that timestamp column will be
automatically updated when insertion occur. This trigger won’t be fired if Goldengate user updates the table as it
is already excluded in extract.

TCS Internal 11
v) Modify the global parameter of source system to add the entry of checkpointtable as it can act as target also.

TCS Internal 12
vi) Add checkpointtable at the source system.

TCS Internal 13
vii)Edit the extract prm file on target as follows.Add the ÚPDATEKEYINCLUDING’ parameter to both source &
target’s extract process.

TCS Internal 14
viii) Add exttrail & pump process.

TCS Internal 15
ix)Edit the pump parameter file.

TCS Internal 16
x) Add remote trail to the path of source system.

TCS Internal 17
xi)Add replicate process on source system.

TCS Internal 18
xii) Edit the replicate process as follows.We have to add ‘RESOLVECONFLICT’ to both source & target’s replicat.

TCS Internal 19
Xiii) Edit the extract process on source as follows. No need to change the epump.

TCS Internal 20
XIV) Enable trandata on both both system.

TCS Internal 21
XV) Now, test by inserting values from both side. We will see that replication is working fine from both side & CDR
is working by using the timestamp values.We can check it by inserting & deleting the same row on both databse.

TCS Internal 22
Thus, replication is working fine.

............................................*.............................................

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 ModelTM, recognized as the benchmark of excellence in
software development. A part of the Tata Group, India’s 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

TCS Internal 23

S-ar putea să vă placă și