24
8/16/2019 Oracle GoldenGate Basic Architecture http://slidepdf.com/reader/full/oracle-goldengate-basic-architecture 1/24 1. Oracle GoldenGate Basic Architecture. Source Database - GoldenGate extracts the information from the source database.  The source database may be from any of the following vendors. - Oracle Database - TimesTen - y!"# - $B DB% - icrosoft !"# !erver - Teradata - !ybase - &nscribe - !"#'( Capture(Local Extract) - )a*ture is the *rimary *rocess in which all the commited D# and DD# changes are extracted from the source database. Source Trail - The data extracted from the source database is written to the source trail+ which is basically a staging ,le and will be used by other *rocesses &x data*um*/. Datapump - The data*um* which is a goldengate *rocessnot to be confused with oracle data*um*/+ reads the information from the source trail+ transfers it to the target host via  T)0'$0 and writes it down to the remote trail. Network  - GoldenGate sends the data from the source trail via T)0'$0 to the target host and writes it in the remote trail. Collector - The collector *rocess is automatically started by the manager. This *rocess runs in the bacground+ $t ca*tures and writes all the data received to the remote trail. Remote Trail - 2emote trail is similar to source trail. The only di3erence between the two is that the remote trail is at the target host and the source trail is at the source Database host. Delivery(Replicat) - The delivery *rocess a**lies all the changes to the target database by reading the remote trail. The changes are done to the target database in the same order as they were done in the source database. Target Database - Target database is the database at which all the changes are a**lied. $t can be same or di3erent from the source database.

Oracle GoldenGate Basic Architecture

Embed Size (px)

Citation preview

Page 1: Oracle GoldenGate Basic Architecture

8/16/2019 Oracle GoldenGate Basic Architecture

http://slidepdf.com/reader/full/oracle-goldengate-basic-architecture 1/24

1. Oracle GoldenGate Basic Architecture.

Source Database - GoldenGate extracts the information from the source database. The source database may be from any of the following vendors.

- Oracle Database- TimesTen- y!"#- $B DB%- icrosoft !"# !erver- Teradata- !ybase- &nscribe- !"#'(

Capture(Local Extract) - )a*ture is the *rimary *rocess in which all the commited D#and

DD# changes are extracted from the source database.

Source Trail - The data extracted from the source database is written to the source trail+which is basically a staging ,le and will be used by other *rocesses &x data*um*/.

Datapump - The data*um* which is a goldengate *rocessnot to be confused with oracledata*um*/+ reads the information from the source trail+ transfers it to the target host via

 T)0'$0 and writes it down to the remote trail.

Network  - GoldenGate sends the data from the source trail via T)0'$0 to the target hostand writes it in the remote trail.

Collector - The collector *rocess is automatically started by the manager. This *rocessruns in the bacground+ $t ca*tures and writes all the data received to the remote trail.

Remote Trail - 2emote trail is similar to source trail. The only di3erence between thetwo is that the remote trail is at the target host and the source trail is at the sourceDatabasehost.

Delivery(Replicat) - The delivery *rocess a**lies all the changes to the target database byreading the remote trail. The changes are done to the target database in the same order asthey

were done in the source database.

Target Database - Target database is the database at which all the changes are a**lied.$t can be same or di3erent from the source database.

Page 2: Oracle GoldenGate Basic Architecture

8/16/2019 Oracle GoldenGate Basic Architecture

http://slidepdf.com/reader/full/oracle-goldengate-basic-architecture 2/24

GLDEN G!TE "R#$L"%

Page 3: Oracle GoldenGate Basic Architecture

8/16/2019 Oracle GoldenGate Basic Architecture

http://slidepdf.com/reader/full/oracle-goldengate-basic-architecture 3/24

1. Oracle 11g GoldenGate $nstallation.

Download the GoldenGate software from Oracle &delivery.

Select a &ro'uct &ack% racle $usio i''leware&lat*orm% Liux +,-

Download the Oracle GoldenGate media *ac.

)reate the directory for GoldenGate.

4 mdir -* 'u51'a**'gg

ae changes in your bash *ro,le.

Add *ath variable.

0AT67'u51'a**'gg40AT68 ex*ort 0AT6

#D library entry should loo something lie this.

#D9#$B2A2:90AT674O2A)#&96O&'lib'lib'usr'lib.u/0.app.gg8 ex*ort #D9#$B2A2:90AT6

2eload bash *ro,le

4 . .'.bash9*ro,le

co*y the tar ,le to the ;gg; directory and untar

tar -xvof fbo9ggs9#inux9x<=9ora11g9>%bit.tar

$nvoe the GoldenGate !oftware )ommand $nterface.

?oracle@canada gg4 ggsci

Oracle GoldenGate )ommand $nter*reter for Oracleersion 11.1.1.1.% OGG)O2&911.1.1.1.%90#ATCO2!911155.%155#inux+ x<=+ >%bit o*timiEed/+ Oracle 11g on Oct %511 %>F>>>

)o*yright )/ 1F+ %511+ Oracle and'or its aHliates. All rights reserved.

