报错如下
2015-08-14 17:01:58 WARNING OGG-01004 Aborted grouped transaction on 'POSPNEW.PUBJNLDEF', Database error 1400 (OCI Error
2015-08-14 17:01:58 WARNING OGG-01004 Aborted grouped transaction on 'POSPNEW.PUBJNLDEF', Database error 1400 (OCI Error
ORA-01400: cannot insert NULL into ("POSPNEW"."PUBJNLDEF"."BRNO") (status
= 1400), SQL <INSERT INTO "POSPNEW"."PUBJNLDEF"
("BRNO","BUSTYP","CRPCOD","ONLTBL","BATTBL","ONLCHK","BATCHK") VALUES
(:a0,:a1,:a2,:a3,:a4,:a5,:a6)>).
2015-08-14 17:01:58 WARNING OGG-01003 Repositioning to rba 10291 in seqno
6.
2015-08-14 17:01:58 WARNING OGG-01154 SQL error 1400 mapping
POSPNEW.PUBJNLDEF to POSPNEW.PUBJNLDEF OCI Error ORA-01400:
cannot insert NULL into ("POSPNEW"."PUBJNLDEF"."BRNO") (status = 1400),
SQL <INSERT INTO "POSPNEW"."PUBJNLDEF" ("BRNO","B
USTYP","CRPCOD","ONLTBL","BATTBL","ONLCHK","BATCHK") VALUES
(:a0,:a1,:a2,:a3,:a4,:a5,:a6)>.
跳过这个事务
通过上面的信息我们知道了replicat进程rp_gl group 下在应用到了./dirdat/gl000006的RBA 10291,我们想跳过这个事务应用下一条记录就可以,但是可不是简单的在当前的RBA上加1,RBA必须是有OGG格式过的,如果输入的是无效地址启动后EXCEPTION会记录到ggserr.log中,我们可以用OGG安装目录下的logdump工具来定位下一条记录的“真正”位置
跳过这个事务
通过上面的信息我们知道了replicat进程rp_gl group 下在应用到了./dirdat/gl000006的RBA 10291,我们想跳过这个事务应用下一条记录就可以,但是可不是简单的在当前的RBA上加1,RBA必须是有OGG格式过的,如果输入的是无效地址启动后EXCEPTION会记录到ggserr.log中,我们可以用OGG安装目录下的logdump工具来定位下一条记录的“真正”位置
[oracle@pospjzcxdb goledengate]$ ./logdump
Oracle GoldenGate Log File Dump Utility for Oracle
Version 12.1.2.1.0 OGGCORE_12.1.2.1.0_PLATFORMS_140727.2135.1
Copyright (C) 1995, 2014, Oracle and/or its affiliates. All rights
reserved.
Logdump 5 >open ./dirdat/gl000006
Current LogTrail is /home/oracle/goledengate/dirdat/gl000006
Logdump 6 >pos 10291
Reading forward from RBA 10291
Logdump 7 >n
2015/08/14 10:30:03.015.709 GGSPKUpdate Len 168 RBA 10291
Name: POSPNEW.PUBJNLDEF
After Image: Partition 4 G
s
0028 0000 0008 ffff 0000 0000 0000 0001 0008 0000 | .(..................
3030 3030 3020 0002 000c 0000 3030 3030 3030 3030 | 00000 ......00000000
3030 0000 0008 ffff 0000 0000 0000 0001 0008 0000 | 00..................
3131 3131 3120 0002 000c 0000 3131 3131 3131 3131 | 11111 ......11111111
3131 0003 0020 0000 3131 3131 3131 2020 2020 2020 | 11... ..111111
2020 2020 2020 2020 2020 2020 2020 2020 2020 0004 | ..
0020 0000 2020 2020 2020 2020 2020 2020 2020 2020 | . ..
Logdump 8 >n
2015/08/14 10:31:05.040.594 Delete Len 40 RBA 10583
Name: POSPNEW.PUBJNLDEF
Before Image: Partition 4 G
s
0000 0008 0000 3838 3838 3838 0001 0008 0000 3131 | ......888888......11
3131 3120 0002 000c 0000 3131 3131 3131 3131 3131 | 111 ......1111111111
Logdump 9 >n
2015/08/14 16:19:23.013.239 Insert Len 75 RBA 10742
Name: POSPADM.ATMPOSPRV
After Image: Partition 4 G
s
0000 000c 0000 0008 3939 3939 3939 3939 0001 0013 | ........99999999....
0000 000f 3939 3939 3939 3939 3939 3939 3939 3900 | ....999999999999999.
0200 0700 0000 0330 3030 0003 000c 0000 0008 3030 | .......000........00
3030 3030 3030 0004 0005 0000 0001 20 | 000000........
Logdump 10 >exit
pos是position的缩写,意思是定位到replicat启始的位置,n是next的缩写,第一个n定位显示出当前应用的记录,可以看出是update 还有表的名字,还有image的值,我们要跳过这个事务当然要再输一个n,可以看到下一个记录的rba是 10583绝不是前面RBA简单的加1.这样我们就可以修改replicat进程启动时的rba指定为10583
pos是position的缩写,意思是定位到replicat启始的位置,n是next的缩写,第一个n定位显示出当前应用的记录,可以看出是update 还有表的名字,还有image的值,我们要跳过这个事务当然要再输一个n,可以看到下一个记录的rba是 10583绝不是前面RBA简单的加1.这样我们就可以修改replicat进程启动时的rba指定为10583
[oracle@pospjzcxdb goledengate]$ ./ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 12.1.2.1.0 OGGCORE_12.1.2.1.0_PLATFORMS_140727.2135.1_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Aug 7 2014 09:14:25
Operating system character set identified as UTF-8.
Copyright (C) 1995, 2014, Oracle and/or its affiliates. All rights
reserved.
GGSCI (pospjzcxdb) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING DP_GL 00:00:00 00:00:09
EXTRACT RUNNING DP_LJ1 00:00:00 00:00:02
EXTRACT RUNNING DP_LJ2 00:00:00 00:00:08
EXTRACT RUNNING ET_ZXREP 00:00:00 00:00:00
EXTRACT RUNNING EX_LC 00:00:00 00:00:07
REPLICAT ABENDED RP_GL 06:31:55 00:03:59
REPLICAT RUNNING RP_LJ1 00:00:00 00:00:03
REPLICAT RUNNING RP_LJ2 00:00:00 00:00:00
GGSCI (pospjzcxdb) 2> alter rep rp_gl, extseqno 000006, extrba
10583
REPLICAT altered.
GGSCI (pospjzcxdb) 3> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING DP_GL 00:00:00 00:00:05
EXTRACT RUNNING DP_LJ1 00:00:00 00:00:08
EXTRACT RUNNING DP_LJ2 00:00:00 00:00:04
EXTRACT RUNNING ET_ZXREP 00:00:00 00:00:06
EXTRACT RUNNING EX_LC 00:00:00 00:00:03
REPLICAT STOPPED RP_GL 00:00:00 00:00:02
REPLICAT RUNNING RP_LJ1 00:00:00 00:00:09
REPLICAT RUNNING RP_LJ2 00:00:00 00:00:06
GGSCI (pospjzcxdb) 4> start rp_gl
Sending START request to MANAGER ...
REPLICAT RP_GL starting
GGSCI (pospjzcxdb) 5> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING DP_GL 00:00:00 00:00:00
EXTRACT RUNNING DP_LJ1 00:00:00 00:00:02
EXTRACT RUNNING DP_LJ2 00:00:00 00:00:09
EXTRACT RUNNING ET_ZXREP 00:00:00 00:00:01
EXTRACT RUNNING EX_LC 00:00:00 00:00:08
REPLICAT RUNNING RP_GL 00:40:08 00:00:01
REPLICAT RUNNING RP_LJ1 00:00:00 00:00:04
REPLICAT RUNNING RP_LJ2 00:00:00 00:00:01
当然如果还有失败的事务还可以继续next用上面的方法,不过如果有几个连续的事务需要skip,那就可以用另外一个方法
start rep rp_gl skiptransaction
不过跳过的事务数是未知的,同样也会记录到discard文件中,如果参数中配置了。