Oracle GoldenGate Configuration-列不对称带有常量的配置

Oracle GoldenGate Configuration



Source:Oracle

create table t01(id int primary key,name varchar2(20));
alter table t01 add supplemental log data (all) columns;

Source:OGG



GGSCI (primary) 1> dblogin userid system,password oracle
Successfully logged into database.
GGSCI (primary) 2> add trandata gg.t01
Logging of supplemental redo data enabled for table GG.T01.
GGSCI (primary) 3> add extract e1,tranlog,begin now
EXTRACT added.
GGSCI (primary) 4> add exttrail ./dirdat/a1,extract e1  
EXTTRAIL added.
GGSCI (primary) 5>  edit params e1  


EXTRACT E1
setenv (NLS_LANG=American_america.zhs16gbk)
DBOPTIONS ALLOWUNUSEDCOLUMN
USERID system, PASSWORD "oracle"
EXTTRAIL ./dirdat/a1
TABLE gg.t01;


GGSCI (primary) 6> add extract d1,exttrailsource ./dirdat/a1
EXTRACT added.
GGSCI (primary) 7> add rmttrail ./dirdat/a1, extract d1  
RMTTRAIL added.
GGSCI (primary) 8> edit params d1


EXTRACT D1
setenv (NLS_LANG=American_america.zhs16gbk)
USERID system,PASSWORD oracle
rmthost 192.168.1.11 mgrport 7089,compress
rmttrail ./dirdat/a1
passthru
TABLE gg.t01;


Target:Oracle



create table t02 (
id int,
name varchar2(20),
cdate date,
constraint pk_t02 primary key(id,cdate)
);




Target:OGG



GGSCI (primary) 1> dblogin userid system,password oracle
Successfully logged into database.
GGSCI (primary) 2> add replicat r1,exttrail ./dirdat/a1
REPLICAT added.
GGSCI (primary) 3> edit params r1


REPLICAT R1
setenv (NLS_LANG=American_america.zhs16gbk)
USERID system, PASSWORD oracle
ASSUMETARGETDEFS
DISCARDFILE ./dirrpt/r1.DSC, PURGE
map gg.t01, target gg.t02,keycols(id),colmap (USEDEFAULTS,cdate  =@datenow());






test case 1:Insert



Source:Oracle

SQL> insert into t01 values(1,'a');
1 row created.
SQL> commit;
Commit complete.
SQL> select * from t01;
        ID NAME
---------- ----------------------------------------
         1 a


Target:Oracle

SQL> select * from t02;
        ID NAME                                     CDATE
---------- ---------------------------------------- ------------
         1 a                                        11-NOV-14




test case 2:Update

Source:Oracle

SQL> update t01 set name='aa' where id=1;
1 row updated.
SQL> commit;
Commit complete.
SQL> select * from t01;
        ID NAME
---------- ----------------------------------------
         1 aa


Target:Oracle

SQL> select * from t02;
        ID NAME                                     CDATE
---------- ---------------------------------------- ------------
         1 aa                                       11-NOV-14


test case 3:Delete

Source:Oracle

SQL> delete from t01 where id=1;
1 row deleted.
SQL> commit;
Commit complete.
SQL> select * from t01;
no rows selected

Target:Oracle

SQL> select * from t02;

no rows selected




HANDLECOLLISIONS  含义
Missing updates are ignored.
Missing deletes are ignored.
Duplicate inserts are turned into updates.



你可能感兴趣的:(Oracle,Goldengate)