GG!)$ canada/ 1I create sub'irs

)ode

Page 4: Oracle GoldenGate Basic Architecture

8/16/2019 Oracle GoldenGate Basic Architecture

http://slidepdf.com/reader/full/oracle-goldengate-basic-architecture 4/24

Creating subdirectories under current directory /u01/app/gg

Parameter files /u01/app/gg/dirprm: createdReport files /u01/app/gg/dirrpt: createdCheckpoint files /u01/app/gg/dirchk: createdProcess status files /u01/app/gg/dirpcs: createdSQL script files /u01/app/gg/dirsl: created!atabase definitions files /u01/app/gg/dirdef: created"#tract data files /u01/app/gg/dirdat: created$emporary files /u01/app/gg/dirtmp: created%eridata files /u01/app/gg/dir&er: created%eridata Lock files /u01/app/gg/dir&er/lock: created%eridata 'ut('f(Sync files /u01/app/gg/dir&er/oos: created%eridata 'ut('f(Sync )*L files /u01/app/gg/dir&er/oos#ml: created%eridata Parameter files /u01/app/gg/dir&er/params: created%eridata Report files /u01/app/gg/dir&er/report: created%eridata Status files /u01/app/gg/dir&er/status: created%eridata $race files /u01/app/gg/dir&er/trace: createdStdout files /u01/app/gg/dirout: created

GG!)$ canada/ %I exit

Before going any further mae sure your database is inarchivelog mode.

0re*are your database for re*lication.

$n order to extract committed transactions from the source databasethe database must be con,gured with su**lemental logging on *rimaryey columns.

!"#I alter database add su**lemental log data *rimary ey/ columns8

Database altered.

Do a logswitch to start su**lemental logging.

!"#I alter system switch log,le8

!ystem altered.

!"#I select su**lemental9log9data9min+ su**lemental9log9data9*+su**lemental9log9data9ui from v4database8

!J00#&& !J0 !J0-------- --- ---$0#$)$T :&! KO

!J00#&&KTA#9#OG9DATA9$K &nsures that logminer will have suHcient information.!J00#&&KTA#9#OG9DATA90L $ndicates whether all columns of the *rimary ey are *lacedintothe redo log whenever an u*date is *erformed.!J00#&&KTA#9#OG9DATA9J$ $ndicated whether all columns belonging to the uniMue eyare *laced

Page 5: Oracle GoldenGate Basic Architecture

8/16/2019 Oracle GoldenGate Basic Architecture

http://slidepdf.com/reader/full/oracle-goldengate-basic-architecture 5/24

into the redo log if any of the uniMue columns are modi,ed.

)reate a Tables*ace and user for GoldenGate.

!"#I create tables*ace golden data,leN'u51'a**'oracle'oradata'orcl'golden51.dbfN siEe155m

% autoextend on> extent management local segment s*ace management auto8

 Tables*ace created.

!"#I create user ggs9admin identi,ed by ggs9admin% tem*orary tables*ace tem*> default tables*ace golden Muota unlimited on golden8

Jser created.

!"#I grant dba to ggs9admin8

Grant succeeded.

!"#I alter system set recyclebin7o3 sco*e7s*,le8

!ystem altered.

--!et recyclebin to o3+ Kecessary for DD# 2e*lication from Oracle 15g onwards.

!"#I shutdown immediate!"#I startu*

1. Oracle GoldenGate Basic D# 2e*lication.

!chema to be re*licated 1SCTT1.

S2RCE D!T!3!SE4

S - 2ed 6at &nter*rise #inux !erver release F.

5ostame - canada

6& !''ress - 1%.1=<.1.155

Database - Oracle 11g 2elease %.

Page 6: Oracle GoldenGate Basic Architecture

8/16/2019 Oracle GoldenGate Basic Architecture

http://slidepdf.com/reader/full/oracle-goldengate-basic-architecture 6/24

S6D - orcl

Gol'eGate 7ersio - 11.1.1.1.%

!am*le 1.etc.8osts1 ,le.

)ode

+ !o not remo&e the follo,ing line- or &arious programs+ that reuire net,ork functionality ,ill fail.

1.0.0.1 localhost.localdomain localhost

1.123.1.100 canada canada1.123.1.00 london london

T!RGET D!T!3!SE4

S - 2ed 6at &nter*rise #inux !erver release F.

5ostame - london

6& !''ress - 1%.1=<.1.%55

Database - Oracle 11g 2elease %

S6D - du*

Gol'eGate 7ersio - 11.1.1.1.%

!am*le 1.etc.8osts1 ,le.

)ode

+ !o not remo&e the follo,ing line- or &arious programs+ that reuire net,ork functionality ,ill fail.

1.0.0.1 localhost.localdomain localhost

1.123.1.100 canada canada1.123.1.00 london london

$nstall GoldenGate !oftware on both the machines.---lin

