OGG How to Resync Tables / Schemas on Different SCN s in a Single Replicat

To resync one or more tables/schemas on different SCN‘s using a single or minimum number of replicats without using handlecollisions.

For example, when doing migrations and parallel exports are run.

This can be done with Oracle goldenGate (OGG) 11.1.1.0.x or higher.

Consider the following example with the schema HR and two tables TCUSTORD,
TCUSTMER

The syntax given below is for OGG v11.x.
Please see the NOTE at the end for OGG v12 and higher

1. Capture the SCN information in the extract trails using tokens

table hr.*, Tokens (tk-csn = @GETENV
("TRANSACTION", "CSN")) ;

Step 1 can be skipped if using OGG v11.1.1.1.x and it is needed if using OGG
v11.1.1.0.x

On OGG v11.1.1.1.x and higher the TOKEN is
not needed in the extract as the CSN/SCN is written

by default to the OGG trails

2. Do an SCN based export on source for the interested tables (first TCUSTMER,
then TCUSTORD in

our example)

exp hr/hr tables=hr.tcustmer grants=n statistics=none
triggers=n compress=n FLASHBACK_SCN=4746443

Then run another export on source for TCUSTORD at a different scn

exp hr/hr tables=hr.tcustord grants=n statistics=none
triggers=n compress=n FLASHBACK_SCN=4747033

3. Run the imports on target

4. Add the replicat on target to the beginning of the extract trail

Example parameter file:

replicat r1

userid myogguser password xyz

assumetargetdefs

discardfile dirrpt\r1.dsc, purge

map hr.tcustmer, target myogguser.* , Filter ( @NUMSTR (@TOKEN
("TK-CSN")) > 4746443);

map hr.tcustord, target myogguser.* , Filter ( @NUMSTR (@TOKEN
("TK-CSN")) > 4747033);

This is used to resync one or more tables/ schemas of different SCN‘s in the
same replicat.

If not using tokens
in the extract on step 1 (OGG versions 11.1 and higher) then the equivalent

mapping to use the
default SCN token from the trail would be

map hr.tcustmer,
target myogguser.* , FILTER ( @GETENV ("TRANSACTION",
"CSN") > 4746443);

map hr.tcustord, target myogguser.* , FILTER ( @GETENV
("TRANSACTION", "CSN") > 4747033);

This example is for a DML only replication setup using OGG version
11.1.1.0.x or higher

NOTE: For OGGv12 the double quotes needs to be replaced
with single quotes since OGG v12 uses ANSI SQL parameter by default

时间: 2024-12-14 14:49:02

OGG How to Resync Tables / Schemas on Different SCN s in a Single Replicat的相关文章

OGG 问题

1.启动复制时报 "ERROR OGG-15050 Oracle GoldenGate Delivery, l***.prm: Error loading Java VM runtime library: (2 No such file or directory)." 设置环境变量LD_LIBRARY_PATH,然后重启mgr,再启动rhdfs.如果不重启mgr直接启动rhdfs,则会报这个错 2. 对主键的修改无法更新,但是通过在复制上加 ERROR 2016-07-30 14:47

Ogg: Sybase to Oracle个人

摘要: sybase版本:Sybase15(源端) Oracle版本:11g(目标端) Goldengate版本:11.2.0.1.0(源端),12c(目标端) 个人博客:www.czhiying.cn Goldengate同步原理: Oracle GoldenGate软件是一种基于日志的结构化数据复制备份软件,它通过解析源数据库在线日志或归档日志获得数据的增量变化,再将这些变化应用到目标数据库,从而实现源数据库与目标数据库同步.参考图如下: 从上图可以知道,Ogg的同步实现方式有两种: 在源端

OGG ORA-1403 NO DATA FOUND

近期开始做OGG的项目,测试过程中遇到一个问题.使用CTAS创建一张表,表中有数据,然后使用delete from xxx:删除表之后,replicat进程异常.查看ogg日志,查看官网找到原因. 官方文档号 How to Capture the DML(s) Executed by a DDL Trigger (OGG) (文档 ID 1509900.1) 解决方案 SOLUTION By design, Extract (Classic/ Integrated) doesn't captur

Oracle数据泵的使用

几乎所有DBA都熟悉oracle的导出和导入实用程序,它们将数据装载进或卸载出数据库,在oracle  database 10g和11g中,你必须使用更通用更强大的数据泵导出和导入(Data Pump Export and Import)实用程序导出和导入数据. 以前的导出和导入实用程序在oracle database 11g中仍然可以使用,但是Oracle强烈建议使用数据泵(Data Pump)技术,因为它提供了更多的高级特性.例如,你可以中断导出/导入作业,然后恢复它们:可以重新启动已失败的

Oracle Data Pump 导出和导入数据

Data pump export/import(hereinafter referred to as Export/Import for ease of reading)是一种将元数据和数据导出到系统文件集/从系统文件集导入数据的服务端工具;导出的文件可以移动到其它服务器上,但只能使用impdp导入;使用前要先建立目录(directory)和授权: conn / as sysdba CREATE DIRECTORY PUMP_DIR AS '/u01/backup'; 创建后即可查询出目录信息,

Oracle11g中数据的倒库和入库操作以及高版本数据导入低版本数据可能引发的问题

1.前言 在10g之前,传统的导出和导入分别使用EXP工具和IMP工具,从10g开始,不仅保留了原有的EXP和IMP工具,还提供了数据泵导出导入工具EXPDP和IMPDP.所以在11G的倒库和入库方式中,我们也有两种方式可以选择:传统模式和数据泵模式. 传统模式又分为:常规导入导出和直接导入导出. 下面以导出数据为例,分别介绍各自导出原理. 1.1简述各导入导出方式的原理 1.1.1常规导出原理 传统路径模式使用SQL SELECT语句抽取表数据.数据从磁盘读入到buffer cache缓冲区中

Oracle数据泵(Data Pump)

前言:努力的人最后一定不会太差!!关注博客或者加Q:1445696451一起努力!~~~~~~~~分割~~~~~~~~~一.简介1.逻辑备份:是创建数据库对象的逻辑副本,并存入一个二进制转储文件的过程.逻辑备份和逻辑恢复从本质上来讲,就是数据的导出和导入.2.数据泵:是一中在数据库之间或者在数据库域操作系统之间高速传输数据的技术.可以把比作水流,那么数据泵就像水泵一样,可以将数据抽取出来存到其他的位置.数据泵工具运行与服务器之上,数据库管理员需要指定数据库操作目录用来保存这些转储的二进制数据.二

linux网络管理三剑客

将Linux主机接入到网络中能够使用的条件: 1.IP/NETMASK:本地通信 2.路由(网关):跨网络通信 3.DNS服务器地址:基于主机名的通信----域名解析 主DNS服务器地址 备用DNS服务器地址 第三备份DNS服务器地址 配置方式:----配置在内核上 1.静态指定:---立即生效 a.命令: ifcfg家族: ifconfig:配置IP,NETMASK route:路由 netstat:网络状态及统计数据查看 iproute2家族: ip OBJECT: addr:地址和掩码:

Goldengate抽取ORACLE 数据 到 Hbase

1.        软件版本说明: Goldengate 12c  12.2.0.1 forOracle (源端 ) Goldengate 12c  12.2.0.1  for Bigdata ( 目标端) Oracle 11g 11.2.0.4.0 (注oracle 数据库必须是11.2.0.4之后的版本,之前的oracle 数据库版本不支持ogg 12c ) HBase 1.1.2 Java 1.8.0_91 2.        机器IP 说明 源端IP地址(192.168.45.176)安