1. 配置源端GoldenGate
配置管理进程和抽取进程
./ggsci
>dblogin userid ogg,password ufsoft
>edit params mgr
--编辑管理进程
PORT 7809
>start mgr
>edit params GLOBALS
GGSCHEMA ogg
>edit extract eini_1
EXTRACT EINI_1
dynamicresolution
SETENV (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
USERID ogg PASSWORD ufsoft
RMTHOST 192.168.0.4,MGRPORT 7809
TRANLOGOPTIONS EXCLUDEUSER ogg
exttrail /oracle/goldengate/dirdat/la
DDL INCLUDE ALL
table scott.*;
>add extract eini_1,tranlog,begin now
>add extract eini_1,tranlog,begin now
>add exttrail /oracle/goldengate/dirdat/la,extract eini_1
>edit params pump_so //配置
pump进程
extract pump_so
dynamicresolution
rmthost 192.168.0.4,mgrport 7809,compress
rmttrail /oracle/goldengate/dirdat/ma
table scott.* //如果需要对多个用户下的表进行通步的话,建议多建立几个抽取进程,以免其中一个进程出现意外停止而导致所有抽取进程都停止,减少数据的丢失。
> add extract pump_so,exttrailsource /oracle/goldengate/dirdat/la
> add rmttrail /oracle/goldengate/dirdat/ma,extract pump_so
2) 配置复制进程
>add checkpointtable ogg.checkpoint
>add replicat rini_1,exttrail /oracle/goldengate/dirdat/ra,begin now,checkpointtable ogg.checkpoint
>edit params rini_1
REPLICAT RINI_1
SETENV (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
ASSUMETARGETDEFS
USERID ogg PASSWORD ufsoft
DISCARDFILE /oracle/goldengate/dirrpt/RINIaa.dsc,PURGE
DDL INCLUDE ALL
DDLERROR DEFAULT IGNORE RETRYOP MAXRETRIES 3 RETRYDELAY 5
DDLERROR DEFAULT DISCARD
DDLERROR DEFAULT IGNORE RETRYOP
MAP scott.* , TARGET scott.*;
开启各进程。
2. 配置目标端GoldenGate
1) 配置管理进程和复制进程
目标端只需要配置两个进程即可:管理进程和复制进程
./ggsci
>dblogin userid ogg,password ufsoft
>edit params mgr
PORT 7809
PURGEOLDEXTRACTS /dirdat,USECHECKPOINTS
>start mgr
>edit params GLOBALS //全局配置,非必须
GGSCHEMA ogg
>add checkpointtable ogg.checkpoint
>add replicat rini_1,exttrail /oracle/goldengate/dirdat/ma,begin now,checkpointtable ogg.checkpoint
>edit params rini_1
REPLICAT RINI_1
SETENV (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
ASSUMETARGETDEFS
USERID ogg PASSWORD ufsoft
DISCARDFILE /oracle/goldengate/dirrpt/RINIaa.dsc,PURGE
DDL INCLUDE ALL
DDLERROR DEFAULT IGNORE RETRYOP MAXRETRIES 3 RETRYDELAY 5
DDLERROR DEFAULT DISCARD
DDLERROR DEFAULT IGNORE RETRYOP
MAP scott.* , TARGET scott.*;
2) 配置抽取进程
>edit params eini_1
EXTRACT EINI_1
dynamicresolution
SETENV (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
USERID ogg PASSWORD ufsoft
RMTHOST 192.168.0.3,MGRPORT 7809
TRANLOGOPTIONS EXCLUDEUSER ogg
exttrail /oracle/goldengate/dirdat/na
DDL INCLUDE ALL
table scott.*;
>add extract eini_1,tranlog,begin now
>add exttrail /oracle/goldengate/dirdat/na,extract eini_1
>edit params pump_so
extract pump_so
dynamicresolution
USERID ogg PASSWORD ufsoft
rmthost 192.168.0.3,mgrport 7809,compress
rmttrail /oracle/goldengate/dirdat/ra
table scott.*;
> add extract pump_so,exttrailsource /oracle/goldengate/dirdat/na
> add rmttrail /oracle/goldengate/dirdat/ra,extract pump_so
开启所有进程。