--mae sure supplemetal log 'ata is enabled only for the source 'atabase.

0ing from both the machines to ensure networ connectivity.

--Do *rom bot8 mac8ies4

*ing canada

Page 7: Oracle GoldenGate Basic Architecture

8/16/2019 Oracle GoldenGate Basic Architecture

http://slidepdf.com/reader/full/oracle-goldengate-basic-architecture 7/24

*ing london

3ot8 the databases should be in arc8ivelog mo'e.

N S2RCE

?oracle@canada gg4 ex*ort O2A)#&9!$D7orcl?oracle@canada gg4 ggsci

Oracle GoldenGate )ommand $nter*reter for Oracleersion 11.1.1.1.% OGG)O2&911.1.1.1.%90#ATCO2!911155.%155#inux+ x<=+ >%bit o*timiEed/+ Oracle 11g on Oct %511 %>F>>>

)o*yright )/ 1F+ %511+ Oracle and'or its aHliates. All rights reserved.

GG!)$ canada/ 1I dblogin userid ggs9admin+ *assword ggs9admin

!uccessfully logged into database.

--!'' supplemetal loggig on the source database for tables--in the SCTT users schema.

GG!)$ canada/ %I a'' tra'ata !)OTT.P

Co9gure maager service o bot8 Source a' Target4

ggsci I edit *aram mgr

*ort Q<5

*urgeoldextracts dirdat'P+ usechec*oints+ minee*days %

-The above *arameter instructs the GoldenGate software to-delete all the trails which have been used by the &xtract-and 2e*licat *rocess after % days.

ggsci I start manager

anager started.

ggsci I info manager

anager is running $0 *ort canada.Q<5/.

Co9gure local extract o source4

Page 8: Oracle GoldenGate Basic Architecture

8/16/2019 Oracle GoldenGate Basic Architecture

http://slidepdf.com/reader/full/oracle-goldengate-basic-architecture 8/24

ggsciI edit *aram ext1

extract ext1userid ggs9admin+ *assword ggs9adminexttrail dirdat't1

table !)OTT.P8

GG!)$ canada/ <I add extract ext1+ tranlog+ begin now&(T2A)T added.

GG!)$ canada/ I add exttrail dirdat't1+ extract ext1+ megabytes 155&(TT2A$# added.

GG!)$ canada/ 15I start extract ext1

!ending !TA2T reMuest to AKAG&2 ...&(T2A)T &(T1 starting

GG!)$ canada/ 1>I info extract ext1

)ode

")$R4C$ ")$1 Last Started 01(05(16 0:7 Status R8999;Checkpoint Lag 00:00:00 <updated 00:00:05 ago=Log Read Checkpoint 'racle Redo Logs

  01(05(16 0:73:16 Seno 6- R>4 207712

To stop t8e extract4

ggsci I sto* extract ext1

Co9gure 'atapump o source4

GG!)$I edit *aram d*um*1

extract d*um*1*assthrurmthost london+ mgr*ort Q<5rmttrail dirdat't%table !)OTT.P8

--*assthru *arameter is used here because we are not using any data

Page 9: Oracle GoldenGate Basic Architecture

8/16/2019 Oracle GoldenGate Basic Architecture

http://slidepdf.com/reader/full/oracle-goldengate-basic-architecture 9/24

--,lteration or column ma**ing. The source and target data structures--are identical.

GG!)$ canada/ 1FI add extract d*um*1+ exttrailsource dirdat't1&(T2A)T added.

GG!)$ canada/ 1=I add rmttrail dirdat't%+ extract d*um*1+ megabytes 1552TT2A$# added.

GG!)$ canada/ 1QI start extract d*um*1

!ending !TA2T reMuest to AKAG&2 ...&(T2A)T D0J01 starting

To stop 'atapump4

GG!)$I sto* extract d*um*1

GG!)$ canada/ 1<I info extract d*um*1

)ode

")$R4C$ !P8*P1 Last Started 01(05(16 0:63 Status R8999;Checkpoint Lag 00:00:00 <updated 00:00:07 ago=Log Read Checkpoint ?ile dirdat/t1000000  ?irst Record R>4 75

GG!)$ canada/ 1I info all

)ode

Program Status ;roup Lag $ime Since Chkpt

*494;"R R8999;")$R4C$ R8999; !P8*P1 00:00:00 00:00:00")$R4C$ R8999; ")$1 00:00:00 00:00:0

Co9gure Replicat o target 'atabase4

?oracle@london gg4 ex*ort O2A)#&9!$D7du*?oracle@london gg4 ggsci

Oracle GoldenGate )ommand $nter*reter for Oracleersion 11.1.1.1.% OGG)O2&911.1.1.1.%90#ATCO2!911155.%155#inux+ x<=+ >%bit o*timiEed/+ Oracle 11g on Oct %511 %>F>>>

)o*yright )/ 1F+ %511+ Oracle and'or its aHliates. All rights reserved.

Page 10: Oracle GoldenGate Basic Architecture

