搭建一个Oracle到Oracle的GoldenGate双向复制环境

php中文网
发布: 2016-06-07 16:45:38
原创
1264人浏览过

搭建一个Oracle到Oracle的Goldengate双向复制环境(支持DDL+DML)。

目标:搭建一个oracle到oracle的goldengate双向复制环境(支持DDL+DML)。

环境:

OS:Red Hat Enterprise Linux Server release 5.5 (Tikanga)

DB:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

gg1

 

GoldenGate单向表DML同步

 

Oracle GoldenGate 系列:Extract 进程的恢复原理

 

Oracle GoldenGate安装配置

 

Oracle goldengate的OGG-01004 OGG-1296错误

 

Oracle GoldenGate快速入门教程:基本概念和配置

搭建Oracle 到Oracle 的Golden Gate 单向复制测试环境

 

一、安装GG

(1)添加环境变量,在/home/oracle/.bash_profile文件里添加如下内容:

export PATH=/u01/ggate:$PATH

exportLD_LIBRARY_PATH=/u01/ggate:$LD_LIBRARY_PATH

export ggtest=/u01/ggate

这里的

source/home/oracle/.bash_profile

(2)使用ggsci工具,创建必要的目录

gg1:/u01/ggate> ggsci

--

Oracle GoldenGate Command Interpreter forOracle

Version 11.1.1.1OGGCORE_11.1.1_PLATFORMS_110421.2040

Linux, x64, 64bit (optimized), Oracle 11gon Apr 21 2011 22:42:14

 

Copyright (C) 1995, 2011, Oracle and/or itsaffiliates. All rights reserved.

 

GGSCI (gg1) 1> create subdirs

--

Creating subdirectories under currentdirectory /u01/ggate

 

Parameter files                /u01/ggate/dirprm: created

Report files                   /u01/ggate/dirrpt: created

Checkpoint files               /u01/ggate/dirchk: created

Process status files           /u01/ggate/dirpcs: created

SQL script files               /u01/ggate/dirsql: created

Database definitions files     /u01/ggate/dirdef: created

Extract data files             /u01/ggate/dirdat: created

Temporary files                /u01/ggate/dirtmp: created

Veridata files                 /u01/ggate/dirver: created

Veridata Lock files            /u01/ggate/dirver/lock: created

Veridata Out-Of-Sync files     /u01/ggate/dirver/oos: created

Veridata Out-Of-Sync XML files/u01/ggate/dirver/oosxml: created

Veridata Parameter files       /u01/ggate/dirver/params: created

Veridata Report files          /u01/ggate/dirver/report: created

Veridata Status files          /u01/ggate/dirver/status: created

Veridata Trace files           /u01/ggate/dirver/trace: created

Stdout files                   /u01/ggate/dirout: created

 

GGSCI (gg1) 2>

 

以上就是

二、分别配置source和target

(1)GoldenGate通过抓取源端数据库重做日志进行分析,将获取的数据应用到目标端,,实现数据同步。因此,源数据库需要必须处于归档模式,并启用附加日志和强制日志。

归档模式、附加日志、强制日志

--查看

与光AI
与光AI

一站式AI视频工作流创作平台

与光AI 66
查看详情 与光AI

SQL> select log_mode,supplemental_log_data_min,force_logging from v$database;

LOG_MODE     SUPPLEME FOR

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

ARCHIVELOG  NO       NO

 

--修改

SQL>shutdown immediate

SQL>startup mount

SQL>alter database archivelog;

SQL>alter database open;

SQL>alterdatabase force logging;

SQL>alterdatabase add supplemental log data;

(2)禁用Recycle Bin

如果启用

If the recyclebin is enabled, the Oracle GoldenGate DDL trigger session receives implicitrecycle bin DDL operations that cause the trigger to fail.

Oracle 11g

SQL> alter system set recyclebin=offscope=spfile;

System altered.

如果数据库是

(3)创建存放

SQL> create user ggtest identified by oracle default tablespace users temporary tablespace temp;

User created.

SQL> grant connect,resource to ggtest;

Grant succeeded.

SQL> grant execute on utl_file to ggtest;

Grant succeeded.

gg1:/u01/ggate> echo $ggate

/u01/ggate

gg1:/home/oracle> cd $ggate

gg1:/u01/ggate> sqlplus / as sysdba;

SQL*Plus: Release 11.2.0.3.0 Production onTue Nov 8 19:41:58 2011

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

Connected to:

Oracle Database 11g Enterprise EditionRelease 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Miningand Real Application Testing options

SQL> @marker_setup.sql;

Marker setup script

You will be prompted for the name of aschema for the GoldenGate database objects.

NOTE: The schema must be created prior torunning this script.

NOTE: Stop all DDL replication beforestarting this installation.

--输入我们之前创建的用户名:

Enter GoldenGate schema name:ggtest

Marker setup table script complete, runningverification script...

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

Setting schema name to ggtest

MARKER TABLE

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

OK

MARKER SEQUENCE

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

OK

Script complete.

SQL> @ddl_setup.sql;

GoldenGate DDL Replication setup script

Verifying that current user has privilegesto install DDL Replication...

You will be prompted for the name of aschema for the GoldenGate database objects.

最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号