The example is test with the following setup:
- Source: Informix IDS 12.10 (on Windows)
- Target: Oracle 11.2.1.0.4 (on LINUX)
The sample code is available for download at ggs_informix_example.zip.
Step 1: Creating the Tables
1. On the Informix IDS source, run the src_create_tbl.sql and src_load_data.sql to create example database (SOURCEDB), a table (TABLE1) and load the sample data (10 records).
[informix@ogg-1 demo_01]$ dbaccess <C:\Users\JIWANG\ggs_informix_example\informix_src\src_create_tbl.sql
...
Database selected.
Table created.
Database closed.
[informix@ogg-1 demo_01]$ dbaccess <C:\Users\JIWANG\ggs_informix_example\informix_src\src_load_data.sql
2.On the Oracle DB target, create the Oracle Database table:
grant connect, resource to ggdemo identified by ggdemo;
grant dba to ggdemo;
connect ggdemo/ggdemo
create table table1(
col1 number not null,
col3 varchar(10),
PRIMARY KEY (col1));
Step 2: Creating Defgen File
Defgen is required for the current GoldenGate versions for replication in heterogeneous environment.
GGSCI> edit param defgen
DEFSFILE ./dirdef/cap01.def,PURGE
sourcedb ol_informix1210
TABLE sourcedb.jiwang.mytbl1;
GGSCI 69> sh defgen paramfile dirprm/defgen.prm
After the defgen file is created, you need to copy the defgenfile to the dirdef folder in Oracle GoldenGate for Oracle.
Step 3: Creating Initial Loading
1. Creating the Initial Loading Extract on Informix IDS source
GGSCI > edit param capini02
extract capini02
sourcedb ol_informix1210
rmthost 144.25.0.109, mgrport 7020
rmttask replicat, group repini02
TABLE sourcedb.jiwang.table1;
Note that here we connect to the Oracle GoldenGate for Oracle instance (on IP 144.25.0.109) with manager port to be 7020. The RMTTASK parameter specify the replicat group name on GoldenGate for Oracle side.
GGSCI> add ext capini02, vam, sourceistable
EXTRACT added.
GGSCI> info capini02
EEXTRACT CAPINI02 Initialized 2015-02-25 15:10 Status STOPPED
Checkpoint Lag Not Available
Log Read Checkpoint Not Available
First Record Record 0
Task SOURCEISTABLE
Note: The initial loading groups will note be shown in the "info all' command. You have to use "info <extract_name>" or "info <replicat_name>".
2. Creating the initial loading replicat on Oracle DB target
GGSCI> edit param replicat repini02
replicat repini02
userid ggdemo, password ggdemo
sourcedefs ./dirdef/cap01.def
GETTRUNCATES
discardfile ./dirrpt/rep010001.dsc, purge
map sourcedb.jiwang.table1, target ggdemo.table1;
GGSCI> add replicat repini02, specialrun
GGSCI> info repini02
REPLICAT REPINI02 Initialized 2015-02-25 18:14 Status STOPPED
Checkpoint Lag 00:00:00 (updated 00:00:07 ago)
Log Read Checkpoint Not Available
Task SPECIALRUN
Step 4: Start the Initial Loading
On the Informix source run the following command:
GGSCI> start capini02
The specialrun replicat group will be launched automatically. After completing the process, the extract and replicat processes are shutdown automatically. You should see 10 records added to the Oracle database TABLE1 table.
----- End of File -----