Oracle Golden Gate 系列十三 -- 配置GG进程检查点(checkpoint) 说明

 

一.Checkpoints 理论说明

有关GG的Checkpoints 在系列一, GG的架构中以说明:

OracleGolden Gate 系列一 --GG 架构 说明

http://blog.csdn.net/tianlesoftware/article/details/6925907

 

这里在单独拿出来说明一下,因为这是一个较为重要的概念。

 

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 small because rows are deleted when no longer needed, andit does not affect database performance.

--Checkpoint 保留了很少的记录,对于哪些很长时间内不需要的的数据会自动删除,所以checkpoint 不会对数据库造成性能上的影响。

 

 

GoldenGate的检查点信息有两种存放方式:

1.     存放在GGHOME\dirchk下的文件中。

这种是默认的方法,一个进程对应一个文件。提取进程可以只使用这种模式。不需要checkpoint table。 但是这种方式在db recovery 之后可能出现数据不一致。

 

gg2:/u01/backup> cd /u01/ggate/dirchk

gg2:/u01/ggate/dirchk> ls

REP1.cpr  REPT2.cpr

 

2.     存放在数据库指定的表中,需要单独配置。

 

配置步骤如下:

(1)在./GLOBALS文件里添加checkpoint 表名

CHECKPOINTTABLE [<owner>.<table>]   --指定的检查点记录表

(2)连上DB,创建checkpoint 表

GGSCI> DBLOGIN [SOURCEDB <dsn>][,USERID <db_user>[, PASSWORD <pw>]]

GGSCI> ADD CHECKPOINTTABLE [<owner>.<table>]   --生成这个检查点记录表

(3)在新增复制进程时可以在添加时指定checkpointtable[<owner>.<table>] 替代nodbcheckpoint,使用数据库记录检查点信息。

 

二.示例

2.1   配置./GLOBALS 参数

GGSCI (gg2) 65> view params ./GLOBALS

 

GGSCHEMA ggate

CHECKPOINTTABLE ggate.checkpoint

 

当我们在GLOBALS 文件里指定了默认的checkpoint 之后,新的Replicat groups 在创建时会自动使用这个参数,不需要其他指令。

 

2.2 连上数据库,创建checkpoint表

 

GGSCI (gg2) 58> dblogin useridggate@gg2,password ggate

Successfully logged into database.

 

GGSCI (gg2) 59> add checkpointtableggate.checkpoint

Successfully created checkpoint tableGGATE.CHECKPOINT.

 

2.3 在创建Replicat进程时,指定checkpoint 表

GGSCI (gg2) 14> add replicatrep1,exttrail /u01/ggate/dirdat/lt, checkpointtable ggate.checkpoint

REPLICAT added.

 

至此,Checkpoint 的配置就完成。 我们查看一下checkpoint 表。

 

SQL> conn ggate/ggate

deConnected.

SQL> desc checkpoint

 Name                                     Null?    Type

 ------------------------------------------------- ----------------------------

 GROUP_NAME                                NOT NULLVARCHAR2(8)

 GROUP_KEY                                 NOT NULLNUMBER(19)

 SEQNO                                             NUMBER(10)

 RBA                                       NOT NULLNUMBER(19)

 AUDIT_TS                                          VARCHAR2(29)

 CREATE_TS                                 NOT NULL DATE

 LAST_UPDATE_TS                            NOT NULL DATE

 CURRENT_DIR                               NOT NULLVARCHAR2(255)

 

SQL> select * from checkpoint;

 

GROUP_NA GROUP_KEY      SEQNO        RBA AUDIT_TS                      CREATE_TS    LAST_UPDATE_ CURRENT_DIR

-------- ---------- ---------- --------------------------------------- ------------ ------------ ----------------------

REP1    3987940558         12       1564 2011-11-17 17:21:55.471376    17-NOV-11   17-NOV-11    /u01/ggate

 

 

 

 

 

 

-------------------------------------------------------------------------------------------------------

版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!

Blog:     http://blog.csdn.net/tianlesoftware