8/16/2019 Oracle GoldenGate Basic Architecture

http://slidepdf.com/reader/full/oracle-goldengate-basic-architecture 10/24

-create chec*oint table

GG!)$ london/ >I dblogin userid ggs9admin+ *assword ggs9admin!uccessfully logged into database.

GG!)$ london/ I add chec*ointtable ggs9admin.ch*t

!uccessfully created chec*oint table GG!9AD$K.)6L0T.

GG!)$ london/ 1I edit *aram re*l1

re*licat re*l1userid ggs9admin+ *assword ggs9adminhandlecollisionsassumetargetdefsdiscard,le dirr*t're*l1.dsc+ a**end

discardrollover at F55 on sundayma* !)OTT.P+ target !)OTT.P8

--handlecollisions hel*s in detection and resolution of D# errors+ while a**lying--changes to the target.

--assumetargetdefs *arameter tells the GoldenGate software that source and--target tables are identical.

--discard,le *arameter instructs the GoldenGate software to write--all the errors encountered to the ,le s*eci,ed.

--discardrollover *arameter instructs the goldengate software to create--a new discard,le every sunday at F55.--The old discard ,le can be safely deleted in order to avoid--s*ace constraints.

GG!)$ london/ FI add re*licat re*l1+ exttrail dirdat't%+ chec*ointtable ggs9admin.ch*t2&0#$)AT added.

GG!)$ london/ =I start re*licat re*l1

!ending !TA2T reMuest to AKAG&2 ...2&0#$)AT 2&0#1 starting

 To sto* re*licat service.

GG!)$I sto* re*licat re*l1

GG!)$ london/ QI info re*licat re*l1

Page 11: Oracle GoldenGate Basic Architecture

8/16/2019 Oracle GoldenGate Basic Architecture

http://slidepdf.com/reader/full/oracle-goldengate-basic-architecture 11/24

)ode

R"PLC4$ R"PL1 Last Started 01(05(16 1:3 Status R8999;Checkpoint Lag 00:00:00 <updated 00:00:0 ago=Log Read Checkpoint ?ile dirdat/t000000  ?irst Record R>4 0

GG!)$ london/ <I info all

)ode

Program Status ;roup Lag $ime Since Chkpt

*494;"R R8999;R"PLC4$ R8999; R"PL1 00:00:00 00:00:05

7eri*y4

Source!"#I conn scott'tiger!"#I u*date em* set sal71>555 where ename7N$##&2N8

1 row u*dated.

!"#I commit8

)ommit com*lete.

Target

!"#Iconn scott'tiger

!"#I select sal from em* where ename7N$##&2N8

!A#----------1>555

!lso:

!"#I exit

?oracle@london gg4 ex*ort O2A)#&9!$D7du*

?oracle@london gg4 ggsci

Oracle GoldenGate )ommand $nter*reter for Oracleersion 11.1.1.1.% OGG)O2&911.1.1.1.%90#ATCO2!911155.%155#inux+ x<=+ >%bit o*timiEed/+ Oracle 11g on Oct %511 %>F>>>

Page 12: Oracle GoldenGate Basic Architecture

8/16/2019 Oracle GoldenGate Basic Architecture

http://slidepdf.com/reader/full/oracle-goldengate-basic-architecture 12/24

)o*yright )/ 1F+ %511+ Oracle and'or its aHliates. All rights reserved.

GG!)$ london/ 1I stats re*licat re*l1

)ode

Sending S$4$S reuest to R"PLC4$ R"PL1 ...

