ITPub博客

首页 > Linux操作系统 > Linux操作系统 > goldengate 双向复制

goldengate 双向复制

原创 Linux操作系统 作者:hl_fen 时间:2011-12-14 16:53:01 0 删除 编辑
环境 test-han-1  192.168.2.93      test-han-2  192.168.2.94
 
前期准备
在两台主机上设置相应环境变量

export GGS_HOME=… 后面装goldengate时候的目录

export JAVA_HOME=/home/oracle/jdk1.6.0_24; --此处要根据实际填写
export PATH=$PATH:$HOME/bin:$GGS_HOME:$JAVA_HOME:$ORACLE_HOME/bin
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
LANG=C 
 
将数据打开归档,打开补充日志,打开force logging,创建操作用户 goldengate,并给与相应权限,这里给了DBA权限
 
安装goldengate,并创建相应目录
./ggsci
create subdirs
 
test-han-1 上的操作
GGSCI (test-han-1) 11> dblogin userid goldengate,password goldengate
Successfully logged into database.
GGSCI (test-han-1) 12> add trandate han.*
 
管理进程
GGSCI (test-han-1) 12>edit param mgr    
7809
 
抓取进程
GGSCI (test-han-1) 12>add extract ext_1,tranlog,begin now
 
GGSCI (test-han-1) 12>add exttrail /oracle/goldengate/dirdat/la,extract ext_1
GGSCI (test-han-1) 12>edit param ext_1
extract ext_1
dynamicresolution
--SETENV (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)
userid goldengate,password goldengate
tranlogoptions excludeuser goldengate
exttrail ./dirdat/la
table han.*;
 
推送进程
GGSCI (test-han-1) 20> add extract pump_1,exttrailsource ./dirdat/la
EXTRACT added.

GGSCI (test-han-1) 22> add rmttrail /oracle/ggs/dirdat/ma,extract pump_1
RMTTRAIL added.
GGSCI (test-han-1) 24> edit param pump_1

extract pump_1
dynamicresolution
rmthost 192.168.2.94,mgrport 7809
rmttrail /oracle/ggs/dirdat/ma
passthru
table han.*;
 
复制进程
GGSCI (test-han-1) 29> dblogin userid goldengate,password goldengate
Successfully logged into database.
GGSCI (test-han-1) 30> add checkpointtable goldengate.checkpoint
Successfully created checkpoint table GOLDENGATE.CHECKPOINT.
GGSCI (test-han-1) 31> add replicat rep_1,exttrail ./dirdat/ra,begin now,checkpointtable goldengate.checkpoint
REPLICAT added.

GGSCI (test-han-1) 32> edit param rep_1
replicat rep_1
assumetargetdefs
userid goldengate,password goldengate
discardfile ./dirrpt/rep.dis,append
map han.*, target han.*;
 
启动各个进程
 

test-han-2 上的操作
 
管理进程
GGSCI(test-han-2) 13> edit param mgr
7809
 
GGSCI(test-han-2) 14>start mgr
 
GGSCI (test-han-2) 12> dblogin userid goldengate,password goldengate
Successfully logged into database.
GGSCI (test-han-2) 13> add trandata han.*
GGSCI (test-han-2) 14> add checkpointtable goldengate.checkpoint
Successfully created checkpoint table GOLDENGATE.CHECKPOINT.
 
复制进程
GGSCI (test-han-2) 15> add replicat rep_2,exttrail ./dirdat/ma,begin now,checkpointtable goldengate.checkpoint
GGSCI (test-han-2) 16> edit param rep_2

replicat rep_2
assumetargetdefs
userid goldengate,password goldengate
discardfile ./dirrpt/rep.dis,append
map han.*, target han.*;
 
抓取进程
GGSCI (test-han-2) 33> add extract ext_2,tranlog,begin now
EXTRACT added.

GGSCI (test-han-2) 34> add exttrail ./dirdat/na,extract ext_2
EXTTRAIL added.
GGSCI (test-han-2) 36> edit param ext_2
extract ext_2
dynamicresolution
userid goldengate,password goldengate
tranlogoptions excludeuser goldengate
exttrail ./dirdat/na
table han.*;

推送进程
GGSCI (test-han-2) 43> add extract pump_2,exttrailsource ./dirdat/na
EXTRACT added.

GGSCI (test-han-2) 44> add rmttrail /oracle/ggs/dirdat/ra,extract pump_2
RMTTRAIL added.
GGSCI (test-han-2) 45> edit param pump_2
extract pump_2
dynamicresolution
rmthost 192.168.2.93,mgrport 7809
rmttrail /oracle/ggs/dirdat/ra
passthru
table han.*;
 
启动各个进程

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/76790/viewspace-713317/,如需转载,请注明出处,否则将追究法律责任。

上一篇: mysql更改datadir
请登录后发表评论 登录
全部评论

注册时间:2011-12-07

  • 博文量
    4
  • 访问量
    5616