Oracle GoldenGate软件基于数据库日志结构变化,通过解析源端在线日志或归档日志获得数据增量,再将这些变化应用到目标数据库,从而实现源库和目标库的数据同步。下面通过一个简单的示例,详细介绍利用GoldenGate实现Oracle数据库之间的同步。基本架构如下图所示:1. 安装1.1 下载介质GoldenGate的安装介质可以从Oracle的官网上下载。http://www.oracle.com/technetwork/middleware/goldengate/downloads/index.html1.2 配置GoldenGate用户下载完成后将其拷贝到源和目标的相应位置解压完成后,即可以开始进行配置。# useradd -g oinstall -G dba ggate# su – ggate$ mkdir /oracle/ggate$ cd /oracle/ggate$ unzip ……$tar ……$ vi ~/.bash_profile 添加如下的内容: export ORACLE_BASE=/oracleexport ORACLE_HOME=$ORACLE_BASE/dbexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:/oracle/ggateexport GGATE=/oracle/ggate 1.3 创建目录 使用ggsci工具,创建必要的目录。$ cd /oracle/ggate$ ./ggsci Oracle GoldenGate Command Interpreter for OracleVersion 11.1.1.0.0 Build 078Linux, x86, 32bit (optimized), Oracle 10 on Jul 282010 13:24:18Copyright (C) 1995, 2010, Oracle and/or itsaffiliates. All rights reserved.GGSCI (gridcontrol) 1> create subdirs至此,GoldenGate基本的安装完成。 注意: 此部分需要在源端和目标端完成。 2. 源数据库配置 GoldenGate主要通过抓取源端数据库重做日志进行分析,将获取的数据应用到目标端,实现数据同步。因此,为了让GoldenGate能够正常工作,源数据库需要进行一定配置。2.1 设置源库为归档模式 SQL> shutdown immediateSQL> startup mountSQL> alter database archivelog;SQL> alter database open; 2.2 开启minimal supplemental logging SQL> alter database add supplemental log data;SQL> select SUPPLEMENTAL_LOG_DATA_MIN fromv$database;SUPPLEME——–YES 2.3 关闭数据库的recyblebin SQL> alter system set recyclebin=off scope=spfile; 如果数据库是10g,需要关闭recyclebin并重启;或者手工purge recyclebin。 2.4 配置复制的DDL支持 SQL> create user ggate identified by ggate defaulttablespace users temporary tablespace temp;SQL> grant connect,resource,dba,unlimitedtablespace to ggate;SQL> grant execute on utl_file to ggate; SQL> @$GGATE/marker_setup.sql;SQL> @$GGATE/ddl_setup.sql;SQL> @$GGATE/role_setup.sql;SQL> grant GGS_GGSUSER_ROLE to ggate;SQL> @$GGATE/ddl_enable.sql; 2.5 创建源端和目标端的测试用户 sourceSQL> create user sender identified by oracledefault tablespace users temporary tablespace temp;SQL> grant connect,resource,unlimited tablespace tosender; destinationSQL> create user ggate identified by ggate defaulttablespace users temporary tablespace temp;SQL> grant connect,resource,dba,unlimitedtablespace to ggate;SQL> create user receiver identified by oracledefault tablespace users temporary tablespace temp;SQL> grant connect,resource,unlimited tablespace toreceiver;
Oracle 管理之 Linux 网络基础Oracle 10.2.0.5 rac awr不能自动生成相关资讯 GoldenGate Oracle GoldenGate
- Oracle Goldengate在HP平台裸设备 (今 11:04)
- GoldenGate for Oracle 数据一致性 (10/10/2015 19:41:17)
- 使用GoldenGate 实现Oracle for (09/16/2015 09:42:31)
| - GoldenGate中使用FILTER,COMPUTE (07月27日)
- GoldenGate 实现Oracle for Oracle (09/20/2015 13:49:00)
- Oracle GoldenGate 介绍及安装配置 (09/16/2015 09:37:44)
|
本文评论 查看全部评论 (0)