Start of Statistics at 01(05(16 1:56:11.

Replicating from SC'$$."*P to SC'$$."*P:

@@@ $otal statistics since 01(05(16 1:51:67 @@@  $otal inserts 0.00  $otal updates 1.00  $otal deletes 0.00  $otal discards 0.00  $otal operations 1.00

@@@ !aily statistics since 01(05(16 1:51:67 @@@  $otal inserts 0.00  $otal updates 1.00  $otal deletes 0.00  $otal discards 0.00  $otal operations 1.00

@@@ Aourly statistics since 01(05(16 1:51:67 @@@  $otal inserts 0.00  $otal updates 1.00  $otal deletes 0.00  $otal discards 0.00  $otal operations 1.00

@@@ Latest statistics since 01(05(16 1:51:67 @@@

  $otal inserts 0.00  $otal updates 1.00  $otal deletes 0.00  $otal discards 0.00  $otal operations 1.00

"nd of Statistics.

--At this *oint your basic D# unidirectional re*lication is com*lete.

1. Oracle GoldenGate DD# 2e*lication.

0oints to consider before im*lementing DDl re*lication.

1/ 2ecyclebin feature should be turned o3Oracle 15g onwards/.

%/ The source and target schemas must be identical.

Page 13: Oracle GoldenGate Basic Architecture

8/16/2019 Oracle GoldenGate Basic Architecture

http://slidepdf.com/reader/full/oracle-goldengate-basic-architecture 13/24

>/ DD# re*lication is su**orted only between two systems. Bi-directional DD# re*licationis also su**orted. DD# re*lication between one to many systems is not su**orted.

/ DDl statements that are less than %B in length will be re*licated automatically+any statement longer than that will have to be manually *rocessed by Golden Gate scri*t.

F/ 0assthru *aramater is to be con,gured while con,guring data*um* for tables that reMuireDD# re*lication.

ain di3erences when im*lementing DD# re*lication as com*ared to D# re*lication isthat you have to create G#OBA#! ,le in both source and target schema.

2un certain scri*ts on source to facilitate DD# re*lication.

Add one additional *arameter to the local extract,le i.e ddl include ma**ed obRname ;!)OTT.P/.

Source

!"#I grant execute on utl9,le to ggs9admin8

Grant succeeded.

?oracle@canada gg4 ex*ort O2A)#&9!$D7orcl?oracle@canada gg4 sMl*lus

!"#P0lus 2elease 11.%.5.1.5 0roduction on Tue ar %Q %1F5%Q %51%

)o*yright c/ 1<%+ %55+ Oracle. All rights reserved.

&nter user-name ' as sysdba

)onnected toOracle Database 11g &nter*rise &dition 2elease 11.%.5.1.5 - 0roductionSith the 0artitioning+ O#A0+ Data ining and 2eal A**lication Testing o*tions

S;L< =marker>setup4s?l

)ode

*arker setup script

Bou ,ill be prompted for the name of a schema for the ;olden;ate database obects.9'$": $he schema must be created prior to running this script.

9'$": Stop all !!L replication before starting this installation.

Enter GoldenGate schema name:ggs_admin

*arker setup table script complete- running &erification script...Please enter the name of a schema for the ;olden;ate database obects:Setting schema name to ;;SD4!*9

*4RE"R $4>L"

Page 14: Oracle GoldenGate Basic Architecture

8/16/2019 Oracle GoldenGate Basic Architecture

http://slidepdf.com/reader/full/oracle-goldengate-basic-architecture 14/24

((((((((((((((((((((((((((((((('E

*4RE"R S"Q8"9C"((((((((((((((((((((((((((((((('E

Script complete.

S;L< =''l>setup4s?l

)ode

;olden;ate !!L Replication setup script

%erifying that current user has pri&ileges to install !!L Replication...

Bou ,ill be prompted for the name of a schema for the ;olden;ate database obects.9'$": ?or an 'racle 10g source- the system recycle bin must be disabled. ?or 'racle11g and later- it can be

enabled.9'$": $he schema must be created prior to running this script.9'$": Stop all !!L replication before starting this installation.

Enter GoldenGate schema name:ggs_admin

Bou ,ill be prompted for the mode of installation.$o install or reinstall !!L replication- enter 9$4LS"$8P$o upgrade !!L replication- enter 9'R*4L"nter mode of installation:INITIALSETUP

Forking- please ,ait ...Spooling to file ddlDsetupDspool.t#t

Checking for sessions that are holding locks on 'racle ;olden ;ate metadata tables ...

Check complete.

8sing ;;SD4!*9 as a ;olden;ate schema name- 9$4LS"$8P as a mode of installation.

Forking- please ,ait ...

!!L replication setup script complete- running &erification script...Please enter the name of a schema for the ;olden;ate database obects:Setting schema name to ;;SD4!*9

!!L'R4D;"$$4>L"SP4C"SG" S$4$8S:

Line/pos "rror

(((((((((( (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((9o errors 9o errors

CL"4RD$R4C" S$4$8S:

Line/pos "rror(((((((((( (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((9o errors 9o errors

CR"4$"D$R4C" S$4$8S:

Page 15: Oracle GoldenGate Basic Architecture

8/16/2019 Oracle GoldenGate Basic Architecture

http://slidepdf.com/reader/full/oracle-goldengate-basic-architecture 15/24

Line/pos "rror(((((((((( (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((9o errors 9o errors

$R4C"DP8$DL9" S$4$8S:

Line/pos "rror(((((((((( (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((9o errors 9o errors

9$4LDS"$8P S$4$8S:

Line/pos "rror(((((((((( (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((9o errors 9o errors

!!L%"RS'9SP"C?C P4CE4;" S$4$8S:

Line/pos "rror(((((((((( (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((9o errors 9o errors

!!LR"PLC4$'9 P4CE4;" S$4$8S:

Line/pos "rror(((((((((( (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((9o errors 9o errors

!!LR"PLC4$'9 P4CE4;" >'!B S$4$8S:

Line/pos "rror(((((((((( (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((9o errors 9o errors

!!L AS$'RB $4>L"((((((((((((((((((((((((((((((((((('E

!!L AS$'RB $4>L"<1=((((((((((((((((((((((((((((((((((('E

!!L !8*P $4>L"S((((((((((((((((((((((((((((((((((('E

!!L !8*P C'L8*9S((((((((((((((((((((((((((((((((((('E

!!L !8*P L'; ;R'8PS((((((((((((((((((((((((((((((((((('E

!!L !8*P P4R$$'9S((((((((((((((((((((((((((((((((((('E

!!L !8*P PR*4RB E"BS(((((((((((((((((((((((((((((((((((

Page 16: Oracle GoldenGate Basic Architecture

8/16/2019 Oracle GoldenGate Basic Architecture

http://slidepdf.com/reader/full/oracle-goldengate-basic-architecture 16/24

'E

!!L S"Q8"9C"((((((((((((((((((((((((((((((((((('E

;;SD$"*PDC'LS((((((((((((((((((((((((((((((((((('E

;;SD$"*PD8E((((((((((((((((((((((((((((((((((('E

!!L $R;;"R C'!" S$4$8S:

Line/pos "rror(((((((((( (((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((9o errors 9o errors

!!L $R;;"R 9S$4LL S$4$8S((((((((((((((((((((((((((((((((((('E

!!L $R;;"R R8999; S$4$8S((((((((((((((((((((((((((((((((((("94>L"!

S$4B*"$4!4$4 9 $R;;"R((((((((((((((((((((((((((((((((((('??

!!L $R;;"R SQL $R4C9;(((((((((((((((((((((((((((((((((((0

!!L $R;;"R $R4C" L"%"L(((((((((((((((((((((((((((((((((((0

L'C4$'9 '? !!L $R4C" ?L"(((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((/u01/app/oracle/diag/rdbms/orcl/orcl/trace/ggsDddlDtrace.log

4nalyHing installation status...

S$4$8S '? !!L R"PLC4$'9((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((S8CC"SS?8L installation of !!L Replication soft,are components

Script complete.

S;L< =role>setup4s?l

)ode

;;S Role setup script

$his script ,ill drop and recreate the role ;;SD;;S8S"RDR'L"

Page 17: Oracle GoldenGate Basic Architecture

8/16/2019 Oracle GoldenGate Basic Architecture

http://slidepdf.com/reader/full/oracle-goldengate-basic-architecture 17/24

$o use a different role name- uit this script and then edit the params.slscript to change the ggDrole parameterto the preferred name. <!o not run the script.=

Bou ,ill be prompted for the name of a schema for the ;olden;ate database obects.9'$": $he schema must be created prior to running this script.9'$": Stop all !!L replication before starting this installation.

"nter ;olden;ate schema name:ggs_adminFrote file roleDsetupDset.t#t

PL/SQL procedure successfully completed.

Role setup script complete

;rant this role to each user assigned to the "#tract- ;;SC-and *anager processes- by using the follo,ing SQL

command:

;R49$ ;;SD;;S8S"RDR'L" $'

,here is the user assigned to the ;olden;ate processes.

S;L< GR!NT GGS>GGS2SER>RLE T ggs>a'mi@

Grant succeeded.

S;L< =''l>eable4s?l

 Trigger altered.

Do 3ot8 o Source a' Target

GG!)$Iedit *aram G#OBA#!

GG!)6&A GG!9AD$K

Source

--*arameter to include in local extract ,le ext1

GG!)$I edit *aram ext1

exttrail dirdat't1''l iclu'e mappe' obAame 1SCTT4B1table !)OTT.P8

Lets c8eck 

Page 18: Oracle GoldenGate Basic Architecture

8/16/2019 Oracle GoldenGate Basic Architecture

http://slidepdf.com/reader/full/oracle-goldengate-basic-architecture 18/24

Source

!"#I alter table em* add ncol varchar%15/8

 Table altered.

!"#I desc em*8

)ode

 9ame 9ullI $ype ((((((((((((((((((((((((((((((((((((((((( (((((((( (((((((((((((((((((((((((((( "*P9' 9'$ 98LL 98*>"R<7= "94*" %4RCA4R<10= J'> %4RCA4R<= *;R 98*>"R<7= AR"!4$" !4$" S4L 98*>"R<-= C'** 98*>"R<-= !"P$9' 98*>"R<= NCOL VARCAR!"#$%

Target4

!"#I desc em*8

)ode

9ame 9ullI $ype

 ((((((((((((((((((((((((((((((((((((((((( (((((((( (((((((((((((((((((((((((((( "*P9' 9'$ 98LL 98*>"R<7= "94*" %4RCA4R<10= J'> %4RCA4R<= *;R 98*>"R<7= AR"!4$" !4$" S4L 98*>"R<-= C'** 98*>"R<-= !"P$9' 98*>"R<= NCOL VARCAR!"#$%

!lso

Source

!"#I create table test as select P from em*8

 Table created.

!"#I select P from tab8

Page 19: Oracle GoldenGate Basic Architecture

8/16/2019 Oracle GoldenGate Basic Architecture

http://slidepdf.com/reader/full/oracle-goldengate-basic-architecture 19/24

)ode

$94*" $4>$BP" CL8S$"R!(((((((((((((((((((((((((((((( ((((((( ((((((((((>'98S $4>L"!"P$ $4>L""*P $4>L"

S4L;R4!" $4>L"TEST TA&LE

Target

!"#I select P from tab8

)ode

$94*" $4>$BP" CL8S$"R!(((((((((((((((((((((((((((((( ((((((( ((((((((((>'98S $4>L"!"P$ $4>L"

"*P $4>L"S4L;R4!" $4>L"TEST TA&LE

1. Oracle Goldengate 11g $nitial #oad Jsing Direct #oad ethod.

 This article focuses on initial synchroniEation of source andtarget databases by using Golden Gate initial direct load method for the*ur*ose of Eero downtime D# re*lication.

&rere?uisites%

1/ Target Tables should be em*ty. Otherwise you can get du*licate row errors.%/ Disable Coreign Ley and )hec )onstraints. They can be enabled later onwhen the initial load is com*lete.>/ O*tional/ 2emove indexes from target tables as they may slow down theinitial loading *rocess./ To use handlecollisions function+ each target table must have a*rimary or uniMue ey. $f thatNs not *ossible use the L&:)O#!o*tion of the TAB#& and A0 *arameters. &ven if that is not *ossiblethen Muiesce your database for the duration of intial load.

Sc8ema to be replicate' 1SCTT1

0) 6stall Gol'eGate o bot8 t8e mac8ies4

) Disable $oreig key a' c8eck costraits a' triggers o target tables4

!"#I select )OK!T2A$KT9KA&+)OK!T2A$KT9T:0&+TAB#&9KA&+status fromdba9constraints where owner7N!)OTTN8

Page 20: Oracle GoldenGate Basic Architecture

8/16/2019 Oracle GoldenGate Basic Architecture

http://slidepdf.com/reader/full/oracle-goldengate-basic-architecture 20/24

)ode

C'9S$R49$D94*" C $4>L"D94*" S$4$8S(((((((((((((((((((((((((((((( ( (((((((((((((((((((((((((((((( ((((((((?ED!"P$9' R "*P "94>L"!PED!"P$ P !"P$ "94>L"!PED"*P P "*P "94>L"!

!"#I alter table em* disable constraint f9de*tno8

 Table altered.

) Co9gure a' start extract process o source4

) co9gure a' start Data &ump process o source4

F) Co9gure 6itial loa' extract a' replicat processes4

On Source

GG!)$ canada.exam*le.com/ 1FI edit *aram iniload1

extract iniload1userid ggs9admin+ *assword ggs9adminrmthost newyor+ mgr*ort Q<5rmttas re*licat+ grou* iniload%table !)OTT.P8

RTT!S# - $nstructs the manager *rocess on the target system tostart the initial-load re*licat *rocess without manual interventionas a one time tas.

GG!)$ canada.exam*le.com/ 1<I add extract iniload1+ sourceistable&(T2A)T added.

S2RCE6ST!3LE - Tells the extract *rocess to extract records directlyfrom the source tables rather than from the redo logs.

Target

GG!)$ newyor.exam*le.com/ FI edit *aram iniload%

re*licat iniload%userid ggs9admin+ *assword ggs9adminassumetargetdefsma* !)OTT.P+ target !)OTT.P8

GG!)$ newyor.exam*le.com/ I add re*licat iniload%+ s*ecialrun2&0#$)AT added.

Page 21: Oracle GoldenGate Basic Architecture

8/16/2019 Oracle GoldenGate Basic Architecture

http://slidepdf.com/reader/full/oracle-goldengate-basic-architecture 21/24

SpecialRu - 2uns as a onetime *rocess with distinct beginning and end+which is di3erent from continuous *rocessing as it does not have as*eci,c end *oint.

Source

!tart initial load extract *rocess on source. The re*licat *rocesson target will start automatically.

GG!)$ canada.exam*le.com/ 1I start extract iniload1

)ode

Sending S$4R$ reuest to *494;"R ...")$R4C$ 9L'4!1 starting

GG!)$ canada.exam*le.com/ >5I info extract iniload1

)ode

")$R4C$ 9L'4!1 Last Started 01(11(15 1:73 Status R8999;Checkpoint Lag 9ot 4&ailableLog Read Checkpoint $able SC'$$.!"P$  01(11(15 1:73:5 Record 1$ask S'8RC"S$4>L"

GG!)$ canada.exam*le.com/ >1I view re*ort iniload1

)ode01(11(15 1:73: 9?' ';;(0101 Fildcard resolution set to **"!4$" becauseS'8RC"S$4>L" is used.

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  'racle ;olden;ate Capture for 'racle  %ersion 11.1.1.1. ';;C'R"D11.1.1.1.DPL4$?'R*SD111007.100

Linu#- #32- 5bit <optimiHed=- 'racle 11g on 'ct 011 16:5:7

 Copyright <C= 16- 011- 'racle and/or its affiliates. 4ll rights reser&ed.

  Starting at 01(11(15 1:73:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

'perating System %ersion:Linu#%ersion +1 S*P $ue 4ug 13 16:61:67 "!$ 00- Release .2.13(127.el69ode: canada.e#ample.com*achine: i232  soft limit hard limit4ddress Space SiHe : unlimited unlimitedAeap SiHe : unlimited unlimited?ile SiHe : unlimited unlimited

Page 22: Oracle GoldenGate Basic Architecture

8/16/2019 Oracle GoldenGate Basic Architecture

http://slidepdf.com/reader/full/oracle-goldengate-basic-architecture 22/24

CP8 $ime : unlimited unlimited

Process id: 21

!escription:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Running ,ith the follo,ing parameters @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@e#tract iniload1userid ggsDadmin- pass,ord @@@@@@@@@rmthost ne,york- mgrport 30rmttask replicat- group iniloadtable SC'$$.@K$4>L"Fildcard resol&ed <entry SC'$$.@=:  table SC'$$.>'98SK

01(11(15 1:73: F4R99; ';;(0032 9o uniue key is defined for table >'98S. 4ll&iable columns ,ill be used to represent the key- but may not guarantee uniueness. E"BC'LS may be used todefine the key.

8sing the follo,ing key columns for source table SC'$$.>'98S: "94*"- J'>- S4L- C'**.$4>L"Fildcard resol&ed <entry SC'$$.@=:  table SC'$$.!"P$K

8sing the follo,ing key columns for source table SC'$$.!"P$: !"P$9'.$4>L"Fildcard resol&ed <entry SC'$$.@=:  table SC'$$."*PK

8sing the follo,ing key columns for source table SC'$$."*P: "*P9'.$4>L"Fildcard resol&ed <entry SC'$$.@=:  table SC'$$.S4L;R4!"K

01(11(15 1:73: F4R99; ';;(0032 9o uniue key is defined for table S4L;R4!".4ll &iable columns ,ill be used to represent the key- but may not guarantee uniueness. E"BC'LS may be usedto define the key.

8sing the follo,ing key columns for source table SC'$$.S4L;R4!": ;R4!"- L'S4L- AS4L.

C4CA"*;R &irtual memory &alues <may ha&e been adusted=C4CA">8??"RSG": 27EC4CA"SG": ;C4CA">8??"RSG" <soft ma#=: 7*C4CA"P4;"'8$SG" <normal=: 7*PR'C"SS %* 4%4L ?R'* 'S <min=: .3;C4CA"SG"*4) <strict force to disk=: .27;

!atabase %ersion:'racle !atabase 11g "nterprise "dition Release 11..0.1.0 ( ProductionPL/SQL Release 11..0.1.0 ( ProductionC'R" 11..0.1.0 Production$9S for Linu#: %ersion 11..0.1.0 ( Production9LSR$L %ersion 11..0.1.0 ( Production

!atabase Language and Character Set:9LSDL49; en&ironment &ariable specified has in&alid format- default &alue ,ill beused.9LSDL49; en&ironment &ariable not set- using default &alue 4*"RC49D4*"RC4.8S4SC.9LSDL49;84;" M4*"RC49M

Page 23: Oracle GoldenGate Basic Architecture

8/16/2019 Oracle GoldenGate Basic Architecture

http://slidepdf.com/reader/full/oracle-goldengate-basic-architecture 23/24

9LSD$"RR$'RB M4*"RC4M9LSDCA4R4C$"RS"$ MF"3*SF916M

Farning: your 9LSDL49; setting does not match database ser&er language setting.Please refer to user manual for more information.

Processing table SC'$$.>'98S

Processing table SC'$$.!"P$

Processing table SC'$$."*P

Processing table SC'$$.S4L;R4!"

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@ Run $ime Statistics @@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Report at 01(11(15 1:73:60 <acti&ity since 01(11(15 1:73:=

'utput to iniload:

?rom $able SC'$$.!"P$:  + inserts: 7  + updates: 0  + deletes: 0  + discards: 0?rom $able SC'$$."*P:  + inserts: 17  + updates: 0  + deletes: 0  + discards: 0?rom $able SC'$$.S4L;R4!":  + inserts: 6  + updates: 0  + deletes: 0  + discards: 0

R"!' Log Statistics  >ytes parsed 0  >ytes output 575

-) Eable all t8e costraits a' triggers o t8e target4

!"#I alter table em* enable constraint f9de*tno8

 Table altered.

) Co9gure a' start Replicat process o target4 

Page 24: Oracle GoldenGate Basic Architecture

8/16/2019 Oracle GoldenGate Basic Architecture

http://slidepdf.com/reader/full/oracle-goldengate-basic-architecture 24/24

1. Delete or 2emove &xtract 2e*licat 0rocesses Golden Gate 11g/.

1/ !to* extract're*licat.

ill extract grou*9nameill re*licat grou*9name

%/ Delete extracat ' re*licat.

delete extract grou*9namedelete re*licat grou*9name

>/ )leanu*.

cleanu* extract grou*9namecleanu* re*licat grou*9name