一、源端進程配置
添加本地抓取進程exta
add ext exta, tranlog, begin now
指定抓取日志到指定路徑下
add exttrail /u01/app/oracle/product/ogg_src/dirdat/ra,ext exta , MEGABYTES 20
添加遠程投遞dpea進程
ADD EXTRACT dpea, EXTTRAILSOURCE /u01/app/oracle/product/ogg_src/dirdat/ra
指定dpea進程投遞目的地
add rmttrail /u01/app/oracle/product/ogg/dirdat/ra,ext dpea, MEGABYTES 20
二、expdp/impdp 進行表初始化
源端:
查看當前SCN號
select current_scn from v$database;
CURRENT_SCN
-----------
1081055
以sys用戶登錄,并授權(quán)讀寫給ogg
create directory ogg_dir as '/u01/app/oracle/product/ogg_src/ogg_dir';
grant read,write on directory ogg_dir to ogg;
導出數(shù)據(jù)
expdp ogg/ogg directory=ogg_dir dumpfile=ogg1.dmp logfile=oggtest1.log tables=ogg.oggtest1 flashback_scn=1081055
目標端:
以sys用戶登錄,并授權(quán)讀寫給ogg
create directory ogg_dir as '/u01/app/oracle/product/ogg/ogg_dir';
grant read,write on directory ogg_dir to ogg;
導入數(shù)據(jù)
impdp ogg/ogg directory=ogg_dir dumpfile=ogg1.dmp logfile=oggtest1.log tables=oggtest1 table_exists_action=replace;
三、目標端進程配置
添加repa進程
add rep repa, exttrail /u01/app/oracle/product/ogg/dirdat/ra, nodbcheckpoint
編輯repa進程
edit param repa
replicat repa
userid ogg, password ogg
reperror default,abend
discardfile /u01/app/oracle/product/ogg/dirrpt/repa.dsc,append, megabytes 10
assumetargetdefs
dynamicresolution
map ogg.oggtest1, target ogg.oggtest1 ;
啟用repa進程解析trail文件
start repa aftercsn 1085091
本例中是利用了OGG中dump進程將數(shù)據(jù)投遞到目的端,也可以直接使用extact進程投遞到目的端,但是各有利弊。
網(wǎng)站欄目:OGG簡單DML同步
文章轉(zhuǎn)載:
http://weahome.cn/article/pcicoi.html