Professional Documents
Culture Documents
ODI+OGG Integration
ODI+OGG Integration
Integrating Oracle Data Integrator 12c (ODI) and Oracle GoldenGate 12c (OGG)
Overview
Purpose
This tutorial covers integrating Oracle Goldengate (OGG) with Oracle Data Integrator 12c (ODI). ODI knows about and can control OGG, OGG does not know about ODI.
Time to Complete
Approximately 2 hours, depending on whether you use the pre-built VM or not (see Software Requirements below).
Introduction
In this tutorial, you will create the sample database users and tables, configure the OGG manager and agents, configure the ODI data servers, models, datastores, maps, agents, and
packages, and then start/stop/control the processes. There will be both OGG replication (capture and delivery) and ODI replication (Change Data Capture via Journaling). The OGG will
run near-real-time, the ODI will run in micro-batches of one row of changed data polling once/second.
Scenario
Suppose the Example Corporation has an Orders Application system that has a Customer table. You want to keep an up-to-date copy of that information on the Sales administration
system. As changes are made to the Orders Customer table, OGG in near-real-time replicates those changes to the Sales Customer table. However, the Sales system requires the format
of the data to be transformed into a slightly different layout. ODI will do the transformation of only the rows that have changed.
When showing terminal sessions of the above scenario, the logical and physical E-LT flow will be as follows:
Source will be the Orders Application OGG_ODI_DEMO_SRC.OGG_CUSTOMER table shown with a BLUE banner.
Staging will be the Sales Administration ODI_DEMO.OGG_CUSTOMER table shown with a RED banner.
Target will be the Sales Administration ODI_DEMO.TRG_CUSTOMER table shown with a GREEN banner.
There are two ways you can do this tutorial: either install all the software yourself on your own host(s), or use a virtual machine (VM) with most everything pre-installed. The advantage of
the VM is, of course, that it is easier and faster, but it may not exactly represent your final environment, in which case you may want to go through the extra steps to install everything
yourself. The tutorial will assume you are using the VM, but will include some of the extra steps for the recreating preinstalled bits.
Hardware
If you are using the VM, it requires 4 GB itself, usually hosted on a PC with 8 GB total. The VM assumes a host PC with 4 CPUs; you may need to adjust that down if you
have fewer real CPUs. The VM works fine with 2 CPUs.
If you are running the software on a real host(s), you need enough RAM to support the processes. If you have multiple hosts, the RAM can be distributed per host.
Each DB requires at least 1 GB (Enterprise Edition (EE) may require 2 GB)
Each OGG instance requires at least 1 GB
ODI requires at least 1 GB
The OS requires at least 1 GB. More is better.
Enough disk to support the installs, including unzipping the images.
Software
If you are using the VM, you will need:
The Oracle VirtualBox player
The VM image (approx 9 GB)
The demo VM Getting Started with ODI 12c guide.
If you are installing the software yourself in Standalone mode, you will need:
Three heterogeneous databases (ideally). For example, the source could be MySQL, the staging could be Oracle 11g XE, the target could be Oracle 12c EE version
12.1. In this VM, the single database is Oracle 11g EE version 11.2.0.4.
Two identical copies of Oracle GoldenGate. In this example, the tutorial is using version is 12.1.2.0.0.
One Oracle Data Integrator. In this example, the tutorial is using version is 12.1.3.
Two copies of Java: the one that comes with OGG (for the JAgent), and JDK version 1.7.0_15 or higher for the ODI Agent.
An OS. In this example, the tutorial is using Oracle Enterprise Linux (64-bit) 2.6.32-300.39.5
Optional software to install in Java EE mode (not present in the VM):
One Oracle WebLogic Server 12c. This affects how the ODI Agents are deployed. The VM is not using WLS.
Prerequisites
Have access to or have installed Oracle Data Integrator 12c. The prerequisites for that are a FMW home with WLS installed, a database with RCU configured to create the ODI
repositories.
Have access to or have installed sample schemas and repositories. This example uses the ODI_DEMO schema which is available online at: ODI Getting Started. If you are using the
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 1/47
7/13/2019 ODI+OGG Integration
VM, then this schema is already included.
Normally an ODI environment would have two or three hosts. The source database would be on one host (usually the smaller host) and the target database on another host (usually the
larger host). The staging area would be on the more powerful of the two hosts, or possibly on a third host. The configuration used for this demonstration was done on one large host
(rather unusual), so there are some issues with multiple $ORA_HOME definitions that would not normally surface in a "real" environment.
In order to prepare the databases for E-LT (Extract-Load-Transform), perform the following steps:
Depending on your source database technology, the DDL commands will change slightly. To simplify things, the foreign key dependencies will not be enforced at the database level.
Table created.
Table created.
SQL_SOURCE >
In real life you would also set up foreign key relationships to other tables.
2. Populate the source table. (There is a procedure supplied in the VM to do this any time later in the lab.)
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 2/47
7/13/2019 ODI+OGG Integration
SQL_SOURCE >
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (101,'Brendt','Paul',19,107,10,0,'10 Jasper Blvd.','(212) 555 2146');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (102,'McCarthy','Robin',29,11,11,0,'27 Pasadena Drive','(214) 555 3075');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (103,'Travis','Peter',34,12,12,0,'7835 Hartford Drive','(510) 555 4448');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (104,'Larson','Joe',45,13,13,0,'87 Carmel Blvd.','(213) 555 5095');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (105,'Goldschmidt','Tony',55,14,20,0,'91 Torre drive','(619) 555 6529');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (106,'Baker','William',64,15,21,0,'2890 Grant Avenue','(312) 555 7040');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (107,'Swenson','Jack',74,19,22,0,'64 Imagination Drive','(202) 555 8125');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (201,'Sartois','Jean',19,25,30,0,'71 rue Rousseau','79 23 26 23');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (202,'Michaud','Philippe',22,23,31,0,'197 impasse Renoir','78 21 86 20');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (203,'Robert','Christian',38,208,32,0,'1rue Cezanne','42 25 27 29');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (204,'Martin','Christine',42,24,40,1,'12 allee Victor Hugo','25 26 46 26');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (205,'Piaget','Luc',56,29,41,0,'38 allee des Saules','53 42 24 28');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (206,'Gentil','Michele',67,25,11,1,'17montee des Chenes','65 62 26 13');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (207,'Dupont','Marie-Chantale',72,20,50,1,'37 rue Murat','46 72 23 53');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (301,'Edwards','Caroline',18,35,51,1,'68 Downing Street','243867945');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (302,'Marlow','Justin',29,32,52,0,'290 Yorkshire Drive','653643634');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (303,'Wilson','John',34,33,11,0,'28 Sutton Row','158746231');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (304,'McCartney','George',47,34,11,0,'45 Glenthorne Road','323768678');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (305,'Keegan','Hariett',56,35,11,1,'10 Hamilton Park','566344643');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (306,'Jones','Mary',68,36,31,1,'34 Apple Grove','143546456');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (307,'Hopkins','Priscilla',73,38,302,2,'The Gables','634634643');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (401,'Diemers','Erika',18,51,40,2,'Wiesenstrasse 40','235345');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (402,'Schiller','Jurgen',24,52,41,0,'Auf dem Rain 4','142352');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (403,'Durnstein','Adolph',36,53,101,0,'Thomashof 22','745464');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (404,'Weimar','Hans',45,54,50,0,'Goethering 33','346636');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (405,'Schultz','Herbert',59,55,51,0,'Am Holzbach 17','256346');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (406,'Titzman','Silke',63,56,52,0,'Berliner Ring 56','235463');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (407,'Reinman','Heineke',72,55,32,2,'Yorkstrasse 75','234646');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (501,'Arai','Toshihijo',18,70,40,0,'941 Toyota Ave','34784597');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (502,'Kamata','Mariko',24,71,41,0,'70 Kiroto Street','57687462');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (503,'Kamimura','Satoru',38,72,42,0,'34 Kawasaki Avenue','26475684');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (504,'Makino','Tatsuo',45,70,50,0,'2435 Toyota Ave','34413486');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (505,'Mukumoto','Masayuki',59,73,51,0,'59 Yamamoto Blvd','34827691');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (506,'Oneda','Kenji',68,70,52,0,'94 Toyota Blvd','51839463');
insert into SRC_CUSTOMER(CUSTID, LAST_NAME, FIRST_NAME, AGE, CITY_ID, SALES_PERS_ID, DEAR, ADDRESS, PHONE)
values (507,'Okumura','Isao',74,74,21,0,'3 Toyota Ave','48928371');
COMMIT;
35 rows created.
If you want to make sure they worked, you can: SELECT * FROM SRC_CUSTOMER;
Normally the source, staging, and target databases would be heterogenous (for example, Oracle and MySQL, Oracle and DB2, or even Oracle EE and Oracle XE, and so on). In this
tutorial, they are all in one large database separated only by schema. Depending on your staging database technology, the DDL commands will change slightly. You cannot reverse
engineer a schema for the database, only for ODI. So you need to redefine the tables here as well. The difference is you do not have to populate them from SQL, you can populate them
from ODI as a simple map.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 3/47
7/13/2019 ODI+OGG Integration
If you are using the pre-configured VM, skip to step 1.3.
1. Create the staging table. It will be exactly the same as the source table.
ODI Staging
Table created.
SQL_STAGE >
For the same reason you needed to define the schema on the staging database, you need to define it on the target database as well. Depending on your staging database technology, the
DDL commands will change slightly.
Table created.
SQL_TARGET >
Normally an OGG environment would have two or more hosts. The source database would be on one host and the target database on another host. The configuration used for this
demonstration was done on one large host (rather unusual), so there are some issues with multiple $OGG_HOME definitions that would not normally surface in a "real" environment. To solve
this on one host, OGG must be completely installed twice, the two instances cannot share any code.
How to install OGG is covered in other OBEs. For this demo, the OGG source is the ODI staging database. Configure the source MANAGER and JAGENT processes to talk with ODI.
1. Configure (or verify) the source Global commands and GLOBALS file. Edit the file to look like the following view.
OGG Source
It is a good convention to have comments with the double-dashes as the first few lines in a parameter file. The keywords (for example, EnableMonitoring) are case-
insensitive, so EnableMonitoring is the same as ENABLEMONITORING is the same as enablemonitoring. For readability, you may want to use MixedCase by word.
2. Configure (or verify) the source Manager and mgr.prm file. Edit the file to look like the following view. (You may want to issue the GGSCI command set editor gedit if you don't
like to use vi.)
OGG Source
3. Configure (or verify) the source Java Agent and jagent.prm file. Edit the file to look like the following view.
OGG Source
The source and target jagent.prm files are the same (except for the comments).
4. Configure (or verify) the source JAgent configuration and ./cfg/Config.properties file.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 5/47
7/13/2019 ODI+OGG Integration
OGG Source
[myuser@myhost ogg_src]$
The reason you need to exit GGSCI is so that the new parameters can take effect the next time you start GGSCI.
You also need to DBLogin and then Add TranData for any tables that OGG will extract from. The source GoldenGate instance is now prepared.
How to install OGG is covered in other OBEs. For this demo, the OGG target is the ODI target database. Configure the target MANAGER and JAGENT processes to communicate with ODI.
1. Configure (or verify) the target Global commands and GLOBALS file. Edit the file to look like the following view.
OGG Target
The GLOBALS file is the same for OGG source and target.
2. Configure (or verify) the target Manager and mgr.prm file. Edit the file to look like the following view. (You may want to issue the GGSCI command set editor gedit if you don't
like to use vi.)
OGG Target
The Ports must be unique (if on the same host) for OGG source versus target in the mgr.prm files.
3. Configure (or verify) the target Java Agent and jagent.prm file. Edit the file to look like the following view.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 6/47
7/13/2019 ODI+OGG Integration
OGG Target
The jagent.prm file is the same for OGG source and target.
4. Configure (or verify) the target JAgent configuration and ./cfg/Config.properties file.
OGG Target
[myuser@myhost ogg_trg]$
Note the only difference between source and target Config.properties file is the jagent.rmi.port values must be unique (if on the same host), all other values are the
same.
The reason you need to exit GGSCI is so that the new parameters can take effect the next time you start GGSCI.
ODI communicates with OGG through agents, so you need to create physical and logical entries for those. In addition, the models and datastores to be replicated need to be defined.
1. Start ODI Studio. If there is a dekstop icon, click it; otherwise do the following commands:
OGG Target
2. Click Connect to Repository, select ODI and OGG Getting Started. The user is SUPERVISOR and the Password is welcome1. Click OK to continue.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 7/47
7/13/2019 ODI+OGG Integration
3. Go to the Topology Navigator tab, and expand Physical Architecture > Technologies > Oracle GoldenGate, right-click, then New Data Server.
If the OGG_Source and OGG_Target already exist, then open them to verify that they match the screens shown.
4. On the JAgent tab, create (or verify) the OGG_Source JAgent Server.
The RMI Port 5559 should match the value in OGG source Config.properties, the Manager Port 7010 should match the value in OGG source mgr.prm. Save and close
the New Data Server OGG_Source tab.
5. On the JAgent tab, create (or verify) the OGG_Target JAgent Server.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 8/47
7/13/2019 ODI+OGG Integration
The RMI Port 5561 should match the value in OGG target Config.properties, the Manager Port 7020 should match the value in OGG target mgr.prm. Save and close
the New Data Server OGG_Target tab.
1. Go to the Topology Navigator tab, and expand Physical Architecture > Technologies > Oracle, right-click, then New Data Server.
If SRC_ODIDEMO and TRG_ODIDEMO already exist, then open them to verify that they match the screens shown.
2. On the Definition tab, create (or verify) the SRC_ODIDEMO Data Server.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 9/47
7/13/2019 ODI+OGG Integration
3. On the JDBC tab, create (or verify) the JDBC Driver and JDBC URL.
Be careful not to lose the colons between the parameters (they are hard to see...)
4. Test JDBC connectivity by clicking Test Connection . You will see this pop-up:
5. On the Definition tab, create (or verify) the TRG_ODIDEMO Data Server.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 10/47
7/13/2019 ODI+OGG Integration
6. On the JDBC tab, create (or verify) the JDBC Driver and JDBC URL.
Be careful not to lose the colons between the parameters (they are hard to see...)
7. Test JDBC connectivity by clicking Test Connection . You will see this pop-up:
The Physical Architecture is only half of the Topology definition. You still have to do the Logical Architecture.
9. Go to the Topology Navigator tab, and expand Logical Architecture > Technologies > Oracle, right-click, then New Logical Schema.
You are going to do this three times for three logical schemas.
10. Create a Logical Schema named ODI_DEMO_SRC with a Context of Global and a Physical Schema of SRC_ODIDEMO.ODI_DEMO as shown.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 11/47
7/13/2019 ODI+OGG Integration
11. Create a Logical Schema named ODI_DEMO_TRG with a Context of Global and a Physical Schema of TRG_ODIDEMO.ODI_DEMO as shown.
12. Create a Logical Schema named OGG_ODI_DEMO_SRC with a Context of Global and a Physical Schema of SRC_ODIDEMO.OGG_ODI_DEMO_SRC as shown.
13. When you are all done, it should look like this:
In the demo VM, all three of these Logical Schemas are on the same database on the same host in the same context. That is very unusual. In real life they would probably
be on different hosts or at least different technologies.
The ODI Data Servers now have physical and logical definitions.
1. Go to the Designer Navigator tab, and expand Models, click the pull-down and select New Model Folder.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 12/47
7/13/2019 ODI+OGG Integration
The Description is optional. It is a good convention to put the modification history in here. Save your work. Close the Model Folder tab.
3. Returning to the Designer tab, click the pull-down again and select New Model.
Note that new with ODI version 12.1.3 is the option to do all this on one screen: the New Model and Topology Objects screen.
Save your work. Click Reverse Engineer to read the table metadata. You will see the following pop-up briefly:
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 13/47
7/13/2019 ODI+OGG Integration
Save your work. Click Reverse Engineer to read the table metadata. You will see the following pop-up briefly:
You may have additional datastores (tables) as well. The three datastores that you care about are:
Populating the Staging table can be done using either the OGG Initial Load or the ODI simple mapping. For simplicity, the tutorial will use the ODI method.
If you are using the pre-configured VM, skip to step 3.4.6. then 3.4.14.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 14/47
7/13/2019 ODI+OGG Integration
1. Go to the Designer Navigator tab, and expand Projects, click the pull-down and select New Project.
5. Click the pull-down and select New Folder again. Name the folder Sync data.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 15/47
7/13/2019 ODI+OGG Integration
The VM already has these folders populated. But if you are just now creating them then all the folders in this project are empty, but have placeholders for mappings,
packages, procedures, and so on.
CKM Oracle
IKM Oracle Incremental Update
IKM SQL Control Append
JKM Oracle to Oracle Consistent (OGG Online)
You may accidentally import CKM Hive (a known bug), you can safely ignore it.
9. Expand all the Knowledge Modules, and it should look like this:
Next you will create a mapping to do the initial load of Sales Administration OGG_CUSTOMER table.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 16/47
7/13/2019 ODI+OGG Integration
11. Still on the Designer Navigator tab, expand Models > ODI_DEMO > Orders Application and also expand Sales Administration.
a. Drag both OGG_CUSTOMER datastores onto the workspace. Make sure the Orders one is on the left and the Sales one is on the right.
b. Hook the output of the source to the input of the target.
c. Accept Auto Mapping of Attributes.
You can check which OGG_CUSTOMER is which by clicking the title bar and looking at the Properties > General.
12. Select the target OGG_CUSTOMER title bar and change the Target > Integration Type to Control Append.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 17/47
7/13/2019 ODI+OGG Integration
13. Select the Physical tab, then select (indicated by six grey dots) target OGG_CUSTOMER_AP (AP=Access Point, indicated by the added red box). In Properties, change the
Loading Knowledge Module to LKM Oracle to Oracle Pull (DB Link).GLOBAL.
If it already is LKM Oracle to Oracle Pull (DB Link).GLOBAL, then just confirm it. Save your work, but leave the tab open.
14. Click Run in the top menu bar to run the mapping to populate the table.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 18/47
7/13/2019 ODI+OGG Integration
15. Go to the Operator Navigator tab, and expand Session List > Agent > Local > ?? - Initial Load Staging. Make sure that the overall mapping was successful. The "??" on this
example is 60, your number may be different.
It is common for certain Drop functions to give a warning if the object to be dropped is already gone. You can ignore those warnings.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 19/47
7/13/2019 ODI+OGG Integration
18. If you are using the VM, you can use the enclosed ODI and OGG Demo Client to see that two of the three customer tables are populated.
Populating the Target table is more complex than the Staging table because it has a different structure: it has built-in foreign key (FK) references (e.g. CITY_ID) as well as column
transformations (e.g. CUST_NAME=FIRST_NAME||LAST_NAME). For simplicity, the tutorial will assume you have the VM and can run the pre-existing mappings and procedures.
If you are not using the pre-configured VM, then your tables do not have the FK references and you can do a simple mapping of some of the attributes (and others will just have to go
blank for this demo).
1. Go to the Designer Navigator tab, and expand Load Plans and Scenarios, select LOAD_REFERENCE_DATA Version 001. Click Run in the top menu bar to run the
mapping to populate the referenced tables such as TRG_CITY.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 20/47
7/13/2019 ODI+OGG Integration
3. Go to the Operator Navigator tab, click Refresh . Expand Session List > Agent > Local > ?? - LOAD_REFERENCE_DATA. Make sure that the overall mapping was
successful. The "??" on this example is 50, your number may be different.
Even though the overall success was Warning , the individual elements were all successful .
4. Go to the Designer Navigator tab, and expand Projects > Sync Data > Mappings, then select Load TRG_CUSTOMER. Click Run in the top menu bar to run the mapping
to populate the target table TRG_CUSTOMER.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 21/47
7/13/2019 ODI+OGG Integration
Notice this Physical Mapping Design: Bulk Load, whereas the previous one was Physical Mapping Design: Physical.
6. Go to the Operator Navigator tab, click Refresh . Expand Session List > Agent > Local > ?? - Load TRG_CUSTOMER_Bulk Load. Make sure that the overall mapping
was successful. The "??" on this example is 62, your number may be different.
Even though the overall success was Warning , the individual elements were all successful .
7. Use SQL*Plus or the enclosed ODI and OGG Demo Client to see that all three customer tables are populated.
Note that CUST_NAME is concatenated from FIRST_NAME||UPPER(LAST_NAME), and DEAR is resolved into Mr., Mrs., and so on. Also, a few of the rows are missing from the
target: 203, 207, and so on.
ODI communicates with OGG via agents. The agents are defined by keywords in an ASCII text file. ODI configures an extract, datapump, and replicat via the Studio GUI. This creates the
text files mentioned previously. ODI places the text files in their proper OGG directories.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 22/47
7/13/2019 ODI+OGG Integration
1. Go to the Topology Navigator tab, and expand Physical Architecture > Technologies Double-click Oracle GoldenGate.
There are lots of options you can configure, but the most important is Technology Type: ODI Connector.
2. Expand Oracle GoldenGate > OGG_Source, then open (double-click) CAP (capture, also known as extract). The difference between CAP and CAP_IL is the "_IL" suffix stands
for "Initial Load." This demonstration uses an ODI mapping rather than OGG's _IL here to do the initial load. You can use either one.
Note the Trail File Paths and file suffixes you pick, such as oc (odi capture) and op (odi pump).
3. Expand Logical Architecture > Technologies > Oracle GoldenGate, and open (double-click) CAP_LS (abbreviation for CAPture Logical Schema). It should look ike this:
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 23/47
7/13/2019 ODI+OGG Integration
The OGG extract (CAPture) and datapump (DELivery) are now configured as both physical and logical entities.
1. Go to the Topology Navigator tab, and expand Physical Architecture > Technologies > Oracle GoldenGate > OGG_Target, then open (double-click) DEL (Delivery, also
known as replicat). The difference between DEL and DEL_IL is the "_IL" suffix stands for "Initial Load."
Note the Trail File Paths and file suffixes that match capture, such as op (odi pump).
2. Expand Logical Architecture > Technologies > Oracle GoldenGate, and open (double-click) DEL_LS (abbreviation for DELivery Logical Schema).
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 24/47
7/13/2019 ODI+OGG Integration
The OGG replicat (DELivery) is now configured as both a physical and logical entity.
1. Start source processes. In the future you can make them auto-start or auto-restart.
OGG Source
If you are curious, you could try GGSCI > sh ps -ef | grep jagent to see what processes were started.
OGG Target
3. Go to ODI Studio, the Topology Navigator tab, and expand Physical Architecture > Technologies > Oracle GoldenGate. Double-click OGG_Source, then
Test Connection to exercise the ODI to OGG source agent communication.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 25/47
7/13/2019 ODI+OGG Integration
4. Double-click OGG_Target, then Test Connection to exercise the ODI to OGG target agent communication.
Notice the RMI Port numbers and the Manager Port numbers are different for source and target. They match the values in the OGG cfg/Config.properties files.
You have started the Manager and JAgent processes, and defined (but not started) the extract and delivery processes.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 26/47
7/13/2019 ODI+OGG Integration
Change Data Capture (CDC) is configured with a Journalizing Knowledge Module (JKM). You define it for a model by adding subscribers, and then start it for a datastore. The transfer
from the Journal to a mapping is handled by a package in a loop.
If you are using the pre-configured VM, you still need to do this whole section.
1. Go to the Designer Navigator tab, and expand Models > ODI_DEMO. open (double-click) Orders Application.
2. Select the Journalizing tab. Note that the JKM is at the Model level, not the datastore level.
The Journalizing Mode: Consistent Set matches the JKM Oracle to Oracle Consistent. The (OGG Online) means that the ODI-created OGG parameter files are placed
into the OGG directories automatically rather than having to be copied manually.
The difference between CAP and CAP_IL is the "_IL" suffix stands for "Initial Load." This demonstration uses an ODI mapping rather than OGG's _IL here to do the initial
load. You can use either one.
3. Back on the Designer Navigator tab, right-click Orders Application, and select Changed Data Capture > Add to CDC.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 27/47
7/13/2019 ODI+OGG Integration
This will register all the datastores contained in that model into the ODI Changed Data Capture framework.
5. Right-click Orders Application, and select Changed Data Capture > Subscriber > Subscribe.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 28/47
7/13/2019 ODI+OGG Integration
A subscriber is an alias representing a process that is interested in changed data. Since you can have multiple processes interested in the same changed data, you can
define multiple subscribers. Each subscriber can move the changed data when needed without impacting the other ones.
Click OK to continue.
7. This starts a session that creates the journalizing environment and adds the user.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 29/47
7/13/2019 ODI+OGG Integration
Click OK to continue.
8. Go to the Operator Navigator tab, and click Refresh . Expand Session List > Agent > Local > ?? - Orders Application. Make sure that the overall mapping was successful.
The "??" on this example is 63, your number may be different.
9. Back on the Designer Navigator tab, right-click Orders Application, and select Changed Data Capture > Start Journal.
This starts a session that starts the journalizing environment. This is where the OGG CAPture and DELivery processes and parameter files are actually run. Confirm the
Run and Information pop-ups as you did in the previous step 7.
10. Go to the Operator Navigator tab, and click Refresh . Expand Session List > Agent > Local > ?? - Orders Application. Make sure that the overall mapping was successful.
The "??" on this example is 64, your number may be different.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 30/47
7/13/2019 ODI+OGG Integration
The warnings you may see are the tasks that were already completed in the previous step 8. For example, the Operator is telling you on line 5 that you cannot "create" a
subscribers table because there already is one. You can ignore all of the warnings here.
11. Depending on how you have your preferences set, you may or may not see a change in the icon for the datastore. If you want to see the icon indicating CDC activity, go to the
main (top) tool bar and click Tools > Preferences, then expand ODI > User Interface > Designer. Select Show the CDC Modifications in the tree.
Click OK to continue.
12. If you go back to the Designer tab, and expand Models > ODI_DEMO > Orders Application, you may see a very tiny change on the icon: a yellow clock face.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 31/47
7/13/2019 ODI+OGG Integration
You can see the clock better when it is enlarged to four times its normal size:
If the clock is yellow, that indicates waiting; a green clock indicates something else.
If you are using the pre-configured VM, you still need to do this whole section. It is mostly just looking at parameters.
1. Go to the Designer Navigator tab, and expand Projects > Sync Data > Mappings, then open (double-click) Load TRG_CUSTOMER. Select OGG_CUSTOMER and notice that the
Properties > Journalizing filter is for the subscriber you configured earlier: ODIDEMO.
Note that OGG_CUSTOMER used in this Mapping is coming from the Orders Applications source model. It is the actual source table and not the replicated copy used by OGG
(located in the Sales Administration model). ODI will transparently know which table to use based on the Journalizing settings of the Mapping.
2. Click the Physical tab. Click Trickle Feed to display the incremental load Physical Design.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 32/47
7/13/2019 ODI+OGG Integration
Bulk Load:
Does a bulk insert into TRG_CUSTOMER and was previously used to perform an initial load of the target table.
Trickle Feed:
Performs an incremental load of TRG_CUSTOMER using the changed data coming from OGG.
3. Select OGG_CUSTOMER. Notice that the Properties > General > Journalized Data Only is selected.
Even though the mapping says to use the source model, selecting Journalized Data Only causes ODI to use the target journal of only changed records.
The mapping has the power to do a transformation. That is why OGG alone is not a complete solution, you also need ODI.
Since ODI is inherently a batch system, to make it do a continuous delivery of changed records requires some kind of infinite loop. The way to do that is with a package.
1. Go to the Designer Navigator tab, and expand Projects > Sync Data > Packages, then open Sync Data.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 33/47
7/13/2019 ODI+OGG Integration
This package will run continuously. This package will wait for new changes to be replicated by OGG and upon detection it will move and transform the replicated data from
the staging table into the target table using ODI.
2. The ODI Tool step Wait for Changes is doing the CDC detection using OdiWaitForLogData. It is waiting for some changed records to be published by OGG.
Parameters of Note:
Global Row Count=1 says to only wait for one row to be changed before proceeding to the next step (i.e., a "micro-batch").
Polling Interval=1000 milliseconds, i.e., 1 second (basically near-real-time).
Logical Schema=ODI_DEMO_TRG and Subscriber=ODIDEMO match previous configuration values.
3. Once the detection of one changed row is successful, the next package step Extend and Lock will logically lock the records that will be moved for your ODIDEMO subscriber.
"Locking" is what makes this a Consistent Journalizing set versus a Simple set.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 34/47
7/13/2019 ODI+OGG Integration
Parameters of Note:
4. The Mapping Load TRG_CUSTOMER will load the changed data using the Trickle Feed physical design and the ODIDEMO Subscriber
It would be a good practice to have an unsuccessful path ("ko" red arrow) to trap possible errors.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 35/47
7/13/2019 ODI+OGG Integration
Parameters of Note:
6. The Package ends with a step executing a Scenario, the same scenario, recursively.
It allows essentially looping through the same Package creating a new Session for every execution. This is a best practice rather than creating the loop directly in the
Package as this allows you to better control the overall execution.
7. Go to the Designer Navigator tab, and expand Projects > Sync Data > Packages, then select Sync Data. Click Run in the top menu bar to run the package to move the
CDC journaling data to the target table
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 36/47
7/13/2019 ODI+OGG Integration
CDC journaling data to the target table.
8. Go to the Operator Navigator tab, click Refresh . Expand Session List > Agent > Local > ?? - Sync Data. Make sure that the package is running/waiting (green arrow ).
The "??" on this example is 65, your number may be different.
The ODI package is now configured and running in an infinite loop, waiting for records to deliver.
6. Test Everything
Now all the pieces are in place. Check what the ODI and OGG status looks like before anything has changed, then start changing data, and observe what changes.
1. Make sure the OGG Source Extract (CAPture) and Data Pump (DELivery) are created and Status=RUNNING.
OGG Source
These were created by ODI. If you are curious, you can do:
GGSCI > View Param CAP
GGSCI > View Param DELP
to see what was created.
2. Make sure the OGG Target Replicat (DELivery) is created and Status=RUNNING.
OGG Target
3. You can verify the contents of the tables with SQL*Plus, SQL Developer, or the Demo Client.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 37/47
7/13/2019 ODI+OGG Integration
y p
Note that customer 104 has a first name of Joe. It says so in all three tables.
Now you have seen what the processes and data looks like before anything has changed.
Do inserts, updates, and deletes on the OGG_ODI_DEMO_SRC.OGG_CUSTOMER source data, and watch it propagate through the system.
You can change the data with SQL*Plus, SQL Developer, or the Demo Client. You can change lots of values if you wish.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 38/47
7/13/2019 ODI+OGG Integration
The changes have replicated through OGG and then ODI CDC.
Sometimes DML breaks the OGG processes if they were mis-configured. Check thier Status.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 39/47
7/13/2019 ODI+OGG Integration
OGG Source
Output to /home/oracle/Oracle/Middleware/OGG_Source/dirdat/oc:
OGG Target
Even though the ODI CDC creates many sessions (micro-batches of 1 record each), OGG is just one big session.
The OGG processes are still running, waiting for more changes.
1. Note that EACH row changed in OGG_CUSTOMER creates a separate session (this behavior can be changed). The current session is always running/waiting, the previous sessions
are completed.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 40/47
7/13/2019 ODI+OGG Integration
You can see the five steps (numbered 0-4) of the SYNC_DATA package for each session.
OGG Source
***********************************************************************
Oracle GoldenGate Capture for Oracle
Version 12.1.2.0.0 17185003 OGGCORE_12.1.2.0.0_PLATFORMS_130924.1316_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Sep 25 2013 00:44:16
Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
Description:
***********************************************************************
** Running with the following parameters **
***********************************************************************
The report is incomplete (missing final statistics) until the CAP process is stopped.
3. Go to the Designer Navigator tab, and expand Models > ODI_DEMO > Orders Application. Right-click OGG_CUSTOMER and select Changed Data Capture > Journal
Data.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 41/47
7/13/2019 ODI+OGG Integration
This is not very interesting because no data shows up at this time! Had there not been a consumer, then the Journal would have the three prepended fields of Journal Flag
(Insert/Update/Delete), Date, and Subscriber, then the full row of new data for the table being captured. As it is, the data is in this journal for less than a second before being
consumed.
4. If you want to inspect the data with SQL*Plus, do the following queries:
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 42/47
7/13/2019 ODI+OGG Integration
The above is for the target table. All three should be the same, with a first name of Harry.
If the ODI side seems inefficient, you can always change the batch size to be increased from the current value of 1 to something larger, for example, 10.
7. Cleanup
At this point the OGG replication and the ODI CDC will continue to run/wait indefinitely (barring any error conditions). If you ever wish to stop it gracefully, perform the following steps:
1. Go to the Operator Navigator tab, click Refresh . Expand Session List > Agent > Local. Right-click the top-most ?? - Sync Data. Make sure that the package is
running/waiting with a green arrow . (The "??" on this example is 68, your number may be different.) Click Stop Immediate.
This stops the package abruptly, breaking out of the infinite loop.
Click OK to continue. It will show the package session as failing . That is normal in this kind of a stop.
2. You do not have to remove the objects from CDC, at this point they are stopped. if you did want to completely clean up, then you go through the same steps to remove from CDC
as you did to add it, only in reverse order. The order is important. You can do it at the datastore level or the model level. For the datastore: First drop the journal.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 43/47
7/13/2019 ODI+OGG Integration
3. Optionally you could have dropped the journals for all datastores in the model. Same process as for a datastore, only one level up.
5. Alternatively, you could have removed all datastores from CDC at the model level. Same process as for a datastore, only one level up.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 45/47
7/13/2019 ODI+OGG Integration
All objects have been removed from CDC. The tiny yellow clock icon should have been removed as well from the OGG_CUSTOMER label in the Models list.
Removing the models from the CDC on ODI will cause the OGG extract, datapump, and replicat processes to be stopped and removed. There is nothing more you need to do manually.
1. On the OGG source, note that the extract and datapump processes are stopped and removed (unregistered), but the parameter files persist. The manager and agents are left
running.
OGG Source
extract CAP
userid ODI_STAGING, password oracle
exttrail /home/oracle/Oracle/Middleware/OGG_Source/dirdat/oc
TABLE OGG_ODI_DEMO_SRC.OGG_CUSTOMER;
Note that the password is in clear text. You may want to change that to an alias if you have OGG version 12.1.2 or higher.
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 46/47
7/13/2019 ODI+OGG Integration
2. On the OGG target, note that the replicat process is stopped and removed (unregistered), but the parameter file persists.
OGG Target
replicat DEL1
userid ODI_STAGING, password oracle
discardfile , purge
sourcedefs /home/oracle/Oracle/Middleware/OGG_Target/dirdef/CAP.def
Note that the password is in clear text. You may want to change that to an alias if you have OGG version 12.1.2 or higher.
It might be a good idea to View Report CAP (the completed report) just to make sure that nothing unusual is in there.
Summary
Following the business scenario posed in the Introduction section, you had three databases (actually one database with three schemas): a source, staging, and target database being
used for E-LT. OGG was used to make an exact replicate of the OGG_CUSTOMER table, from schema OGG_ODI_DEMO_SRC on the source to schema ODI_DEMO on the staging database. Then
ODI was used to make a transformation from OGG_CUSTOMER table to TRG_CUSTOMER table, changing some columns on the fly. ODI was copying only changed (inserted, updated, or
deleted) rows in micro-batches of 1 every 1 second.
Resources
Credits
https://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/odi_12c/ogg_odi_12c_int/index.html 47/47