Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

OGG data Warehouse and one-way replication

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Configure Extract (extract) Process in Source system

Configure capture (capture) parameters

Edit extract process parameter

GGSCI (gc2) 21 > EDIT PARAMS EORA_1 configuration capture parameter file

-- Change Capture parameter file to capture

-- EMP_OGG and DEPT_OGG changes

EXTRACT EORA_1

SETENV (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)

USERID ogg, PASSWORD ogg

The EXTTRAIL / u01/app/ogg/dirdat/aa trace extraction file is placed in the / u01/app/ogg/dirdat directory with the file name prefixed with aa: example aa000000

TABLE scott.TCUSTMER; capture (capture) the name of the table to be monitored. Capture can monitor multiple tables or one table by value.

TABLE scott.TCUSTORD

Please note that "aa" is prefix for local trail file.

Execute the following commands in source system to add Primary Extract group.

GGSCI (gc2) 22 > ADD EXTRACT EORA_1, TRANLOG, BEGIN NOW

EXTRACT added.

ADD EXTRACT EORA_1: add an EXTRACT process, which means running all the time, and no one will grab the log in the redo as soon as it stops.

TRANLOG, BEGIN NOW: start synchronous logging now, or use asynchronous, so you need to configure it separately

Define GoldenGate local trail

GGSCI (gc2) 24 > ADD EXTTRAIL / u01 MEGABYTES MEGABYTES add trace EORA_1 for EORA_1 with a size of 5m

EXTTRAIL added.

Start primary Extract process

GGSCI (gc2) 25 > START EXTRACT EORA_1 / / start the process

Sending START request to MANAGER...

EXTRACT EORA_1 starting

Verify extract process is running or not:

GGSCI (gc2) 26 > INFO EXTRACT EORA_1

EXTRACT EORA_1 Last Started 2014-08-11 18:57 Status RUNNING

Checkpoint Lag 00:00:00 (updated 00:00:01 ago)

Log Read Checkpoint Oracle Redo Logs

2014-08-11 18:57:57 Seqno 9, RBA 2469888

Indicates that the log series number read now is the location where the checkpoint occurred in sequence 9, which is related to the MTTR setting, and where the checkpoint occurred.

That is, the dirty data blocks before this checkpoint are written to the data file through DBWn, and the location where the checkpoint occurs is RBA. A new era begins again, and the previous checkpoint is preserved.

SQL > select group#,sequence#,status from v$log

GROUP# SEQUENCE# STATUS

1 8 INACTIVE

2 9 CURRENT

3 7 INACTIVE

[oracle@gc2 ~] $ps-ef | grep ogg to view the EORA_1 process

Oracle 3843 3554 0 18:57? 00:00:00 / u01/app/ogg/extract PARAMFILE / u01/app/ogg/dirprm/eora_1.prm REPORTFILE / u01/app/ogg/dirrpt/EORA_1.rpt PROCESSID EORA_1 USESUBDIRS

Now Goldengate will generate local tail file "aa000000" under dirdat in Source system:

[oracle@gc2 ~] $ll / u01/app/ogg/dirdat/ view the log information to be tracked, and the capture log information is placed in this trace file.

Total 4

-rw-rw-rw- 1 oracle oinstall 906 Aug 11 18:57 aa000000

Configure pump (delivery) process in source system--

Configure the information passed to the target library (target)

Edit data pump process parameter

GGSCI (gc2) 27 > EDIT PARAMS PORA_1

-- Data Pump parameter file to read the local

-- trail of EMP_OGG and DEPT_OGG changes

--

EXTRACT PORA_1

SETENV (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)

PASSTHRU

RMTHOST oraclelinux54.cuug.net, MGRPORT 7809 delivers the captured logs to the target host oraclelinux54.cuug.net, port 7809

RMTTRAIL / u01/app/ogg/dirdat/pa

TABLE scott.TCUSTMER

TABLE scott.TCUSTORD

Add data pump Extract group

GGSCI (gc2) 29 > ADD EXTRACT PORA_1, EXTTRAILSOURCE / u01/app/ogg/dirdat/aa

Tell PORA_1 which path to send the tracking information under

EXTRACT added.

Verify results:

GGSCI (gc2) 30 > INFO EXTRACT PORA_1

EXTRACT PORA_1 Initialized 2014-08-11 19:08 Status STOPPED

Checkpoint Lag 00:00:00 (updated 00:00:23 ago)

Log Read Checkpoint File / u01/app/ogg/dirdat/aa000000

First Record RBA 0

Add GoldenGate remote (remote) trail in Source system

Configure remote paths and files on the source database side

