oracle GoldenGate系列:(三)DDL的同步

GoldenGate的DDL复制概述
GoldenGate目前只支持oracle和teradata的ddl复制。
有两种配置方法
1.基于trigger的DDL
2.Native DLL
ps:Native DLL方式要求通过logmining Server进行日志解析 – ogg12c+integrated extract+db11204及以上

基于trigger的DDL同步原理:
与DML同步不同,DDL复制并不是简单得读取日志文件,然后生成trail文件进行传输。而是通过触发器的方式实现的。
当一条DML语句执行后,会触发该触发器,触发器会让oracle将所执行的DML语句和其他一些记录写到ogg的用户的表下。 
然后ogg进程再从该这些表中获取该语句写到trail文件中,再进行传输。。


一、源端配置
[oracle@linfan ~]$ cd /oracle/ggs -------一定要进入ogg的目录下
[oracle@linfan ggs]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Mon Oct 17 18:13:21 2016

Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


SQL> @marker_setup.sql;  


Marker setup script


You will be prompted for the name of a schema for the Oracle GoldenGate database objects.
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.


Enter Oracle GoldenGate schema name:gg


Marker setup table script complete, running verification script...
Please enter the name of a schema for the GoldenGate database objects:
Setting schema name to GG


MARKER TABLE
-------------------------------
OK


MARKER SEQUENCE
-------------------------------
OK


Script complete.
SQL>  alter system set recyclebin=off scope=spfile;


System altered.


SQL> startup force;
ORACLE instance started.


Total System Global Area  828608512 bytes
Fixed Size                  1348104 bytes
Variable Size             553651704 bytes
Database Buffers          268435456 bytes
Redo Buffers                5173248 bytes
Database mounted.
Database opened.
SQL> @ddl_setup


Oracle GoldenGate DDL Replication setup script


Verifying that current user has privileges to install DDL Replication...

You will be prompted for the name of a schema for the Oracle GoldenGate database objects.
NOTE: For an Oracle 10g source, the system recycle bin must be disabled. For Oracle 11g and later, it can be enabled.
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.


Enter Oracle GoldenGate schema name:gg


Working, please wait ...
Spooling to file ddl_setup_spool.txt


Checking for sessions that are holding locks on Oracle Golden Gate metadata tables ...


Check complete.


Using GG as a Oracle GoldenGate schema name.


Working, please wait ...


DDL replication setup script complete, running verification script...
Please enter the name of a schema for the GoldenGate database objects:
Setting schema name to GG


CLEAR_TRACE STATUS:


Line/pos             Error
-------------------- -----------------------------------------------------------------
No errors            No errors


CREATE_TRACE STATUS:


Line/pos             Error
-------------------- -----------------------------------------------------------------
No errors            No errors


TRACE_PUT_LINE STATUS:


Line/pos             Error
-------------------- -----------------------------------------------------------------
No errors            No errors


INITIAL_SETUP STATUS:


Line/pos             Error
-------------------- -----------------------------------------------------------------
No errors            No errors


DDLVERSIONSPECIFIC PACKAGE STATUS:


Line/pos             Error
-------------------- -----------------------------------------------------------------
No errors            No errors


DDLREPLICATION PACKAGE STATUS:


Line/pos             Error
-------------------- -----------------------------------------------------------------
No errors            No errors


DDLREPLICATION PACKAGE BODY STATUS:


Line/pos             Error
-------------------- -----------------------------------------------------------------
No errors            No errors


DDL IGNORE TABLE
-----------------------------------
OK


DDL IGNORE LOG TABLE
-----------------------------------
OK


DDLAUX  PACKAGE STATUS:


Line/pos             Error
-------------------- -----------------------------------------------------------------
No errors            No errors


DDLAUX PACKAGE BODY STATUS:


Line/pos             Error
-------------------- -----------------------------------------------------------------
No errors            No errors


SYS.DDLCTXINFO  PACKAGE STATUS:


Line/pos             Error
-------------------- -----------------------------------------------------------------
No errors            No errors


