-bash-4.1$ id aime3
uid=94113(aime3) gid=42424(svrtech) groups=8501(oper),8500(dba),59031(informix),42424(svrtech),34234(aimegrp)
-bash-4.1$ id aime2
uid=94112(aime2) gid=42424(svrtech) groups=8501(oper),8500(dba),59031(informix),42424(svrtech),34234(aimegrp)
From the result, you can see that the user id for aime2 is 94211 and aime3 is 94113.
Next, let's create the example database tables. The SQL files are shown as follows:
atssrc database (src.sql):
drop table informix.mytables1;
create table informix.mytables1 (
account_no decimal (10,0) not null,
snaps varchar (254) ,
balance money ,
primary key (account_no) );
atstgt database (tgt.sql)
drop table informix.mytable112;
create table informix.mytable112 (
account_no decimal (10,0) not null,
snaps varchar (254) ,
balance money ,
primary key (account_no) );
To create the tables, simply run the following command in the Oracle GoldenGate home directory:
sh dbaccess atssrc < ./dirsql/src.sql
sh dbaccess atstgt < ./dirsql/tgt.sql
Then, you can create the defgen files. The defgen configuration file are shown as follows.
atssrc database (defgensourc.prm)
DEFSFILE dirdef/INFORMIXEXCLUDEUSER1.def, purge
sourcedb syscdcv1 userid aime2, password coolkid2
table atssrc.informix.mytables1;
atstgt database (defgentgt.prm)
DEFSFILE dirdef/EXCLUDEUSER1.def, purge
sourcedb syscdcv1 userid aime3, password coolkid3
table atstgt.informix.mytable112;
To create the defgen files, you can run the following commands:
sh ./defgen pf ./dirprm/defgensourc.prm
sh ./defgen pf ./dirprm/defgentgt.prm
You need to make sure that the generated defgen files are accessible by the replicat group paired with the extract. Then, you can create the extract and repliat group shown as follows:
With this setup, you should see all of the replications are up and running and are shown as follows:
Oracle GoldenGate Command Interpreter for Informix
Version 12.1.2.1.1 19797716 OGGCORE_12.1.2.1.1_PLATFORMS_141030.1944
Linux, x64, 64bit (optimized), Informix_SDK410 on Oct 30 2014 23:15:54
Operating system character set identified as UTF-8.
Copyright (C) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
GGSCI (adc6260071) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING ES1 00:00:00 00:00:06
EXTRACT RUNNING ET1 00:00:00 00:00:03
REPLICAT RUNNING RS2 00:00:00 00:00:03
REPLICAT RUNNING RT1 00:00:00 00:00:07
You can review the report file using the following commands:
view report ES1
view report RT1
view report ET1
view report RS2
Note that, the report file not only explains the configuration but also shows the current reading point in the logical log files:
2014-12-02 18:53:34 INFO OGG-01517 Position of first record processed LSN: 13:0Xf43f018, Dec 2, 2014 6:53:34 PM.
2014-12-02 18:53:34 INFO OGG-06507 MAPTABLE resolved (entry atssrc.informix.mytables1): table atssrc.informix.mytables1.
2014-12-02 18:53:34 INFO OGG-06509 Using the following key columns for source table atssrc.informix.mytables1: account_no. OVERWRITE, COLS (row1),
Then you can perform some SQL operations such as:
INSERT INTO informix.mytables1 values (1,'informix', 1000.0);
INSERT INTO informix.mytables1 values (2,'informix', 1000.0);
INSERT INTO informix.mytables1 values (3,'informix', 1000.0);
You can find out the data is replicated to the target.
Hope you find this tutorial useful. To download the example source code or send comments, please follow me @jinyu512 at twitter. Thanks .