Weibo: http://weibo.com/tianlesoftware

Email:   tianlesoftware@gmail.com

Skype: tianlesoftware

 

-------加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请----

DBA1 群:62697716(满);   DBA2 群:62697977(满)  DBA3 群:62697850(满)  

DBA 超级群:63306533(满);  DBA4 群:83829929(满) DBA5群: 142216823(满) 

DBA6 群:158654907(满)   DBA7 群:69087192(满)  DBA8 群:172855474

DBA 超级群2:151508914  DBA9群:102954821     聊天 群:40132017(满)

转载于:https://www.cnblogs.com/zlja/archive/2011/11/17/2449537.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/361852.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

开始JBoss BPM流程的3种基本方法

这一集提示和技巧将帮助您了解根据需要启动流程实例的最佳方法。 规划项目可能包括流程项目&#xff0c;但是您是否考虑过可以启动流程的各种方式&#xff1f; 也许您的JBoss BPM Suite在您的体系结构中本地运行&#xff0c;也许您在云中运行&#xff0c;但是无论它在哪里&am…

用asp.net编写冒泡排序法

这里写了一个冒泡排序的函数. int[] a newint[10] { 12,564,95,44,69,499,693,6746,6496,124}; for(inti0;i<a.Length;i) for(intj i1; j <10; j) { int min a[i]; if (a[i] > a[j]) //升序排列 …

使用Gradle构建和应用AST转换

最近&#xff0c;我想在Gradle项目中构建并应用本地ast转换。 虽然我可以找到一些有关如何编写转换的示例&#xff0c;但找不到完整的示例来显示完整的构建过程。 转换必须单独编译&#xff0c;然后放在类路径中&#xff0c;因此其源代码不能简单地放在Groovy源代码树的其余部分…

7月17日每日一答

1 什么是闭包函数&#xff0c;闭包函数满足什么样的条件&#xff1f;请写一个常见的闭包函数。 所谓的函数闭包本质是函数的嵌套和高阶函数。我们来看看要实现函数闭包要满足什么条件&#xff08;缺一不可&#xff09;&#xff1a; 1)必须嵌套函数 2)内嵌函数必须引用一个定义在…

vi 常用命令

一、vi简介 vi编辑器是所有Unix及Linux系统下标准的编辑器&#xff0c;它的强大不逊色于任何最新的文本编辑器&#xff0c;这里只是简单地 介绍一下它的用法和一小部分指令。由于对Unix及Linux系统的任何版本&#xff0c;vi编辑器是完全相同的&#xff0c;因此您可以在其 他…

Servlet基础(一)

JavaEE&#xff1a;企业级开发技术<一.基础概念>j2ee:jdk1.1--1.4 ----->> j2ee1.1 1.2 javaee:jdk--5,6,7 --->>javaee 5,6,7javaee与servlet,jsp Servlet:前后台传递数据&#xff0c;基于网络的HTTP请求的处理 实现需要借助web容器 J…

BZOJ1706奶牛接力跑

这个东西思路还是不错的。 解法就是把矩阵幂的加法改成取min&#xff0c;乘法改成加法就好&#xff0c;和floyed是一样的。这样的话&#xff0c;矩阵操作一次就相当于松弛了一次最短路。 建矩阵的过程也比较简单&#xff0c;可以离散化&#xff0c;当然下面有另一种更优秀的打法…

EJB 3.x:生命周期和并发模型(第2部分)

这是两部分系列的第二篇。 第一部分介绍了有状态和无状态EJB的生命周期以及并发行为。 在这篇文章中&#xff0c;我将介绍Singleton EJB 。 Singleton模式可以说是最常用&#xff08;有时被滥用&#xff01;&#xff09;的模式。 单吨又爱它&#xff01; Java EE使我们无需编…

MVC2中Area的路由注册实现

今天碰到了一个不可思议的bug&#xff0c;新增的controller中任何action都无法访问&#xff0c;都是返回404错误。一般这种错误要么是拼写错误&#xff0c;要么是不小心给action加了post属性&#xff0c;但是经过初步的排查&#xff0c;没有发现问题。而原有的controller中任何…

当Java 8 Streams API不够用时

Java 8与往常一样是妥协和向后兼容的版本。 JSR-335专家组可能无法与某些读者就某些功能的范围或可行性达成一致的发行版。 请参阅Brian Goetz关于为什么…的一些具体解释。 …Java 8默认方法中不允许“最终” …Java 8默认方法中不允许“同步” 但是今天&#xff0c;我们将…

Servlet - cookie、session、servletContext概述

1、cookie 在客户端的小纸条&#xff0c;存储在客户端一个servlet/jsp设置的cookies能被同一路径下面或者子路径下面的servlet/jsp读到&#xff0c;但子路径设置的cookies父路径读不到.添加cookie的方法&#xff1a; Cookie cookie new Cookie("aaa", "bbb&quo…

父类作为方法的形参以及父类作为方法返回值

1、父类作为方法的形参 语句&#xff1a;修饰符 父类类型 方法名(){} 2、父类作为方法返回值 语句&#xff1a;修饰符 void/返回值类型 方法名(父类类型 形参名){} 代码例子&#xff1a; 动物类&#xff1a; /*** author Mr.Wang* 宠物类**/ public abstract class Animals {pr…

在Spring Boot中使用@ConfigurationProperties

在最近的博客文章中&#xff0c;我简短地介绍了如何在Spring Boot应用程序中配置邮件 。 要将属性注入配置中&#xff0c;我使用了Spring的Value注释。 但是Spring Boot提供了一种使用属性的替代方法&#xff0c;该方法允许强类型的Bean来管理和验证应用程序的配置。 在本文中&…

unexpected AST node

hql语句错误&#xff0c;一般是比较明显的错误&#xff0c;仔细检查一下hql。转载于:https://www.cnblogs.com/chanedi/archive/2011/11/28/2265855.html

在Atlas服务器端实现中推荐使用Web Service而不是Page Method

English Version: http://dflying.dflying.net/1/archive/107_prefer_web_services_to_page_methods_in_atlas_server_side_implementation.html 我们可以用两种方式把一个服务器段方法暴露给客户端Atlas调用&#xff1a;Web Service和Page Method。我推荐使用Web Service的方…

es6严格模式需要注意的地方

1.块级函数 "use strict";if (true) {function f() { } // 语法错误} es5中严格模式下禁止声明块级函数&#xff0c;而在es6的严格模式中可以声明块级函数&#xff0c;并可以在块级作用 use strictvar b true;if(b){function test(){console.log(我是块级函数)}test(…

简而言之,JUnit:另一个JUnit教程

为什么还要另一个JUnit教程&#xff1f; 对于Java世界中的开发人员而言&#xff0c; JUnit似乎是最受欢迎的测试工具 。 因此&#xff0c;难怪就此主题已经写了一些好书 。 但是我仍然经常遇到程序员&#xff0c;他们至多对这个工具及其正确用法都不太了解。 因此&#xff0c;…

APUE Chapter 1 - UNIX System Overview

Section 1.1. Introduction转载于:https://www.cnblogs.com/s7vens/archive/2011/11/29/2266984.html

md

# 1 常量和变量## 1.1 常量### 1.1.1 定义程序中固定不变化的值### 1.1.2 分类#### 1.1.2.1 字面值常量##### 1.1.2.1.1 整型常量- 二进制整数&#xff1a;以0B或0b开头&#xff0c;如&#xff1a;int a0B110; - 八进制整数&#xff1a;以0开头&#xff0c;如&#xff1a;int a…

使用Gradle消除开发重新部署

为了进行服务开发&#xff0c;我的团队最近从Grails转移到了Dropwizard框架。 但是&#xff0c;我真正从Grails堆栈中真正错过的一件事是自动重新加载&#xff1a;对源文件的任何更改都会在保存后立即显示在运行的应用程序中&#xff0c;而无需重新启动。 事实证明&#xff0c;…