抽取進(jìn)程:
extract ext_code
SETENV (NLS_LANG="AMERICAN_AMERICA.AL32UTF8")
SETENV (ORACLE_HOME = "/app/oracle/product/10.2.0/db")
SETENV (ORACLE_SID = chunqiu)
userid goldengate@chunqiu,password AACAAAAAAAAAAAKAPATACEHBIGQGCFZCCDIGAEMCQFFBZHVC, ENCRYPTKEY DEFAULT
exttrail ./dirdat/de
--tranlogoptions excludeuser goldengate
dynamicresolution
WARNLONGTRANS 3h, CHECKINTERVAL 30m
gettruncates
tranlogoptions altarchivelogdest +DG1/gbbarcode/archivelog/
TRANLOGOPTIONS ASMUSER SYS@ASM, ASMPASSWORD oracle
table chunqiu.plm_acc_serial;
table chunqiu.plm_acc_serial_tsc;
創(chuàng)新互聯(lián)建站專注于洱源企業(yè)網(wǎng)站建設(shè),響應(yīng)式網(wǎng)站開發(fā),成都做商城網(wǎng)站。洱源網(wǎng)站建設(shè)公司,為洱源等地區(qū)提供建站服務(wù)。全流程按需定制,專業(yè)設(shè)計(jì),全程項(xiàng)目跟蹤,創(chuàng)新互聯(lián)建站專業(yè)和態(tài)度為您提供的服務(wù)
ADD EXTRACT ext_code,tranlog,BEGIN now
ADD exttrail ./dirdat/de,EXTRACT ext_code,megabytes 200
pump進(jìn)程:
extract pum_code
SETENV (NLS_LANG="AMERICAN_AMERICA.AL32UTF8")
SETENV (ORACLE_HOME = "/app/oracle/product/10.2.0/db")
SETENV (ORACLE_SID = chunqiu)
userid goldengate@chunqiu,password AACAAAAAAAAAAAKAPATACEHBIGQGCFZCCDIGAEMCQFFBZHVC, ENCR
YPTKEY DEFAULT
rmthost 192.168.50.68, mgrport 7801
rmttrail ./dirdat/cc
PASSTHRU
gettruncates
table chunqiu.plm_acc_serial;
table chunqiu.plm_acc_serial_tsc;
ADD EXTRACT pum_code,exttrailsource ./dirdat/de
ADD rmttrail ./dirdat/cc,EXTRACT pum_code,megabytes 200
應(yīng)用進(jìn)程:
數(shù)據(jù)庫修改參數(shù),11g之前不需要設(shè)置enable_goldengate_replication參數(shù):
alter system set enable_goldengate_replication=true scope=both;
數(shù)據(jù)庫添加goldengate用戶:
create tablespace OGG_TBS datafile size 10G autoextend on next 100m maxsize unlimited;
create user goldengate default tablespace OGG_TBS identified by goldengate;
grant dba to goldengate ;
添加checkpoint表:
dblogin userid goldengate,password goldengate
add checkpointtable goldengate.checkpoint
EDIT PARAMS ./GLOBALS
CHECKPOINTTABLE goldengate.checkpoint
replicat rep_code
SETENV (NLS_LANG="AMERICAN_AMERICA.AL32UTF8")
userid goldengate,password goldengate
assumetargetdefs
reperror default,discard
discardfile /goldengate/rep_code.log,append,megabytes 1000
gettruncates
map chunqiu.PLM_ACC_SERIAL, target idc.PLM_ACC_SERIAL;
map chunqiu.PLM_ACC_SERIAL_TSC, target idc.PLM_ACC_SERIAL_TSC;
add replicat rep_code,exttrail ./dirdat/cc, checkpointtable goldengate.checkpoint
start rep_code,aftercsn 112892036392
刪掉replicat進(jìn)程:
注意:一定要登錄到dblogin到目標(biāo)數(shù)據(jù)庫,否則提示要?jiǎng)h除checkpoint table
dblogin userid goldengate,password goldengate
stop rep_code
delete replicat rep_code