点击上方“IT那活儿”公众号--专注于企业全栈运维技术分享,不管IT什么活儿,干就完了!!!
某天在巡检时发现之前部署的ogg链路(oracle-kafka)进程出现问题,自6月7日之后就没有数据,大约10天没有数据更新。
经过排查发现投递进程为ABENDED状态。因为是新上的国产化测试系统,所以还没有部署监控。
2.1 查询各进程运行情况
抽取进程运行正常,投递进程为ABENDED状态,复制进程状态正常(但是数据6月7日之后就没)!



2.2 查看投递进程的日志
GGSCI > view report D_KA1

WARNING OGG-06590 The output trail file /*******/ct000000083 is not found, rescan for previous ones.
ERROR OGG-02171 Error reading LCR from data source. Status 500, data source type TrailDataSource.
ERROR OGG-01091 Unable to open file "/ogg/crmmt/dirdat/tb000005021" (error 2, No such file or directory).
2.3 修改投递进程的的seq并重启
GGSCI > alter EXTRACT D_KA1,extseqno 5646,extrba 0
EXTRACT altered.
GGSCI > info D_KA1 detail


GGSCI > start D_KA1
Sending START request to MANAGER ...
EXTRACT D_KA1 starting

WARNING OGG-06590 The output trail file /*******/ct000000083 is not found, rescan for previous ones.
ERROR OGG-02171 Error reading LCR from data source. Status 500, data source type TrailDataSource.
ERROR OGG-01091 Unable to open file "/ogg/crmmt/dirdat/tb000005021" (error 2, No such file or directory).

2.4 清空复制端队列文件

GGSCI > alter EXTRACT D_KA1,extseqno 5646,extrba 0
EXTRACT altered.
GGSCI > info D_KA1 detail
GGSCI > start D_KA1
Sending START request to MANAGER ...
EXTRACT D_KA1 starting
GGSCI > stats D_KA1
Sending STATS request to EXTRACT D_KA1 ...
Start of Statistics at 2024-06-19 15:08:04.
Output to **********dirdat/ct:
Extracting from ****** to ******:
*** Total statistics since 2024-06-19 15:01:36 ***
Total inserts 122692.00
Total updates 0.00
Total deletes 0.00
Total upserts 0.00
Total discards 0.00
Total operations 122692.00
*** Daily statistics since 2024-06-19 15:01:36 ***
Total inserts 122692.00
Total updates 0.00
Total deletes 0.00
Total upserts 0.00
Total discards 0.00
Total operations 122692.00
*** Hourly statistics since 2024-06-19 15:01:36 ***
Total inserts 122692.00
Total updates 0.00
Total deletes 0.00
Total upserts 0.00
Total discards 0.00
Total operations 122692.00
*** Latest statistics since 2024-06-19 15:01:36 ***
Total inserts 122692.00
Total updates 0.00
Total deletes 0.00
Total upserts 0.00
Total discards 0.00
Total operations 122692.00
End of Statistics.



2.6 重新配置复制进程并启动
GGSCI > view param R_CX1
REPLICAT r_cx1
TARGETDB LIBFILE libggjava.so SET property=dirprm/kc1.props
REPORTCOUNT EVERY 1 MINUTES, RATE
GROUPTRANSOPS 10000
REPLACEBADCHAR SKIP
MAP ***********, TARGET *****************
GGSCI > view param R_CX2
REPLICAT r_cx2
TARGETDB LIBFILE libggjava.so SET property=dirprm/kc2.props
REPORTCOUNT EVERY 1 MINUTES, RATE
GROUPTRANSOPS 10000
REPLACEBADCHAR SKIP
MAP ***********, TARGET ***********;
GGSCI > stop R_CX1
Sending STOP request to REPLICAT R_CX1 ...
Request processed.
GGSCI > stop R_CX2
Sending STOP request to REPLICAT R_CX2 ...
Request processed.
GGSCI > delete R_CX1
Deleted REPLICAT R_CX1.
GGSCI > delete R_CX2
Deleted REPLICAT R_CX2.
GGSCI > edit param r_cx1
GGSCI > edit param r_cx2
GGSCI > add replicat R_CX1 exttrail ****/dirdat/ct,nodbcheckpoint
REPLICAT added.
GGSCI > add replicat R_CX2 exttrail /****/dirdat/ct,nodbcheckpoint
REPLICAT added.
GGSCI > start R_CX1
Sending START request to MANAGER ...
REPLICAT R_CX1 starting
GGSCI > start R_CX2
Sending START request to MANAGER ...
REPLICAT R_CX2 starting
GGSCI (dzqd9qd1H21) 22> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING R_CX1 00:21:21 00:00:00
REPLICAT RUNNING R_CX2 00:21:19 00:00:01
GGSCI (dzqd9qd1H21) 23>
GGSCI (dzqd9qd1H21) 23> stats R_CX1
Sending STATS request to REPLICAT R_CX1 ...
Start of Statistics at 2024-06-19 15:06:37.
Replicating from ***** to *****:
*** Total statistics since 2024-06-19 15:06:31 ***
Total inserts 10001.00
Total updates 0.00
Total deletes 0.00
Total upserts 0.00
Total discards 0.00
Total operations 10001.00
*** Daily statistics since 2024-06-19 15:06:31 ***
Total inserts 10001.00
Total updates 0.00
Total deletes 0.00
Total upserts 0.00
Total discards 0.00
Total operations 10001.00
*** Hourly statistics since 2024-06-19 15:06:31 ***
Total inserts 10001.00
Total updates 0.00
Total deletes 0.00
Total upserts 0.00
Total discards 0.00
Total operations 10001.00
*** Latest statistics since 2024-06-19 15:06:31 ***
Total inserts 10001.00
Total updates 0.00
Total deletes 0.00
Total upserts 0.00
Total discards 0.00
Total operations 10001.00
End of Statistics.
前期是因为ogg复制进程的服务器改造成了国产化,因此升级了ogg的版本,由12c升级到了19c,在重新部署ogg复制进程的时候,只是按着之前的的进程参数重新部署的,启动好ogg复制进程后查询了进程状态,而且stats 进程发现有数据。但是没有检查投递进程是否还正常!后期巡检的时候发现复制进程正常,但是数据其实已经很久没有滚动了。
常见的初始化的方法:
Initial Load Group 初始数据加载组,可以分为目标端不转储数据和目标端转储数据两种方式,抽取进程将源端数据抽取并发送到目标端,存储为OGG或者数据库可以识别的数据格式。 Change Extract Group 增量数据,抽取组配合初始数据加载组,完成初始化过程中源端增量数据的同步,保证两端数据一致性。 GoldenGate 的 Direct Initial load 常用于用于异构环境的初始化数据,也可以用于某些生产环境到测试环境的数据同步。

本文作者:刘 锐(上海新炬中北团队)
本文来源:“IT那活儿”公众号





