<strong>一、源端进程配置</strong><br />
添加本地抓取进程exta<br />
add ext exta, tranlog, begin now<br />
指定抓取日志到指定路径下<br />
add exttrail /u01/app/oracle/product/ogg_src/dirdat/ra,ext exta , MEGABYTES 20<br />
<br />
<br />
添加远程投递dpea进程<br />
ADD EXTRACT dpea, EXTTRAILSOURCE /u01/app/oracle/product/ogg_src/dirdat/ra<br />
指定dpea进程投递目的地<br />
add rmttrail /u01/app/oracle/product/ogg/dirdat/ra,ext dpea, MEGABYTES 20<br />
<br />
<strong>二、expdp/impdp 进行表初始化</strong><br />
源端:<br />
查看当前SCN号<br />
select current_scn from v$database;<br />
<br />
<br />
CURRENT_SCN<br />
-----------<br />
1081055<br />
<br />
<br />
以sys用户登录,并授权读写给ogg<br />
create directory ogg_dir as '/u01/app/oracle/product/ogg_src/ogg_dir';<br />
grant read,write on directory ogg_dir to ogg;<br />
<br />
<br />
导出数据<br />
expdp ogg/ogg directory=ogg_dir dumpfile=ogg1.dmp logfile=oggtest1.log tables=ogg.oggtest1 flashback_scn=1081055<br />
<br />
<br />
目标端:<br />
以sys用户登录,并授权读写给ogg<br />
create directory ogg_dir as '/u01/app/oracle/product/ogg/ogg_dir';<br />
grant read,write on directory ogg_dir to ogg;<br />
<br />
<br />
导入数据<br />
impdp ogg/ogg directory=ogg_dir dumpfile=ogg1.dmp logfile=oggtest1.log tables=oggtest1 table_exists_action=replace;<br />
<br />
<strong>三、目标端进程配置</strong><br />
添加repa进程<br />
add rep repa, exttrail /u01/app/oracle/product/ogg/dirdat/ra, nodbcheckpoint<br />
<br />
编辑repa进程<br />
edit param repa<br />
replicat repa<br />
userid ogg, password ogg<br />
reperror default,abend<br />
discardfile /u01/app/oracle/product/ogg/dirrpt/repa.dsc,append, megabytes 10<br />
assumetargetdefs<br />
dynamicresolution<br />
map ogg.oggtest1, target ogg.oggtest1 ;<br />
<br />
启用repa进程解析trail文件<br />
start repa aftercsn 1085091<br />
<br />
本例中是利用了OGG中dump进程将数据投递到目的端,也可以直接使用extact进程投递到目的端,但是各有利弊。<br />
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。