1.源端mgr参数文件
edit params mgr
port 7809
dynamicportlist 7810-7819
autostart extract *
autorestart extract *,retries 5,waitminutes 3,resetminutes 60 --每隔3分钟重启一次,尝试5次,等待5分钟后再尝试
purgeoldextracts ./dirdat/lt*,usecheckpoints, minkeepdays 3
lagreporthours 1
laginfominutes 30
lagcriticalminutes 45
2.配置extract进程参数文件
edit params ext_t1
extract ext_t1
dynamicresolution
setenv(NLS_LANG="AMERICAN_AMERICA.ZHS16GBK")
setenv(ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1)
setenv(ORACLE_SID=bre1)
userid ggs,password ggs
--tranlogoptions asmuser sys@asm,asmpassword manager --配置asm连接
--tranlogoptions altarcharchivelogdest primary instance bre1 +data/arch,altarchivelogdest instance bre2 +data/arch --配置asm归档日志
--tranlogoptions dblogreader --另一种配置asm连接方式,只支持11g以后
gettruncates --同步truncate默认不同步
warnlongtrans 2h,checkintervals 10m
--超过2小时的长事务记录告警日志
exttrail ./dirdat/lt
ddl include all --ddl配置,所有的ddl
ddloptions addtrandata report --自动添加表的trandata
table test.*;
tableexclud test.t1;
add extract ext_t1,tranlog,begin now --thread 2 如果是rac需要加上thread
add exttrail ./dirdat/lt,extract ext_t1,megabytes 100
3.配置datapump参数文件
edit params dp_t1
extract dp_t1
dynamicresolution
passthru
rmthost 192.168.56.45,mgrport 7809,compress
rmttrail ./dirdat/rt
table test.*;
add extract dp_t1,exttrailsource ./dirdat/lt
add rmttrail ./dirdat/rt,extract dp_t1
4.目标端mgr进程参数文件
edit params mgr
port 7809
dynamicportlist 7810-7819
autostart replicat *
autorestart replicat *,retries 5,waitminutes 3,resetminutes 5 --每隔3分钟重启一次,尝试5次,等待5分钟后再尝试
purgeoldextracts ./dirdat/rt*,usecheckpoints, minkeepdays 3
lagreporthours 1
laginfominutes 30
lagcriticalminutes 45
5.配置目标端global参数文件
edit params ./GLOBALS
ggschema ggt
checkpointtable ggt.ckpt
6.目标端replica参数文件
edit params rep_t1
replicat rep_t1
setenv(NLS_LANG="AMERICAN_AMERICA.ZHS16GBK")
setenv(ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1)
setenv(ORACLE_SID=bre1)
userid ggs,password ggs
assumetargetdefs --源端和目标端表结构一致的时候使用,开启ddl同步必须结构一致
--handlecollisions --首次同步的时候加入
reperror default,discard
discardfile ./dirrpt/rep1.dsc,append,megabytes 50
dynamicresolution
ddl include mapped --ddl配置
ddloptions report
ddlerror default ignore retryop
map test.*,target test.*;
add replicat rep_t1,exttrail ./dirdat/rt