GoldenGate单向复制配置(支持DDL复制)
在上一篇文件中的OGG单向复制配置不支持DLL的同步,只支持DML,因而本文在之前的基础上增加对DDL语句的复制,下面是简要配置过程记录!
一:验证之前的配置不支持DDL复制,这里在source端,新建一张表,发现无法复制到target端!target端也新建相同的表后,DML操作可以成功复制
- [root@db1 ~]# su - oracle
- [oracle@db1 ~]$ sqlplus hr/hr
- SQL> create table t2 (id number primary key,name varchar2(20));
- Table created.
- SQL> conn hr/hr@db2
- Connected.
- SQL> select tname from tab where tname='T2';
- no rows selected
- SQL> create table t2 (id number primary key,name varchar2(20));
- Table created.
- SQL> conn hr/hr
- Connected.
- SQL> insert into t2 values (1,'one');
- 1 row created.
- SQL> commit;
- Commit complete.
- SQL> conn hr/hr@db2
- Connected.
- SQL> select * from t2;
- ID NAME
- ---------- --------------------
- 1 one
二:开始配置OGG支持DDL复制(在source端操作)
1:赋予ogg用户相应的权限,修改全局配置文件添加ggschema参数
- SQL> conn /as sysdba
- Connected.
- SQL> grant execute on utl_file to ogg;
- Grant succeeded.
- [oracle@db1 ~]$ cd $GGATE
- [oracle@db1 ogg]$ ggsci
- GGSCI (db1) 1> edit param ./GLOBALS
- GGSCI (db1) 2> view param ./GLOBALS
- ggschema ogg
2:运行相关的sql脚本
- [oracle@db1 ~]$ cd $GGATE
- [oracle@db1 ogg]$ sqlplus /nolog
- SQL> conn /as sysdba
- Connected.
- 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:ogg
- Marker setup table script complete, running verification script...
- Please enter the name of a schema for the GoldenGate database objects:
- Setting schema name to OGG
- MARKER TABLE
- -------------------------------
- OK
- MARKER SEQUENCE
- -------------------------------
- OK
- Script complete.
- SQL> show parameter recyclebin;
- NAME TYPE VALUE
- ------------------------------------ ----------- ------------------------------
- recyclebin string on
- SQL> alter system set recyclebin=off;
- System altered.
- SQL> show parameter recyclebin;
- NAME TYPE VALUE
- ------------------------------------ ----------- ------------------------------
- recyclebin string OFF
- SQL> @ddl_setup.sql
- 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:ogg
- 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 OGG as a Oracle GoldenGate schema name.
- Working, please wait ...
- RECYCLEBIN must be empty.
- This installation will purge RECYCLEBIN for all users.
- To proceed, enter yes. To stop installation, enter no.
- Enter yes or no:yes
- ————————其他输出省略————————
- STATUS OF DDL REPLICATION
- ---------------------------------------------------------------------------------------
- SUCCESSFUL installation of DDL Replication software components
- Script complete.
- SQL> @role_setup.sql
- 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:ogg
- 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 <loggedUser>
- where <loggedUser> is the user assigned to the GoldenGate processes.
- SQL> grant ggs_ggsuser_role to ogg;
- Grant succeeded.
- SQL> @ddl_enable.sql
- Trigger altered.
- SQL> @?/rdbms/admin/dbmspool.sql
- Package created.
- Grant succeeded.
- View created.
- Package body created.
- SQL> @ddl_pin.sql ogg
- PL/SQL procedure successfully completed.
- PL/SQL procedure successfully completed.
- PL/SQL procedure successfully completed.
3:source端修改extract进程的params文件,添加"ddl include all"参数,重启extract进程
- GGSCI (db1) 1> view params eora_t1
- extract eora_t1
- setenv (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
- ddl include all
- userid ogg,password ogg
- exttrail ./dirdat/aa
- table hr.*;
- GGSCI (db1) 2> stop extract eora_t1
- Sending STOP request to EXTRACT EORA_T1 ...
- Request processed.
- GGSCI (db1) 3> start extract eora_t1
- Sending START request to MANAGER ...
- EXTRACT EORA_T1 starting
- GGSCI (db1) 4> info extract eora_t1
- EXTRACT EORA_T1 Last Started 2012-06-20 15:42 Status RUNNING
- Checkpoint Lag 00:00:00 (updated 00:00:10 ago)
- Log Read Checkpoint Oracle Redo Logs
- 2012-06-20 15:42:58 Seqno 3, RBA 50044416
- SCN 0.567478 (567478)
4:target端修改replicat进程的params文件,添加"ddl include all"和"ddlerror default ignore retryop maxretries 3 retrydelay 5" 参数,重启replicat进程
- [root@db2 ~]# su - oracle
- [oracle@db2 ~]$ cd $GGATE
- [oracle@db2 ogg]$ ggsci
- GGSCI (db2) 1> edit params rora_t1
- GGSCI (db2) 2> view params rora_t1
- replicat rora_t1
- setenv (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)
- ddl include all
- ddlerror default ignore retryop maxretries 3 retrydelay 5
- userid ogg,password ogg
- handlecollisions
- assumetargetdefs
- discardfile ./dirrpt/rora_t1.dsc,purge
- map hr.* ,target hr.*;
- GGSCI (db2) 3> stop replicat rora_t1
- Sending STOP request to REPLICAT RORA_T1 ...
- Request processed.
- GGSCI (db2) 4> start replicat rora_t1
- Sending START request to MANAGER ...
- REPLICAT RORA_T1 starting
- GGSCI (db2) 5> info replicat rora_t1
- REPLICAT RORA_T1 Last Started 2012-06-20 15:50 Status RUNNING
- Checkpoint Lag 00:00:00 (updated 00:00:00 ago)
- Log Read Checkpoint File ./dirdat/pa000000
- First Record RBA 4780973
三:测试
- [oracle@db1 ogg]$ sqlplus hr/hr
- SQL> alter table t2 add location varchar2(200);
- Table altered.
- SQL> conn hr/hr@db2
- Connected.
- SQL> desc t2
- Name Null? Type
- ----------------------------------------- -------- ----------------------------
- ID NOT NULL NUMBER
- NAME VARCHAR2(20)
- LOCATION VARCHAR2(200)
- SQL> conn hr/hr
- Connected.
- SQL> create table t3 as select object_id,object_name from dba_objects;
- Table created.
- SQL> conn hr/hr@db2
- Connected.
- SQL> select tname from tab where tname='T3';
- TNAME
- ------------------------------
- T3
- SQL> desc t3;
- Name Null? Type
- ----------------------------------------- -------- ----------------------------
- OBJECT_ID NUMBER
- OBJECT_NAME VARCHAR2(128)
本文转自斩月博客51CTO博客,原文链接http://blog.51cto.com/ylw6006/904373如需转载请自行联系原作者
ylw6006
GoldenGate单向复制配置(支持DDL复制)相关推荐
- 【OGG】OGG的单向复制配置-支持DDL(二)
[OGG]OGG的单向复制配置-支持DDL(二) 一.1 BLOG文档结构图 一.2 前言部分 一.2.1 导读 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的 ...
- goldengate ddl mysql_Oracle GoldenGate 12.2-异构环境的单项复制(支持DDL复制)
Oracle Golden gate 12版本已经很长世间了,对比前几个版本变化很大.在安装过程已经摈弃了原有命令行形式,采用了与Oracle DB以及weblogic一样的图形解决,在界面上可以选择 ...
- Goldengate DDL复制相关注意事项
Goldengate DDL复制相关注意事项 1.Goldengate DDL复制概述 a.Goldengate开启DDL复制后,不需要对原有的表和以后新加的表执行add trandata操作 这一点 ...
- 实战goldengate:安装配置+数据初始化+单向DML复制
1.安装软件 1.1 下载goldengate 1.2 设置ORACLE_HOME and ORACLE_SID等环境变量 确保安装的oracle实例设置了正确的ORACLE_HOME以及ORACLE ...
- Oracle Golden Gate 系列十一 -- 配置 GG DDL 同步 说明 与 示例
一.DDL 说明 1.1 说明 这部分的说明,在系列四和系列六中已经说明: Oracle Golden Gate 系列六 --11gR2 Ora2Ora 单向复制GG 示例 www.2cto.com/ ...
- apache配置支持php
apache配置支持php 首先安装php运行环境 php笔记 安装步骤 1.检查模块./bin/httpd.exe -M 2.windows添加PHP模块#下载PHP安装包https://windo ...
- DTS增量/同步支持DDL迁移的说明
DTS目前并不支持所有数据库类型时间的DDL迁移,特别是异构数据库之间的迁移.不得不承认DDL的迁移还是非常复杂的,因为这涉及到DDL的解析(DDL的过滤)及转换(库表列映射及异构数据库),详情参考D ...
- python 打包 .app 运行 控制台窗口_Python打包工具PyInstaller的安装与pycharm配置支持PyInstaller详细方法...
windows系统下安装Pyinstaller cmd下输入指令 pip install PyInstaller Pyinstaller的使用 进入需要打包的目录下,执行打包命令 Pyinstalle ...
- Mac 配置支持 opengl 的 opencv 4.2
本教程教大家如何在Mac环境下对opencv源码进行编译,并开启opengl支持.因为配置过程及其艰辛,基本没有现成教程,希望记录下来能帮到有需要的人.其他系统的其实流程更简单 一.准备工作 open ...
最新文章
- Job for docker.service failed because the control process exited with error code. See systemctl sta
- MySQL中的共享锁与排他锁
- 解决System.Data.SqlClient.SqlException (0x80131904): Timeout 时间已到的问题
- ML之Clustering:关于Clustering进阶的那些不可告密的事
- asp.net中此页的状态信息无效,可能已损坏的解决之道
- [转载] C#面向对象设计模式纵横谈——10. Decorator装饰模式
- .NET6之MiniAPI(二十):实体验证FluentValidation
- Lambda运行时内部:窥视无服务器巢穴
- 2020年度JEECG开发者大赛,开发插件赚外块还能赢大奖!!
- Vnc-server——linux远程桌面配置
- Linux C基础笔记(1)
- Camtasia实用技巧之行为效果
- 软件设计师历年真题与解析(05-18 包括答案)
- PPT快速成长经验,我将其免费告诉你
- dede后台登陆提示 验证码不正确 解决办法
- win7浏览器主页修改不过来_Win7 IE无法修改默认主页怎么办?解决IE浏览器主页无法修改主页...
- win7保护眼睛的颜色设置方法
- mysql3306端口被占用无法终止_Mysql3306端口被占用无法启动解决办法
- 对成功的渴望和恐惧——谈心理学中的“瓦伦达效应”和“约拿情结”
- 谈B2B电商平台与大数据
热门文章
- BZOJ 1640: [Usaco2007 Nov]Best Cow Line 队列变换
- Oracle 怎么删除重复数据
- Rails Minitest style 指南
- windows10系统的电脑如何设置密码?
- 计算机辅助设计b实验目的,上海电力学院电路计算机辅助设计1--含有受控源电路辅助分析...
- C语言中声明复数用什么字母,用c语言定义复数-20210407134457.docx-原创力文档
- ubuntu安装ftp_如何在 Ubuntu 20.04 上安装 Webmin
- php date函数实现,PHP date() 函数可实现的功能列表
- mongoose mysql_mongoose入门
- python抓取html中特定的数据库,Python抓取网页中内容,正则分析后存入mysql数据库...