在这里贴一下,我的完整测试过程:
create table tabx(
fid number,
fcity varchar2(2),
fnum number,
ftime date,
fdes varchar2(200)
);
alter table TABX add constraint PK_TABX_FID primary key (FID);
> view params EXT1
extract ext1
dynamicresolution
userid ggs,password ggs
SETENV (NLS_LANG="AMERICAN_AMERICA.AL32UTF8")
SETENV (ORACLE_SID=jmdev)
SETENV (ORACLE_HOME="/u01/oracle/product/10.2.0/db_1")
discardfile ext1.dsc,append,megabytes 256
exttrail /u01/ggs/dirdat/ex,append,megabytes 1
NOCOMPRESSDELETES
table ua.tabx;
> view params PMP1
extract pmp1
dynamicresolution
userid ggs,password ggs
rmthost 192.168.5.224,mgrport 7809
rmttrail /u01/ggs/dirdat/rp
table ua.tabx, where (fcity <> "GZ");
> view params REP1
replicat rep1
userid ggs,password ggs
SETENV (NLS_LANG="AMERICAN_AMERICA.AL32UTF8")
SETENV (ORACLE_SID=jmdb2)
SETENV (ORACLE_HOME="/u01/oracle/product/10.2.0/db_1")
assumetargetdefs
reperror default,discard
discardfile /u01/ggs/dirrpt/rep1.dsc,append,megabytes 50
dynamicresolution
map ua.tabx, target ua.tabx;
在源端执行:
OGG> dblogin userid ggs,password ggs
OGG> add trandata ua.tabx, cols(fcity)
insert into tabx values (1, 'GZ', 1, sysdate, 'in gz no');
insert into tabx values (2, 'SZ', 2, sysdate, 'in sz ok');
insert into tabx values (3, 'FS', 3, sysdate, 'in fs ok');
commit;
第2、3条数据被同步到目标端。
update tabx set fnum =10 where fid = 2;
delete from tabx where fid = 3;
UPDATE、DELETE操作也被同步。