设为首页 加入收藏

TOP

搭建oracle到oracle的Goldengate双向复制环境(三)
2014-11-23 20:01:44 来源: 作者: 【 】 浏览:89
Tags:搭建 oracle Goldengate 双向 复制 环境
ce users temporary tablespace temp;

User created.

SQL> grant connect,resource,dba to ssgg;

Grant succeeded.

gg2:

SQL> create user ttgg identified by oracle default tablespace users temporary

tablespace temp;

User created.

SQL> grant connect,resource,dba to ttgg;

Grant succeeded.

参数设置

配置gg1,添加checkpoint表:

GGSCI (gg1) 1> dblogin userid ggtest,password oracle

Successfully logged into database.

GGSCI (gg1) 2> view params ./GLOBAL

ggschema ggtest

checkpointtable ggtest.checkpoint

GGSCI (gg1) 27> view params mgr

PORT 7809 --指定管理端口

dynamicportlist 7810-7900 --动态端口列表,当指定端口不可用时,管理进程会自动选择一个可用端口。最大可指定256个端口

autostart er * --mgr开启时自动开启所有的extract and replicat process

autorestart er *,retries 5,waitminutes 2 --extract and replicat processes fail mgr automatically start参数每2分钟重启一次,重启5次后放弃

1、to configure the primary extract group

GGSCI (gg1) 10> add extract ext01,tranlog,begin now

EXTRACT added.

GGSCI (gg1) 13> add exttrail /u01/ggate/dirdat/sd,extract ext01

EXTTRAIL added.

GGSCI (gg1) 28> view params ext01

extract ext01 --提取进程组的名字

userid ggtest, password oracle --同步用户

exttrail /u01/ggate/dirdat/sd --trail 文件目录和标识(类似于sd*这样文件),命名只能是2个字符。

tranlogoptions excludeuser ggtest --避免循环复制的出现

DDL INCLUDE ALL

DDLOPTIONS ADDTRANDATA

table ssgg.*; --同步的表或用户下所有的表

当你需要同步除Goldengate和Oracle数据库自带的用户外所有用户的DDL操作时,可在源端主抽取进程中加入下面的内容

ddl include all

然后再在目标端Replicat进程参数文件中加入DDL错误的处理语句即可。

2、 t o c o n f i g u r e t h e d a t a p u m p

GGSCI (gg1) 19> add extract p01,exttrailsource /u01/ggate/dirdat/sd,begin now

EXTRACT added.

GGSCI (gg1) 20> add rmttrail /u01/ggate/dirdat/pd,extract p01

RMTTRAIL added.

GGSCI (gg1) 29> view params p01

extract p01

userid ggtest,password oracle

rmthost 192.168.50.231,mgrport 7809 --指定远端IP和MGR端口

rmttrail /u01/ggate/dirdat/pd

table ssgg.*;

3、 to configure the rreplicat group

GGSCI (gg1) 3> add replicat r02,exttrail /u01/ggate/dirdat/dp,begin now

ERROR: No checkpoint table specified for ADD REPLICAT.

GGSCI (gg1) 4> add replicat r02,exttrail /u01/ggate/dirdat/dp,checkpointtable ggtest.checkpoint

REPLICAT added.

GGSCI (gg1) 30> view params r02

replicat r02

assumetargetdefs --定义目标表和源表使用MAP语法有相同的列结构,当出现热点时,不查看源结构而直接从源定义文件查

userid ggtest,password oracle

DISCARDFILE /u01/ggate/dirdat/sdisc.dsc,append,megabytes 100

DDL INCLUDE MAPPED

DDLERROR DEFAULT IGNORE RETRYOP

map ttgg.*, target ssgg.*;

启动所有进程:

GGSCI (gg1) 3> start mgr

Manager started.

GGSCI (gg1) 4> info all

Program Status Group Lag at Chkpt Time Since Chkpt

MANAGER RUNNING

EXTRACT RUNNING EXT01 00:00:00 00:00:07

EXTRACT RUNNING P01 00:00:00 00:00:01

REPLICAT RUNNING R02 00:00:00 00:00:08

配置gg2,添加checkpoint表:

GGSCI (gg2) 1> dblogin userid ggtest,password oracle

Successfully logged into database.

GGSCI (gg2) 25> view params ./GLOBAL

ggschema ggtest

checkpointtable ggtest.checkpoint

GGSCI (gg2) 29> view params mgr

PORT 7809

dynamicportlist 7810-7900

autostart er *

autorestart er *,retries 5,waitminutes 2

c o n f i g u r a t i o n f r o m s e c o u n d a r y s y s t e m t o p r i m a r y s y s t e m

1 、to configure the primary extract group

GGSCI (gg2) 12> add extract ext02,tranlog,begin now

EXTRACT added.

GGSCI (gg2) 13> add exttrail /u01/ggate/dirdat/td,extract ext02

EXTTRAIL added.

GGSCI (gg2) 26> view params ext02

extract ext02

userid ggtest, password oracle

exttrail /u01/ggate/dirdat/td

tranlogoptions excludeuser ggtest

DDL INCLUDE ALL

DDLOPTIONS ADDT

首页 上一页 1 2 3 4 下一页 尾页 3/4/4
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇如何判断多个字段组成的关键字在.. 下一篇Oracle技术_UTL_FILE包用法详解_..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: