1.配置源端具有pump、目标端具有trail的ogg环境
1.1 参数文件
extract进程ett参数:
EXTRACT ett
USERID system, PASSWORD oracle
EXTTRAIL ./dirdat/tr
TABLE gguser.huangliqiang , WHERE (ID = 100) ;
data pump进程dpp参数:
EXTRACT dpp
USERID system, PASSWORD oracle
RMTHOST 192.168.1.29, MGRPORT 7809
RMTTRAIL ./dirdat/tr
TABLE gguser.huangliqiang;
目标端replicat进程rpp:
REPLICAT rpp
USERID system, PASSWORD oracle
HANDLECOLLISIONS
ASSUMETARGETDEFS
DISCARDFILE ./dirrpt/RORAKK.DSC, PURGE
MAP gguser.huangliqiang, TARGET gguser.huangliqiang;
1.2 增加进程和trail文件
add extract ett,tranlog,begin now
add exttrail ./dirdat/tr,extract ett
add extract dpp,exttrailsource ./dirdat/tr
add rmttrail ./dirdat/tr,extract dpp
add replicat rpp,exttrail ./dirdat/tr, checkpointtable system.ggchkptable
2.过滤
2.1 extract参数中行过滤(比较符号<两边都要加空格,这里很容易出错):
Table HR.EMPLOYEES,
WHERE (EMPLOYEE_ID < 100);
2.2 表的列不同情况下的映射,主要是生成源端表结构的定义文件defgen.prm,然后在目标端colmap中做映射,
目标端的colmap中,目标端的表字段写在左边,源端的写在右边:
edit params defgen
defsfile /u01/gg/dirdef/hunterdef01.defs
USERID system, PASSWORD oracle
TABLE gguser.hlq;
$ defgen paramfile /u01/gg/dirprm/defgen.prm
把def文件发送到目标端的dirdef目录下
scp ./dirdef/hunterdef01.defs [email protected]:/u01/gg/dirdef
rep参数中添加
REPLICAT RORAKK
USERID system, PASSWORD oracle
HANDLECOLLISIONS
--ASSUMETARGETDEFS
DISCARDFILE ./dirrpt/RORAKK.DSC, PURGE
--MAP gguser.tcustmer, TARGET gguser.tcustmer;
--MAP gguser.tcustord, TARGET gguser.tcustord;
SourceDefs /u01/gg/dirdef/hunterdef01.defs
MAP gguser.hlq, TARGET gguser.hunter,
COLMAP(USEDEFAULTS,xingming=name);
3.进程维护:
删除extract、data pump、replicat进程,要以ogg的同步用户登录,
删除进程一般用于重建同步环境,删除进程不删除参数文件,可以手动删除
delete ext ett;
delete rep rpp;
进程修改:
alter extract ett extseqno 0753 , extrba 0
start ett;
本文出自 “hunter的Oracle世界” 博客,转载请与作者联系!