一、.准备
前提:保证3台机器(A-源机,B-目标机,C-目标机),能够互相通信,且都装有oracle和GoldenGate
A机:172.28.132.231
B机:172.28.132.235
C机:172.28.132.236
1. 在A,B,C机器上配置管理进程
edit params mgr
输入:port 7809
2.数据初始化
A机:配置发送extract
edit params einikk
如下:
extract einikk
userid system, password "oracle"
rmthost 172.28.132.235, MGRPORT 7809
rmttask replicat, group rinikk
TABLE ggusr.*;
rmthost 172.28.132.236, MGRPORT 7809
rmttask replicat, group rinikk
TABLE ggusr.*;
B和C机配置相同的接收的replicat
edit params rinikk
如下:
replicat rinikk
assumetargetdefs
userid system, password oracle
discardfile ./dirrpt/RINIKK.dsc,PURGE
map ggusr.*, target ggusr.*;
二、传送数据
配置源机(A)
1.配置源机extract进程抽取数据
add extract sd1, tranlog, begin now
2.配置trail文件
add exttrail ./dirdat/ex, extract sd1, megabytes 10
3.编辑extract sd1
extract sd1
userid system, password oracle
exttrail ./dirdat/ex
numfiles 300
dynamicresolution
table ggusr.*;
4.配置传送extract进程
add extract pump1, exttrailsource ./dirdat/ex, begin now
5.配置传送位置
add rmttrail ./dirdat/re, extract pump1
6.编辑pump1
extract pump1
dynamicresolution
userid system, password oracle
rmthost 172.28.132.235, mgrport 7809, compress
rmttrail ./dirdat/re
numfiles 3000
PASSTHRU
table ggusr.*;
7.配置传送extract进程
add extract pump2, exttrailsource ./dirdat/ex, begin now
8.配置传送位置
add rmttrail ./dirdat/re, extract pump2
9.编辑pump2
extract pump2
dynamicresolution
userid system, password oracle
rmthost 172.28.132.236, mgrport 7809, compress
rmttrail ./dirdat/re
numfiles 3000
PASSTHRU
table ggusr.*;
10.启动extract
start extract sd1
start extract pump1
start extract pump2
三、接受数据
配置目标机
1.配置全局变量./GLOBALS
输入:CHECKPOINTTABLE system.cktb
2.添加check点到system.cktb
dblogin userid system, password oracle
add checkpointtable system.cktb
3.配置接受数据进程replicat
add replicat rep1, exttrail ./dirdat/re checkpointtable system.cktb
4.编辑rep1
replicat rep1
userid system, password oracle
HANDLECOLLISIONS
ASSUMETARGETDEFS
DISCARDFILE ./dirrpt/RORAKK.DSC,PURGE
MAP ggusr.* TARGET ggusr.*;
配置另一台目标机
1.配置全局变量./GLOBALS
输入:CHECKPOINTTABLE system.cktb
2.添加check点到system.cktb
dblogin userid system, password oracle
add checkpointtable system.cktb
3.配置接受数据进程replicat
add replicat rep1, exttrail ./dirdat/re checkpointtable system.cktb
4.编辑rep1
replicat rep1
userid system, password oracle
HANDLECOLLISIONS
ASSUMETARGETDEFS
DISCARDFILE ./dirrpt/RORAKK.DSC,PURGE
MAP ggusr.* TARGET ggusr.*;
四、验证
stats pump1
stats pump2
stats rep1
stats rep2
或直接查询数据库