单个表通过函数 FILTER (@RANGE (1, n)) 拆分,你打算对这个表查分成几个进程,n就是几
create table t1 as select * From emp where 0=1;
alter table t1 add primary key(empno);
exta 进程同步 t1 表,现对replicate 进程进行拆分,拆分成两个进程对t1 表进行同步
GGSCI (a-hb-8-54) 390> info all
Program Status Group Lag Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING DPA 00:00:00 00:00:00
EXTRACT RUNNING EXTA 00:00:00 00:00:08
GGSCI (dba) 85> info all
Program Status Group Lag Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING REPA 00:00:00 00:00:03
给准备新建的进程添加参数文件
GGSCI (dba) 5> view params repa1
replicat repa1
assumetargetdefs
userid goldengate,password goldengate
reperror default,discard
discardfile /ggs/log/repa1.dsc, purge, megabytes 1
MAP scott.t1, TARGET scott.t1, FILTER (@RANGE (1, 2));
GGSCI (dba) 5> view params repa2
replicat repa2
assumetargetdefs
userid goldengate,password goldengate
reperror default,discard
discardfile /ggs/log/repa2.dsc, purge, megabytes 1
MAP scott.t1, TARGET scott.t1, FILTER (@RANGE (2, 2));
添加replicate 进程
add replicat repa1,exttrail /ggs/dirdat/aa nodbcheckpoint
add replicat repa2,exttrail /ggs/dirdat/aa nodbcheckpoint
停止repa 进程
stop repa
查看pump 进程的 Write Checkpoint的 Sequence 和RBA
GGSCI (a-hb-8-54) 393> info repa,showch
Write Checkpoint #1
GGS Log Trail
Current Checkpoint (current write position):
Sequence #: 26
RBA: 3160
Timestamp: 2015-04-03 10:25:31.549000
Extract Trail: /ggs/dirdat/aa
修改replicate 进程的指针和pump一致
alter repa1 extseqno 26, extrba 3160
alter repa2 extseqno 26, extrba 3160
启动 replicate进程
start repa1
start repa2
插入数据:
insert into t1 select * From emp;
查看进程插入数据的情况
GGSCI (dba) 41> stats repa2,total
Sending STATS request to REPLICAT REPA2 ...
Start of Statistics at 2015-04-03 10:33:18.
Replicating from SCOTT.T1 to SCOTT.T1:
*** Total statistics since 2015-04-03 10:32:01 ***
Total inserts 6.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 6.00
End of Statistics.
GGSCI (dba) 42> stats repa1,total
Sending STATS request to REPLICAT REPA1 ...
Start of Statistics at 2015-04-03 10:33:29.
Replicating from SCOTT.T1 to SCOTT.T1:
*** Total statistics since 2015-04-03 10:32:00 ***
Total inserts 6.00
Total updates 0.00
Total deletes 0.00
Total discards 0.00
Total operations 6.00
End of Statistics.
进程拆分完毕,可以删除之前的repa进程
delete repa