版权声明:本文为博主原创文章,未经博主同意不得转载。 https://blog.csdn.net/huangyanlong/article/details/33430293

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

【说明】
此篇续接上一篇:“GoldenGate配置(二)之双向复制配置”点击打开链接

环境:

Item

Source System

Target System

Platform

Red Hat Enterprise

Linux Server release 5.4

Red Hat Enterprise

Linux Server release 5.4

Hostname

gc1

gc2

Database

Oracle 10.2.0.1

Oracle 11.2.0.1

Character Set

ZHS16GBK

ZHS16GBK

ORACLE_SID

PROD

EMREP

Listener Name/Port

LISTENER/1521

LISTENER/1521

Goldengate User

ogg

ogg

DDL复制配置

gc1:运行脚本(注意:要到/u01/app/ogg文件夹下运行。否则会被hang住。oracle的bug)

SQL>@marker_setup.sql;  --到/u01/app/ogg文件夹后登陆sqlplus运行

Marker setup script

 

You will be prompted for the name of a schema forthe GoldenGate database objects.

NOTE: The schema must be created prior to runningthis script.

NOTE: Stop all DDL replication before startingthis installation.

 

Enter GoldenGate schema name:ogg

 

Marker setup table script complete, runningverification script...

Please enter the name of a schema for theGoldenGate database objects:

Setting schema name to OGG

 

MARKER TABLE

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

OK

 

MARKER SEQUENCE

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

OK

 

Script complete.

SQL> alter system set recyclebin=off scope=spfile;  
 --关闭回收站

SQL> startup force;
                                --重新启动库

SQL> @ddl_setup

GoldenGateDDL Replication setup script

 

Verifyingthat current user has privileges to install DDL Replication...

 

You willbe prompted for the name of a schema for the GoldenGate database objects.

NOTE:The schema must be created prior to running this script.

NOTE: OnOracle 10g and up, system recycle bin must be disabled.

NOTE:Stop all DDL replication before starting this installation.

 

EnterGoldenGate schema name:ogg

 

You willbe prompted for the mode of installation.

Toinstall or reinstall DDL replication, enter INITIALSETUP

Toupgrade DDL replication, enter NORMAL

Entermode of installation:INITIALSETUP

 

Working,please wait ...

Spoolingto file ddl_setup_spool.txt

 

 

UsingOGG as a GoldenGate schema name, INITIALSETUP as a mode of installation.

 

Working,please wait ...

 

RECYCLEBINmust be empty.

Thisinstallation will purge RECYCLEBIN for all users.

To proceed,enter yes. To stop installation, enter no.

 

Enteryes or no:yes

SQL>@role_setup

GGS Role setup script

 

This script will drop and recreate the roleGGS_GGSUSER_ROLE

To use a different role name, quit this scriptand then edit the params.sql script to change the gg_role parameter to thepreferred name. (Do not run the script.)

 

You will be prompted for the name of a schema forthe GoldenGate database objects.

NOTE: The schema must be created prior to runningthis script.

NOTE: Stop all DDL replication before startingthis 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 theExtract, GGSCI, and Manager processes, by using the following SQL command:

 

GRANT GGS_GGSUSER_ROLE TO <loggedUser>

 

where <loggedUser> is the user assigned tothe GoldenGate processes.

SQL>
grant GGS_GGSUSER_ROLE to ogg;

SQL>
@ddl_enable

Trigger altered.

 

 

gc2:运行脚本(同gc1上操作)

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 ogg;

SQL>@ddl_enable

 

gc1:配置Extract进程

GGSCI(gc1) 3> STOP EORA_1

Sending STOP request to MANAGER ...

Request Processed.

 

GGSCI(gc1) 4> EDIT PARAMS EORA_1 

加入红字部分:

-- Change Capture parameter file to capture

-- TCUSTMER and TCUSTORD changes

EXTRACT EORA_1

SETENV (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)

USERID ogg, PASSWORD Welcome1

EXTTRAIL ./dirdat/aa

DDL INCLUDE OBJNAME "scott.*"