GGSCI (gc2) 31 > ADD RMTTRAIL / u01/app/ogg/dirdat/pa, EXTRACT PORA_1, MEGABYTES 5

Indicates the remote directory file in which the captured information is transferred

RMTTRAIL added.

Start data pump process:

GGSCI (gc2) 32 > START EXTRACT PORA_1 starts the transfer and keeps running

Sending START request to MANAGER...

EXTRACT PORA_1 starting

Verify the results:

GGSCI (gc2) 33 > INFO EXTRACT PORA_1

EXTRACT PORA_1 Last Started 2014-08-11 19:11 Status RUNNING

Checkpoint Lag 00:00:00 (updated 00:00:00 ago)

Log Read Checkpoint File / u01/app/ogg/dirdat/aa000000

First Record RBA 906

Now Goldengate will generate remote tail file "pa000000" under dirdat in Target system:

[oracle@gc2 ~] $ll / u01/app/ogg/dirdat/

Total 4

-rw-rw-rw- 1 oracle oinstall 906 Aug 11 18:57 aa000000

Configure replicat (replication) process in target system--

Configure how to receive and deal with the transmitted information on the destination side.

Create GLOBALS parameter in target system

Edit GLOBALS (upper case) parameter file to indicate checkpoint table

GGSCI (oraclelinux54.cuug.net) 5 > EDIT PARAMS. / GLOBALS

CHECKPOINTTABLE ogg.ggschkpt uses the checkpoint table under ogg

Verify:

[oracle@oraclelinux54.cuug.net:/u01/app/ogg] $ll GLOBALS

-rw-rw-rw- 1 oracle oinstall 29 Aug 11 07:14 GLOBALS

For GLOBALS configuration take effect, we must exit GGSCI session:

GGSCI (oraclelinux54.cuug.net) 6 > exit

Add replicat checkpoint table in target system:

GGSCI (oraclelinux54.cuug.net) 1 > DBLOGIN USERID ogg, PASSWORD ogg logs in to the target database

Successfully logged into database.

GGSCI (oraclelinux54.cuug.net) 2 > ADD CHECKPOINTTABLE places checkpoint information in this table specifically for checkpoint tables

Successfully created checkpoint table OGG.

Sys@TDB112 > conn ogg/ogg

Ogg@TDB112 > select * from tab

TNAME TABTYPE CLUSTERID

GGSCHKPT TABLE

Edit Delivery process parameter

Add Replicat group:

GGSCI (oraclelinux54.cuug.net) 4 > ADD REPLICAT RORA_1, EXTTRAIL/u01/app/ogg/dirdat/pa

Indicates where to extract the transmitted information

REPLICAT added.

Edit replicat process RORA_1 parameter:

GGSCI (oraclelinux54.cuug.net) 7 > EDIT PARAM RORA_1

--

-- Change Delivery parameter file to apply

-- EMP_OGG and DEPT_OGG Changes

--

REPLICAT RORA_1

SETENV (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)

USERID ogg, PASSWORD ogg

HANDLECOLLISIONS

ASSUMETARGETDEFS

DISCARDFILE. / dirrpt/RORA_aa.DSC, PURGE

MAP scott.tcustmer, which table in the TARGET scott.tcustmer; source database and which table in the target database receives

MAP scott.tcustord, TARGET scott.tcustord

Note: In the MAP statement, the first owner/schema is for the source and the second for the target.

Start Replicat process:

GGSCI (oraclelinux54.cuug.net) 8 > START REPLICAT RORA_1

Sending START request to MANAGER...

REPLICAT RORA_1 starting

Verify:

GGSCI (oraclelinux54.cuug.net) 9 > INFO REPLICAT RORA_1

REPLICAT RORA_1 Initialized 2014-08-11 07:20 Status STOPPED

Checkpoint Lag 00:00:00 (updated 00:07:19 ago)

Log Read Checkpoint File / u01/app/ogg/dirdat/pa000000

First Record RBA 0

Verify if DML can be duplicated correctly

Insert operation

Insert data in source system:

SQL > conn scott/tiger

SQL > insert into tcustmer values ('abbb','beijing','shanghao',' ch')

1 row created.

SQL > commit

Commit complete.

SQL > select * from tcustmer

CUST NAME CITY ST

WILL BG SOFTWARE CO. SEATTLE WA

JANE ROCKY FLYER INC. DENVER CO

Abb beijing shanghao ch

Check the result in target system:

SQL > select * from tcustmer

CUST NAME CITY ST

WILL BG SOFTWARE CO. SEATTLE WA

JANE ROCKY FLYER INC. DENVER CO

Abb beijing shanghao ch

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report