GolddenGate-双向复制

一、源机配置

1.增加extract

  add extract extb1, tranlog, begin now, threads 1

 

2.配置extract

extract extb1
userid system, password oracle   ----该用户为同步用户

tranlogoptions excludeuser system ---排除同步用户,避免循环
rmthost 192.168.0.100, mgrport 7809
rmttrail ./dirdat/bi
table gguser.TCUSTMER;
TABLE gguser.TCUSTORD;

 

3.设定extract投递rmttrail

 add rmttrail ./dirdat/pi, extract extb1, megabytes 5

 

4.增加replicat

 CHECKPOINTTABLE system.ggschkpt

 

dblogin userid system, password oracle

 add checkpointtable

 

5.配置取值位置

 add replicat repb1, exttrail ./dirdat/bi

 

6.编辑replicat

assumetargetdefs
discardfile ./dirrpt/repb1.dsc, PURGE
map gguser.TCUSTMER, target gguser.TCUSTMER;
map gguser.TCUSTORD, target gguser.TCUSTORD;

 

7.全部启动,并查看

start extb1

start rep1

info all

 

二、配置目标机器

 

8.增加extract

add extract extb1, tranlog, begin now, threads 1

 

9.编辑extract

   extract extb1
   userid system, password oracle
   tranlogoptions excludeuser system
   rmthost 192.168.0.99, mgrport 7809
   rmttrail ./dirdat/bi
   table gguser.TCUSTMER;
   table gguser.TCUSTORD;

 

10.设置投递

add rmttrail ./dirdat/bi, extract extb1, megabytes 5

 

11.start extb1

 报错:

 2011-04-26 19:24:16  ERROR   OGG-00730  No minimum supplemental logging is enabled. This may cause extract proc
ess to handle key update incorrectly if key column is not in first row piece.

 

发现数据库不是最细log模式,查看:

SQL> select supplemental_log_data_min from v$database;

SUPPLEME
--------
NO

 

修正:
SQL> alter database add supplemental log data;

Database altered.

SQL> alter system switch logfile;

System altered.

 

又错:

 ERROR   OGG-00717  Found unsupported in-memory undo record in sequence 20, at RBA 1137168,
 with SCN 0.1181993 (1181993) ... Minimum supplemental logging must be enabled to prevent data loss.

解决:alter extract extb1, tranlog, begin 2011-04-21 22:16:52.000000, thread 1

          alter extract extb1, tranlog, begin now, thread 1

先用固定时间,不行,后又改回同样的begin now,就行了,为什么啊------不知道

 

12.增加replicat

add replicat repb1, exttrail ./dirdat/bi

 

13.编辑repb1

 replicat repb1
userid system, password oracle
handlecollisions
assumetargetdefs
discardfile ./dirrpt/repb1.dsc, PURGE
map gguser.TCUSTMER, target gguser.TCUSTMER;
map gguser.TCUSTORD, target gguser.TCUSTORD;

 

14.验证

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值