TABLE scott.TCUSTMER;

TABLE scott.TCUSTORD;

 

GGSCI(gc1) 5> START EORA_1

Sending START request to MANAGER ...

EXTRACT EINI_1 starting

 

gc2:配置extract

GGSCI(gc2) 3> stop EORA_1          --关闭EORA_1进程

Sending STOP request to MANAGER ...

Request Processed.

GGSCI(gc2) 4> EDIT PARAMS EORA_1   --加入红字部分

-- Change Capture parameter file to capture

-- TCUSTMER and TCUSTORD changes

EXTRACT EORA_1

SETENV (NLS_LANG=AMERICAN_AMERICA.AL32UTF8)

USERID ogg, PASSWORD Welcome1

EXTTRAIL ./dirdat/aa

DDL INCLUDE OBJNAME "scott.*"

TABLE scott.TCUSTMER;

TABLE scott.TCUSTORD;

GGSCI(gc2) 5> START EORA_1

Sending START request to MANAGER ...

EXTRACT EINI_1 starting

 

gc1:配置Replicat进程

GGSCI(gc1) 9> stop RORA_1

Sending STOP request to REPLICAT RORA_1 ...

Request processed.

GGSCI(gc1) 10> info all

Program    Status      Group       Lag          Time Since Chkpt

MANAGER    RUNNING                                          

EXTRACT    RUNNING     EORA_1      00:00:00      00:00:07   

EXTRACT    RUNNING     PORA_1      00:00:00      00:00:02   

REPLICAT    STOPPED     RORA_1     00:00:00      00:00:31
   

GGSCI(gc1) 11> EDIT PARAMS RORA_1
  --加入红色部分

DDLERROR DEFAULT IGNORE RETRYOP

--

-- Change Delivery parameter file to apply

-- TCUSTMER and TCUSTORD Changes

--

REPLICAT RORA_1

SETENV (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)

USERID ogg, PASSWORD Ogg

HANDLECOLLISIONS

ASSUMETARGETDEFS

DISCARDFILE ./dirrpt/RORA_aa.DSC, PURGE

DDL INCLUDE ALL

DDLERROR DEFAULT IGNORE RETRYOP MAXRETRIES 3 RETRYDELAY 5

DDLERROR DEFAULT DISCARD

DDLERROR DEFAULT IGNORE RETRYOP

MAP scott.tcustmer, TARGET scott.tcustmer;

MAP scott.tcustord, TARGET scott.tcustord;

~

"dirprm/rora_1.prm" 16L, 458C written

GGSCI(gc1) 12> start RORA_1

Sending START request to MANAGER ...

REPLICAT RORA_1 starting

GGSCI(gc1) 13> info all

Program    Status      Group       Lag          Time Since Chkpt

MANAGER    RUNNING                                           

EXTRACT    RUNNING     EORA_1      00:00:00      00:00:06   

EXTRACT    RUNNING     PORA_1      00:00:00      00:00:02   

REPLICAT    RUNNING     RORA_1     00:00:00      00:00:02
   

 

gc2:配置Replicate进程

配置过程,同gc1

 

验证ddl:create操作

gc1:

SQL>create table test1 as select * from emp;

Table created.

gc2:

SQL>select * from test1;

     EMPNOENAME      JOB              MGR HIREDATE            SAL       COMM    DEPTNO

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

      7369SMITH      CLERK           7902 17-DEC-80           800                    20

      7499ALLEN      SALESMAN        7698 20-FEB-81          1600        300         30

      ......

      7902FORD       ANALYST         7566 03-DEC-81          3000                    20

      7934MILLER     CLERK           7782 23-JAN-82          1300                    10

14 rows selected.

gc2:

SQL>create table test2 as select * from emp;

Table created.

gc1:

SQL>select * from test2;

     EMPNOENAME      JOB              MGR HIREDATE            SAL       COMM    DEPTNO

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

      7369SMITH      CLERK           7902 17-DEC-80           800                    20

      7499 ALLEN      SALESMAN        7698 20-FEB-81          1600        300         30

      ......

      7902FORD       ANALYST         7566 03-DEC-81          3000                    20

      7934MILLER     CLERK           7782 23-JAN-82          1300                    10