SYS.DDLCTXINFO  PACKAGE BODY STATUS:


Line/pos             Error
-------------------- -----------------------------------------------------------------
No errors            No errors


DDL HISTORY TABLE
-----------------------------------
OK


DDL HISTORY TABLE(1)
-----------------------------------
OK


DDL DUMP TABLES
-----------------------------------
OK


DDL DUMP COLUMNS
-----------------------------------
OK


DDL DUMP LOG GROUPS
-----------------------------------
OK


DDL DUMP PARTITIONS
-----------------------------------
OK


DDL DUMP PRIMARY KEYS
-----------------------------------
OK


DDL SEQUENCE
-----------------------------------
OK


GGS_TEMP_COLS
-----------------------------------
OK


GGS_TEMP_UK
-----------------------------------
OK


DDL TRIGGER CODE STATUS:


Line/pos             Error
-------------------- -----------------------------------------------------------------
No errors            No errors


DDL TRIGGER INSTALL STATUS
-----------------------------------
OK


DDL TRIGGER RUNNING STATUS
----------------------------------------------------------------------
ENABLED


STAYMETADATA IN TRIGGER
----------------------------------------------------------------------
OFF


DDL TRIGGER SQL TRACING
----------------------------------------------------------------------
0


DDL TRIGGER TRACE LEVEL
----------------------------------------------------------------------
0


LOCATION OF DDL TRACE FILE
------------------------------------------------------------------------------------------------------------------------
/u01/app/oracle/diag/rdbms/orcl/orcl/trace/ggs_ddl_trace.log

Analyzing installation status...

STATUS OF DDL REPLICATION
------------------------------------------------------------------------------------------------------------------------
SUCCESSFUL installation of DDL Replication software components


Script complete.
SQL> @role_setup


GGS Role setup script


This script will drop and recreate the role GGS_GGSUSER_ROLE
To use a different role name, quit this script and then edit the params.sql script to change the gg_role parameter to the preferred name. (Do not run the script.)


You will be prompted for the name of a schema for the GoldenGate database objects.
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.

Enter GoldenGate schema name:gg
Wrote file role_setup_set.txt

PL/SQL procedure successfully completed.

Role setup script complete

Grant this role to each user assigned to the Extract, GGSCI, and Manager processes, by using the following SQL command:

GRANT GGS_GGSUSER_ROLE TO

where is the user assigned to the GoldenGate processes.
SQL>  grant GGS_GGSUSER_ROLE to gg;

Grant succeeded.
创建触发器
SQL> @ddl_enable

Trigger altered.

二、目标端:执行脚本(同上源端)
SQL>alter system set recyclebin=off scope=spfile;   --关闭回收站
SQL>startup force;         --重启数据库
SQL>@marker_setup
SQL>@ddl_setup
SQL>@role_setup
SQL>grant GGS_GGSUSER_ROLE to gg;
SQL>@ddl_enable

三、进程配置
GGSCI (linfan) 11> edit param capdb1


EXTRACT capdb1
SETENV (ORACLE_HOME = "/u01/app/oracle/product/11.2.0/db_1")
SETENV (ORACLE_SID = orcl)
USERID gg, PASSWORD gg
EXTTRAIL /oracle/ggs/dirdat/lt
ddl include all
ddloptions addtrandata,report
TABLE scott.*;

GGSCI (linfan2) 10> edit param repdb2
REPLICAT repdb2
SETENV (ORACLE_HOME = "/u01/app/oracle/product/11.2.0/db_1")
SETENV (ORACLE_SID = orcl)
ASSUMETARGETDEFS
USERID gg, PASSWORD gg
DDL INCLUDE ALL
DDLERROR DEFAULT IGNORE RETRYOP MAXRETRIES 3 RETRYDELAY 5
DDLERROR DEFAULT DISCARD
DDLERROR DEFAULT IGNORE RETRYOP
MAP scott.*, TARGET scott.*;
 

四、启动进程
启动目标端的Replicat进程
GGSCI (linfan2) 6> START repdb2
启动源端的pumpdb12进程.
GGSCI (linfan) 6> START pumpdb12
EXTRACT PUMPDB12 starting
启动源端的capdb1进程
GGSCI (linfan) 19> START capdb1
Sending START request to MANAGER ...
EXTRACT CAPDB1 starting

五、建表测试
源端建表
SQL> create table laha as select * from dept;

Table created.
目标端查看
SQL> select count(*) from laha;


  COUNT(*)
----------
        13


1 row selected.
目标表自动建了表,并插入语句,实验成功

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31386161/viewspace-2127100/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/31386161/viewspace-2127100/

GoldenGate复制3:异构跨平台跨版本支持DDL的oracle复制 GoldenGate复制3:异构跨平台跨版本支持DDL的oracle复制   一.说明: 1.    本次要完成的OGG复制的特点 1)      异构平台:linux到windows 2)      跨版本:11.2.0.1到10.2.01 3)      支持DDL 4)      同数据:oracle到oracle 5)      不同字符集 6)      不同的sche 阅读详情

相关推荐

Windows非分页缓冲池内存泄漏实战:PoolMon与RAMMap高效排查指南

本文详细介绍了Windows系统中非分页缓冲池内存泄漏的实战排查方法。当系统出现卡顿且内存占用异常增长时,通过RAMMap工具快速定位非分页缓冲池异常,并利用PoolMon监控内核内存分配标签,精准锁定泄漏源。文章提供了从确认症状、安装工具到使用findstr命令溯源驱动文件的完整五步排查流程,并总结了常见泄漏标签与解决方案,帮助用户高效解决深层系统内存问题。

weixin_28455801的博客 1008

OGG-00495 DDL error ignored for next retry: error code [DEFAULT], filter [include all (default)], e

