goldengate 单个表通过函数对replicate进程拆分(进程拆分系列之二)


单个表通过函数 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
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值