14 rows selected.

 

 

验证ddl:alter操作

gc1:

SQL>alter table test1 rename column mgr to manager;

Table altered.

gc2:

SQL>select * from test1;

     EMPNOENAME      JOB        
 MANAGER HIREDATE            SAL       COMM    DEPTNO

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

      7369SMITH      CLERK           7902 17-DEC-80           800                    20

      7499ALLEN      SALESMAN        7698 20-FEB-81          1600        300         30

      7521WARD       SALESMAN        7698 22-FEB-81          1250        500         30

      ......

gc2:

SQL>alter table test1 rename column manager to mgr;

Table altered.

gc1:

SQL>select * from test1;

     EMPNOENAME      JOB            
 MGR HIREDATE            SAL       COMM    DEPTNO

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

      7369SMITH      CLERK           7902 17-DEC-80           800                    20

      7499ALLEN      SALESMAN        7698 20-FEB-81          1600        300         30

      7521WARD       SALESMAN        7698 22-FEB-81          1250        500         30

      7566JONES      MANAGER         7839 02-APR-81          2975                    20

      ......

 

验证ddl:drop操作

gc2:

SQL>select * from tab;

TNAME                          TABTYPE  CLUSTERID

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

BONUS                          TABLE

DEPT                           TABLE

EMP                            TABLE

SALGRADE                       TABLE

TCUSTMER                       TABLE

TCUSTORD                       TABLE

TEST1                         TABLE

TEST2                          TABLE

8 rows selected.

gc1:

SQL> drop table test1;

Table dropped.

gc2:

SQL>select * from tab;

TNAME                          TABTYPE  CLUSTERID

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

BONUS                          TABLE

DEPT                           TABLE

EMP                            TABLE

SALGRADE                       TABLE

TCUSTMER                       TABLE

TCUSTORD                       TABLE

TEST2                          TABLE

7 rows selected.

gc1:

SQL>select * from tab;

TNAME                          TABTYPE  CLUSTERID

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

DEPT                           TABLE

EMP                            TABLE

BONUS                          TABLE

SALGRADE                       TABLE

TCUSTMER                       TABLE

TCUSTORD                       TABLE

TEST2                          TABLE

7 rows selected.

gc2:

SQL>drop table test2;

Table dropped.

SQL>select * from tab;

TNAME                          TABTYPE  CLUSTERID

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

DEPT                           TABLE

EMP                            TABLE

BONUS                          TABLE

SALGRADE                       TABLE

TCUSTMER                       TABLE

TCUSTORD                       TABLE

6 rows selected.

 

 

