暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

ogg进程如何写trail文件

Ty3306 2022-12-05
1087

进程如何写trail文件

为了减小系统的I/O负载,抽取的数据通过大字节块的方式存储到trail文件中。同时为了提高兼容性,存储在trail文件中的数据以通用数据模式(一种可以在异构数据库之间进行快速而准确转换的模式)存储。 当然,根据不同应用的需求,数据也可以存储为不同的模式。

默认情况下,extract进程以追加的方式写入trail文件。当extract进程异常终止时,trail文件会被标记为需要恢复。当extract重新启动时会追加checkpoint之后的数据追加到该trail文件中。在 GoldenGate 10.0之前的版本, extract进程采用的是覆盖模式。即当 extract进程异常终止,则会将至上次完整写入的事务数据之后的数据覆盖现有trail文件中的内容。

这里是笔者理解不是很透彻,原文如下,望读者给予建议

By default, Extract operates in append mode, where if there is a process failure, a recovery  marker is written to the trail and Extract appends recovery data to the file so that a history  of all prior data is retained for recovery purposes. In append mode, the Extract initialization determines the identity of the last complete  transaction that was written to the trail at startup time. With that information, Extract  ends recovery when the commit record for that transaction is encountered in the data  source; then it begins new data capture with the next committed transaction that qualifies  for extraction and begins appending the new data to the trail. A data pump or Replicat  starts reading again from that recovery point. Overwrite mode is another version of Extract recovery that was used in versions of  GoldenGate prior to version 10.0. In these versions, Extract overwrites the existing  transaction data in the trail after the last write-checkpoint position, instead of appending  the new data. The first transaction that is written is the first one that qualifies for  extraction after the last read checkpoint position in the data source. checkpoint

checkpoint用于抽取或复制失败后(如系统宕机、网络故障灯),抽取、复制进程重新定位抽取或者复制的起点。在高级的同步配置中,可以通过配置checkpoint另多个extract或者replicat进程读取同个trail文件集。

extract进程在数据源和trail文件中都会标识checkpoint,Replicat只会在trail文件中标示checkpoint。

在批处理模式中,extract和replicat进程都不会记录checkpoint。如果批处理失败,则整改批处理会重新进行。

checkpoint信息会默认存储在goldengate的子目录dirchk中。在目标端除了checkpoint文件外,我们也可以通过配置通过额外checkpoint table来存储replicat的checkpoint信息。

Group 
我们可以通过为不同的extract和replicat进程进行分组来去区分不同进程之间的作用。例如,当需要并行的复制不同的数据集时,我们则可以创建两个或者多个复制进程。
进程组中包含进程,进程文件,checkpoint文件和其他与进程相关的文件。对于replicat进程来说,如果配置了checkpoint table,则不同组的都会包含checkpoint table。

GGSCI 
GGSCI是GoldenGate Software Command Interface 的缩写,它提供了十分丰富的命令来对Goldengate进行各种操作,如创建、修改、监控GoldenGate进程等等。
Commit Sequence Number
前文已经多次提到,Goldengate是以事务为单位来保证数据的完整性的,那么 GoldenGate又是怎么识别事务的呢? 这里用到的是Commit Sequence Number(CSN)。CSN存储在事务日志中和trail文件中 ,用于数据的抽取和复制。CSN作为事务开始的标志被记录在trail文件中,可以通过@GETENV字段转换函数或者logdump工具来查看。

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论