一.Checkpoints 理论说明
有关GG的Checkpoints 在系列一, GG的架构中以说明:
OracleGolden Gate 系列一 --GG 架构 说明:http://www.2cto.com/database/201111/111280.html
这里在单独拿出来说明一下,因为这是一个较为重要的概念。
Checkpoints storethe current read and write positions of a process to disk for recovery purposes.These checkpoints ensure that data changes that are marked for synchronizationactually are extracted by Extract and replicated by Replicat, and they preventredundant processing.
--Checkpoint 存储了进程当前读和写的位置。 Checkpoints 保证已经改变的数据已经同步,从而阻止其他冗余的操作。
They providefault tolerance by preventing the loss of data should the system, the network,or an Oracle GoldenGate process need to be restarted. For complexsynchronization configurations, checkpoints enable multiple Extract or Replicatprocesses to read from the same set of trails.
--通过Checkpoints 可以在以下情况下的数据丢失:系统或者网络故障,重启GG进程。Checkpoints支持多个Extact 或者Replicat 进程读取同一个trail 文件。
Checkpoints workwith inter-process acknowledgments to prevent messages from being lost in thenetwork. Oracle GoldenGate has a proprietary guaranteed-message delivery technology.
Extract createscheckpoints for its positions in the data source and in the trail. Replicat createscheckpoints for its position in the trail.
--默认情况下Extract 和 Replicat 进程都会在trail文件里记录checkpoints 的位置。
A checkpointsystem is used by Extract and Replicat processes that operate continuously, butit is not required by Extract and Replicat processes that run in batch mode. Abatch process can be re-run from its start point, whereas continuous processingrequires the support for planned or unplanned interruptions that is provided bycheckpoints.
--checkpoints 机制保证了Extract 和 Replicat 进程可以连续的操作。
Replicat storesits checkpoints in a checkpoint table in the target database to couple the commitof its transaction with its position in the trail file. This ensures that atransaction will only be applied once, even if there is a failure of theReplicat process or the database process. For reporting purposes, Replicat alsohas a checkpoint file on disk in the dirchk subdirectory of the OracleGoldenGate directory.
--Replicat 在Target 库的checkpoint 表里记录了已经提交了事务在trail 文件里的位置。这样就可以保证事务只被应用一次,即使在replicat 进程或者DB 出现故障的情况下。 为了做报告,Replicat也会在GG 安装目录的dirchk 目录里存放一个checkpoint 文件。
You canoptionally configure Replicat to use this file as its sole checkpoint store,and not use a checkpoint table at all. In this mode, however, there can becases where the checkpoint in the file is not consistent with what was appliedafter a database recovery, if the failure either rolled back or rolled forwarda transaction that was considered applied by Replicat. The checkpoint table guaranteesconsistency after recovery.
--我们可以在不使用checkpoint 的情况下,配置Replicat 进程使用这个本地的文件来存储checkpoint,但是使用本地的checkpoint 文件, 在数据库做了recover的情况下,不能保证数据的一致性。
在事务rolled back 或 rolledforward失败的情况下,使用本地checkpoint 文件还是可以保证一致性。
而如果使用checkpoint table,在databaserecover 的情况下也可以保证数据的一致性。 所以推荐也是使用checkpont。
Replicatmaintains checkpoints that provide a known position in the trail from which to startafter an expected or unexpected shutdown. To store a record of its checkpoints,Replicat uses a checkpoint table in the target database. This enables theReplicat checkpoint to be included within the Replicat transaction itself, toensure that a transaction will only be applied once, even if there is a failureof the Replicat process or the database process. Thecheckpoint table remains sm