声明:
         原创作品。出自 “深蓝的blog” 博客,同意转载。转载时请务必注明出处(http://blog.csdn.net/huangyanlong)。

         关于涉及版权事宜,作者有权追究法律责任。

GoldenGate配置(三)之DDL复制配置的更多相关文章

  1. HA分布式集群配置三 spark集群配置

    (一)HA下配置spark 1,spark版本型号:spark-2.1.0-bin-hadoop2.7 2,解压,修改配置环境变量 tar -zxvf spark-2.1.0-bin-hadoop2. ...

  2. 异构GoldenGate 12c 单向复制配置(支持DDL复制)

    1.开始配置OGG支持DDL复制(在source端操作) 1.1 赋予权限 SQL> conn /as sysdba 已连接. SQL> grant execute on utl_file ...

  3. 【OGG】OGG的单向DML复制配置(一)

    [OGG]OGG的单向DML复制配置(一) 一.1  BLOG文档结构图 一.2  前言部分 一.2.1  导读 各位技术爱好者,看完本文后,你可以掌握如下的技能,也可以学到一些其它你所不知道的知识, ...

  4. 轻松三步教你配置Oracle—windows环境

    最近笔者在学习Oracle的时候,虽然度过了大家所说的安装难题,但是又遇到了一系列的问题,经过多方求教才知道原来是自己仅仅是安装了Oracle,却没有在环境变量中进行相应的配置.笔者也像大家遇到问题时 ...

  5. 烂泥:mysql5.5主从同步复制配置

    本文由秀依林枫提供友情赞助,首发于烂泥行天下. 在上篇文章<烂泥:学习mysql数据库主从同步复制原理>中,我们介绍了有关mysql主从复制的基本原理.在这篇文章中,我们来实际测试下mys ...

  6. 实例学习SSIS(三)--使用包配置

    原文:实例学习SSIS(三)--使用包配置 导读: 实例学习SSIS(一)--制作一个简单的ETL包 实例学习SSIS(二)--使用迭代 实例学习SSIS(三)--使用包配置 实例学习SSIS(四)- ...

  7. OGG学习笔记02-单向复制配置实例

    OGG学习笔记02-单向复制配置实例 实验环境: 源端:192.168.1.30,Oracle 10.2.0.5 单实例 目标端:192.168.1.31,Oracle 10.2.0.5 单实例 1. ...

  8. MySQL半同步复制配置

    ansible-playbook -f 3 endpoint/mysql.yml -e "exec=fileConfig" -e "db_action=setAll&qu ...

  9. MySQL数据库的主从同步复制配置

    一.主从同步机制原理 MYSQL主从同步是在MySQL主从复制(Master-Slave Replication)基础上实现的,通过设置在Master MySQL上的binlog(使其处于打开状态), ...

随机推荐

  1. ASP.NET 之 EntityFramework实体框架搭建

    前段时间接触了EntityFramework,对ORM框架也是有了初步的认识,现在对其进行一点小总结. 一.ORM简介 对象关系映射(Object Relational Mapping,简称ORM)模 ...

  2. [EWS]如何: 通过使用 Exchange 中的 EWS 流有关邮箱事件的通知

    摘要 在之前的文章中,介绍ews拉通知的模式订阅邮件.详情可阅读这篇文章:EWS 通过SubscribeToPullNotifications订阅Exchange新邮件提醒 ,可以看到拉通知的模式,是 ...

  3. UML,构件图与部署图

    一.构件图概述 1.概念 用来显示一组构件之间的组织及其依赖关系 2.基本元素 (1)构件:定义了良好接口的物理实现单元. ● 配置构件:形成可执行文件的基础,如:动态链接库(DLL).ActiveX ...

  4. Oracle总结之plsql编程(基础七)

    紧接基础六,对oracle角色和权限的管理之后,在接下来的几次总结中来就最近工作中用过的plsql编程方面的知识进行总结,和大家分享! 原创作品,转自请注明出处:https://www.cnblogs ...

  5. BestCoder Round #29——A--GTY's math problem(快速幂(对数法))、B--GTY's birthday gift(矩阵快速幂)

    GTY's math problem Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Other ...

  6. Spring、Springmvc整合web的web.xml配置

    <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http:// ...

  7. 高性能JavaScript(加载和执行)

    当浏览器遇到 <script> 标签时,它是没办法知道 JavaScript 是否会向DOM中添加内容或引入其他元素,甚至关闭某一个标签.因此这个时候浏览器就会停止处理页面,先执行Java ...

  8. NUnit单元测试示例

    单元测试的用法 1.下载NUnit软件 安装后打开界面如图: 2.新建测试项目 添加类库项目并在NuGet管理包中添加NUnit 这里添加NuGet的NUnit包要注意保持版本和之前下载的NUnit软 ...

  9. bower 和 npm 的区别详细介绍

    摘要: 本文讲的是bower 和 npm 的区别详细介绍, 简单的说,npm是进行后端开发中,使用的模块安装工具,而bower,是前端的模块安装工具. 比如,在安装express,socket.io时 ...

  10. webpack+sass+vue 入门教程(二)

    六.新建webpack配置文件 webpack.config.js 文件整体框架内容如下,后续会详细说明每个配置项的配置 webpack.config.js直接放在项目demo目录下 module.e ...