我的OGG数据同步是采用的DML和DDL同步,今天在目的端发现replicat进程异常关闭,查看进程日志:发现报如下错误: OGG-00495 DDL error ignored for next retry: error code [DEFAULT], filter [include all (default )], error text [Error code [955], ORA-0095...

wushiqi11的博客 922

ArcMap实战:用栅格计算器搞定16年NDVI趋势分析,附完整F检验流程

本文详细介绍了如何使用ArcMap的栅格计算器进行16年NDVI趋势分析,包括数据预处理、线性趋势计算和F显著性检验的全流程操作。通过实际案例和统计原理解析,帮助GIS从业者掌握植被覆盖变化的分析方法,特别适合生态评估和农业监测应用。

weixin_29251567的博客 252

GoldenGate配置(三)之DDL复制配置

GoldenGate配置(三)之DDL复制配置 【说明】 此篇续接上一篇:“GoldenGate配置(二)之双向复制配置”点击打开链接 环境: Item Source System Target System Platform Red Hat Enterprise Linux Server r

深蓝@黄炎龙 3102

Dell Precision 7920 Tower开机点不亮?别慌,看电源灯闪烁密码快速定位故障(附BIOS恢复指南)

本文详细解析了Dell Precision 7920 Tower工作站开机点不亮时的电源灯闪烁密码,帮助用户快速定位故障。从内存问题到BIOS恢复,再到CPU配置错误,提供了全面的诊断和修复指南,并附有实用的维护建议和工具推荐。

weixin_30892037的博客 482

C# 进程间 双内存共享 高帧率图像传输

演示了两个进程之间通过 双内存共享 的方式, 来实时处理图像,并以高帧率(40~60FPS)传输的基本示例。 进程间内存共享的优点:高性能、低延迟、资源效率高、简单可靠。 适用场景:实时图像处理、大数据传输、多进程协作、实时监控系统,等等。

qianqiansd 1996

Linux/Centos6.5 Orace 11g R2 ogg 单向同步配置过程

文中涉及的安装包以及任何问题请加下方二维码免费获取提问 1.环境准备 源Oracle:11g R2 64位 ip:192.168.40.66 操作系统:Centos6.5 64位 目标Oracle:11g R2 64位 ip:192.168.40.67操作系统:Centos6.5 64位 2.下载OGG软件并解压安装 源服务器 # mkdir -p /u01/app/oracle/o...

刘耀龙的博客 1083

ZYNQ RFSoC 的DAC如何做到从 0到Fs频段 信号输出

之前一直没太了解 RFSoC 的DAC如何输出在 Fs/2 到 Fs 频率范围内的信号,例如 ZCU216中的 ZU49DR,其RF-DAC最大采样率是 9.85GSPS,如果想输出的信号中心频率在5.8G,它是如何有效输出在第二奈奎斯特区域范围的信号的。

weixin_44630490的博客 1551

Oracle Golden Gate 系列十一 -- 配置 GG DDL 同步 说明 与 示例

一.DDL 说明 1.1 说明 这部分的说明,在系列四和系列六中已经说明: Oracle Golden Gate 系列六 --11gR2 Ora2Ora 单向复制GG 示例 http://blog.youkuaiyun.com/tianlesoftware/article/details/6950018 Oracle Golden Gate 系列四--GG 安装 与 卸载 理论知识 http://blog...

数据库天地 375

【DRAM存储器二】Sense Amplifier

详述DRAM颗粒中感应放大器功能、电路结构、工作原理和操作波形

highman110的博客 7196

研制过程评审活动(三)工程研制阶段

工程研制阶段主要任务、及评审活动

Abel的博客 2387

Oracle Golden Gate 搭建

Oracle Golden Gate 搭建 参考:《Oracle Golden Gate 知识点总结》 1、安装数据库 oracle 12c 源库    prod     192.168.10.20 目标库  standby  192.168.10.30 2、下载OGG,解压,安装12版本至/u01/ogg目录

weixingjunzhe的博客 2538

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

OGG(oracle goldengate)实现oracle到oracle数据DDL同步

注:本篇文章是在已经配置过DML同步或者源端数据库已经开启归档、添加了附加日志等基础上记录的,如未设置,请参考另外一篇:https://blog.youkuaiyun.com/weixin_41229271/article/details/101196319 然后再进行下面的步骤。 源端在ogg安装目录下登陆数据库 SQL> @marker_setup.sql Marker setup scr...

weixin_41229271的博客 1584

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

【大数据实时数据同步】超级详细的生产环境OGG(GoldenGate)12.2实时异构同步Oracle数据部署方案(中)

本章介绍如何配置xagent远程GUI安装ogg,也可以用来当作xagent远程调用GUI的学习资料,之前写过一系列关于GoldenGate异构同步Mysql、Kafka、Kylin、Flink做实时计算的场景文章。下面是我给大家的生产环境下,如何部署GoldenGate及异构实时同步数据的解决方案。本文主要介绍如何实现实时异构的进行Oracle->Oracle的数据同步,这种数据同步适用于灾备、升级、实时ODS等场景使用。我这里给大家了三个GoldenGate部署方式,看大家喜欢用哪种吧!

赵延东的一亩三分地 5万+

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

oracle goldengate from mongodb to oracle的实时同步

近期因公司项目需要,需要将mongodb数据同步到oracle数据库,由于第一次接触到mongodb数据库同步到Oracle的项目,故没有主动获取数据,而且让对方工程师把mongodb数据同步到我方的mongodb数据库,为此新建了一个mongodb数据库。我方工程师把mongodb数据库同步到doris数据仓库。考虑到oracle goldengate功能的强大,为此考虑使用ogg实现 mongodb 到oracle的实时同步。后续将继续进行测试环境的验证,保持持续关注中。

Mrzhou的博客 1167

oracle goldengate 触发器,Goldengate开启DDL操作

Goldengate开启DDL操作以下操作在源端、目标端都要执行安装DDL相关对象时,建议退出所有应用程序,并防止数据库有新的连接,否则可能导致操作失败。安装支持DDL同步对象,可通过下述命令实现:1.赋予GoldenGate用户utl_file执行权限grant execute on utl_file to goldengate;2.最好断开所有数据库连接、停止监听3.以SYS用户执行D...

weixin_39815879的博客 592

oracle goldengate集成模式实现ddl复制

在oracle goldengate 11.2版本中,推出了一种新的抽取模式-integrated mode 集成模式相对于传统的抽取模式具有速度快,支持类型更多等优点,官网列出有点如下: 1,Because integrated capture is fully integrated with the database, no additional setup...

tpc4289的专栏 2420

GOLDENGATE安装配置与复制流搭建_DG端抽取支持DDL版

GOLDENGATE安装配置与复制流搭建_DG端抽取支持DDL版

IT圈黎俊杰 2450

Oracle GoldenGate 之 MySQL -> MySQL DDL 同步(win10)

OGG DML 安装配置请参考:在Windows中 基于Oracle GoldenGate (OGG)进行MySQL->MySQL数据库同步配置(超详细) 下列操作默认已配置 OGG DML Oracle GoldenGate Windows平台MySQL->MySQL DDL同步,试验环境: 试验环境 源端软件版本 目标端软件版本 操作系统 Windows 10 64...

qq_42186233的博客 930

OGG_GoldenGate数据库配置DDL同步(案例)

本文转自:https://www.cnblogs.com/eastsea/p/4232300.html 一、摘要 1. 不支持和有限支持的DDL类型 (1). Oracle数据库保留的Schema,GoldenGate是不支持的,如SYS、SYSTEM、PUBLIC等等 (2). GoldenGate10g DDL不支持Oracle回收站功能 (3). GoldenGate支持不超高2M...

代码君的博客 1887

Oracle GoldenGate 之 Oracle 取消DDL功能

1、打开cmd.exe,进入GoldenGate安装目录,运行ggsci.exe C:\windows\system32>d: D:\>cd D:\OGG\oggoracle D:\OGG\oggoracle>ggsci.exe 2、关闭运行中的进程 GGSCI (DESKTOP-LDTMM0I) 1> info all Program Status G...

qq_42186233的博客 1498

oracle 单向同步 方案,GoldenGate 实现Oracle for Oracle 单向DDL操作同步

我们做如下测试在源端执行表的truncateSQL> truncate table tcustmer;Table truncated.在目的端,查看表数据SQL> select count(*) from tcustmer;COUNT(*)----------2数据并没有同步我们如何让Goldengate实现DDL操作的同步呢?要想支持DDL同步,需要在源数据库上做些设置,使得可以跟踪...

weixin_39827905的博客 237

Oracle GoldenGate 19C双向DML\DDL配置实战

全局文件 GLOBALS 要大写,必须放在 Golden Gate 根目彔下,否则其会默认将配置文件创建在 Golden Gate 根目彔下的 dirprm 子目彔中,在全局文件中添加 GGSCHEMA参数,这个 ggschema 就是要抽取的数据库schema。SQL> @marker_setup.sql 说明: 一定要在$OGG_HOME目录下执行否则会卡主。5、trail文件是gg自己抓捕信息的文件,是一个OS文件,存放在./dirdat/下,以X00000命名,N顺序1,2,3…

zll4859291的博客 1331

配置 OGG DDL 同步 说明 与 示例

原文连接 http://blog.youkuaiyun.com/tianlesoftware/article/details/6981358 一.DDL 说明 1.1 说明 这部分的说明,在系列四和系列六中已经说明: Oracle Golden Gate 系列六 --11gR2 Ora2Ora 单向复制GG 示例 http://blog.youkuaiyun.com/tianlesoftware/article/details/6950018 Oracle Golden Gate 系列四--GG 安...

yanghuadong的博客 4339

oracle tran 配置,【GoldenGate】Oracle GoldenGate(三) DDL同步配置

SYS@ prod>alter system set recyclebin='off' scope=both;SYS@ prod>show parameter recyclebinNAME TYPE VALUE----------------------------------------------- --...

weixin_39588679的博客 204
上一篇: oracle GoldenGate系列:(二)有关ogg下的触发器
下一篇: oracle之手工建库和删库
cuiji5713
博客等级 码龄11年 5粉丝 0原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值