+ All Categories
Home > Documents > ODI+OGG Integration.pdf

ODI+OGG Integration.pdf

Date post: 01-Jun-2018
Category:
Upload: ramanana-ravelojaona
View: 247 times
Download: 0 times
Share this document with a friend

of 36

Transcript
  • 8/9/2019 ODI+OGG Integration.pdf

    1/36

    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.

    Hardware and Software Requirements

    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.

    The following is a list of hardware and software requirements:

    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

    Before starting this tutorial, you should:

    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 _DEMOschema which is available online at: ODI Getting Started. If you are using the 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.

    Integrating Oracle Data Integrator 12c (ODI) and Oracle GoldenGate 12c (OGG)

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    r 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    2/36

    If you are using the pre-configured VM, skip to step 1.2.

    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.

    Create the users and source table.

    In real life you would also set up foreign key relationships to other tables.

    1.

    Populate the source table. (There is a procedure supplied in the VM to do this any time later in the lab.)2.

    E-LT Source (OGG Source)

    [ myuser @myhost ~] $ sqlplus system/oracleSQL*Pl us: Rel ease 11. 2. 0. 4. 0 Product i on on Mon J ul 21 16: 40: 21 2014Copyri ght ( c) 1982, 2013, Oracl e. Al l ri ght s reserved.Connect ed t o:Or acl e Database 11g Ent erpri se Edi t i on Rel ease 11. 2. 0. 4. 0 - 64bi t Pr oducti onWi t h the Part i t i oni ng, OLAP, Data Mi ning and Real Appl i cati on Testi ng opt i ons

    SQL > create user odi_demo identified by oracle;User cr eat ed.

    SQL > create user prod_odi_repo identified by oracle;User cr eat ed.

    SQL > create user ogg_odi_demo_src identified by oracle;User cr eat ed.

    SQL > grant DBA to odi_demo, prod_odi_repo, ogg_odi_demo_src;Gr ant succeeded.

    SQL > set prompt SQL_SOURCE;

    SQL_SOURCE > conn odi_demo/oracleConnect ed.

    SQL_SOURCE > create table SRC_CUSTOMER (  CUSTID NUMBER(10) not null,

      DEAR NUMBER(1),

      LAST_NAME VARCHAR2(50),

      FIRST_NAME VARCHAR2(50),

      ADDRESS VARCHAR2(100),

      CITY_ID NUMBER(10),

      PHONE VARCHAR2(50),

      AGE NUMBER(3),

      SALES_PERS_ID NUMBER(10),

      constraint PK_SRC_CUSTOMER primary key (CUSTID)

    );

     Tabl e cr eated.

    SQL_SOURCE > conn ogg_odi_demo_src/oracleConnect ed.

    SQL_SOURCE > create table OGG_CUSTOMER (  CUSTID NUMBER(10,0) not null,

    DEAR NUMBER(1,0),

    LAST_NAME VARCHAR2(50),

    FIRST_NAME VARCHAR2(50),

     ADDRESS VARCHAR2(100),CITY_ID NUMBER(10,0),

    PHONE VARCHAR2(50),

     AGE NUMBER(3,0),

    SALES_PERS_ID NUMBER(10,0),

    constraint PK_OGG_CUSTOMER PRIMARY KEY (CUSTID)

    );

     Tabl e cr eated.

    SQL_SOURCE > 

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    r 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    3/36

    If you want to make sure they worked, you can: SELECT * FROM SRC_CUSTOMER;

    The source database is now prepared.

    1.2 Prepare Staging database

    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 f rom SQL, you can populate them from ODI as a simple

    map.

    If you are using the pre-configured VM, skip to step 1.3.

    Create the staging table. It will be exactly the same as the source table.1.

    E-LT Staging (ODI Source)

    SQL_SOURCE > conn odi_demo/oracleConnect ed.

    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 cr eated.

    SQL_SOURCE > exit 

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    r 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    4/36

    In real life you would also set up foreign key relationships.

    The staging database is now prepared.

    1.3 Prepare Target database

    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.

    If you are using the pre-configured VM, skip to step 2.1.

    Create one target table.

    In real life you would also set up foreign key relationships.

    1.

    The target database is now prepared.

    The databases are all prepared.

    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.

    2.1 Prepare Source GoldenGate

    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 J AGENT processes to talk with ODI.

    If you are using the pre-configured VM, skip to step 2.2.

    Configure (or verify) the source Global commands and GLOBALS file. Edit the file to look like the following view.1.

    ODI Staging

    [ myuser @myhost ~] $ sqlplus odi_demo/oracleSQL*Pl us: Rel ease xx. x. x. x. x Producti on on Mon dd hh: mm: ss yyyy

    SQL > set prompt SQL_STAGE;

    SQL_STAGE > create table OGG_CUSTOMER (  CUSTID NUMBER(10,0) not null,

    DEAR NUMBER(1,0),

    LAST_NAME VARCHAR2(50),FIRST_NAME VARCHAR2(50),

     ADDRESS VARCHAR2(100),

    CITY_ID NUMBER(10,0),

    PHONE VARCHAR2(50),

     AGE NUMBER(3,0),

    SALES_PERS_ID NUMBER(10,0),

    constraint PK_OGG_CUSTOMER PRIMARY KEY (CUSTID)

    );

     Tabl e cr eated.

    SQL_STAGE > create user odi_staging identified by oracle;User cr eat ed.

    SQL_STAGE > grant DBA to odi_staging;Gr ant succeeded.

    SQL_STAGE > 

    E-LT Target (ODI Target)

    [ myuser @myhost ~] $ sqlplus odi_demo/oracleSQL*Pl us: Rel ease xx. x. x. x. x Producti on on Mon dd hh: mm: ss yyyy

    SQL > set prompt SQL_TARGET;

    SQL_TARGET > create table TRG_CUSTOMER (  CUST_ID NUMERIC(10) not null,

      DEAR VARCHAR(4),

      CUST_NAME VARCHAR(50),

      ADDRESS VARCHAR(100),

      CITY_ID NUMERIC(10) not null,

      PHONE VARCHAR(50),

      AGE NUMERIC(3),

      AGE_RANGE VARCHAR(50),

      SALES_PERS VARCHAR(50),

      CRE_DATE DATE,

      UPD_DATE DATE,

      constraint PK_TRG_CUSTOMER primary key (CUST_ID)

    );

     Tabl e cr eated.

    SQL_TARGET > 

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    r 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    5/36

    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, Enabl eMoni t ori ng) are case-insensitive,

    so Enabl eMoni t ori ng is the same as ENABLEMONI TORI NG is the same as enabl emoni t ori ng. For readability, you may want to use MixedCase by word.

    Configure (or verify) the source Manager and mgr. prmfile. 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 .)

    The Port will match the ODI JAgent.

    2.

    Configure (or verify) the source Java Agent and j agent . prmfile. Edit the file to look like the following view.

    The source and target j agent . prmfiles are the same (except for the comments).

    3.

    Configure (or verify) the source JAgent configuration and . / cfg/Conf i g. propert i es file.

    The reason you need to exit GGSCI is so that the new parameters can take effect the next time you start GGSCI.

    4.

    You also need to DBLogi n and then Add Tr anDat a for any tables that OGG will extract from. The source GoldenGate instance is now prepared.

    2.2. Prepare Target GoldenGate

    OGG Source

    [ myuser @myhost ~] $ cd /home/oracle/Oracle/Middleware/OGG_Source[ myuser @myhost ogg_sr c] $ ./ggsciOr acl e Gol denGate Command I nter pret er f or Oracl eVers i on 12. 1. 2. 0. 0 17185003 OGGCORE_12. 1. 2. 0. 0_PLATFORMS_130924. 1316_FBOLi nux, x64, 64bi t ( opt i mi zed) , Or acl e 11g on Sep 25 2013 00:31: 13Operat i ng systemcharacter set i denti f i ed as UTF- 8.Copyri ght (C) 1995, 2013, Oracl e and/ or i ts aff i l i ates. Al l ri ghts reserved.

    GGSCI ( source) > sh gedit GLOBALSGGSCI ( source) > sh more GLOBALS- - GLOBALS on OGG Sour ce- - Conf i gur ed by J oe Admi n on 1/2/ 34EnableMonitoring

    GGSCI ( source) > 

    OGG Source

    GGSCI ( source) > edit param mgrGGSCI ( source) > view param mgr- - mgr. prm on OGG Sour ce- - Conf i gur ed by J oe Admi n on 1/2/ 34Port 7010

    GGSCI ( source) > 

    OGG Source

    GGSCI ( source) > edit param jagentGGSCI ( source) > view param jagent- - j agent . prm on OGG Source- - Conf i gur ed by J oe Admi n on 1/2/ 34COMMAND java -Dlog4j.configuration=file:./cfg/log4j.properties -jar -Xms64m -Xmx512m dirjar/jagent.jar

    GGSCI ( source) > 

    OGG Source

    GGSCI ( source) > sh gedit ./cfg/Config.propertiesGGSCI ( source) > sh more ./cfg/Config.properties###################################################################### j agent. host: Host name of t he machi ne where j Agent i s r unni ng ##### Note: Thi s host name has t o be r eachabl e f r om Moni t or Server ####################################################################### j agent. host =l ocal hostjagent.jmx.port=5555

    i nterval . regul ar=60

    i nterval . qui ck=30moni t or. host =l ocal host monitor.jmx.port=5502

    moni t or . j mx. user name=cmr oot j agent. ss l =f al se j agent. user name=r ootreg. retr y.i nterval=10i nstance. query. i ni t i al . i nterval =5i ncremental . regi str ati on. qui et. i nterval=5maxi mum. message. r et r i eval =500jagent.rmi.port=5559

    agent.type.enabled=OEM 

    status. poll i ng. i nterval=5message. pol l i ng. i nterval=5 j agent. backwar d. compat i bi l i t y=t r ue

    GGSCI ( source) > exit

    [ myuser @myhost ogg_sr c] $ 

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    r 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    6/36

    3.1 Prepare ODI Agents

    If you are using the pre-configured VM, skip to step 3.1.6.

    Start ODI Studio. If there is a dekstop icon, click it; otherwise do the following commands:

    The first time takes a while to load.

    1.

    Click Connect to Repository, select ODI and OGG Getting Started. The user is SUPERVI SOR and the Password is wel come1. Click OK  to continue.

    The User and Password should be pre-populated.

    2.

    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.

    3.

    On the JAgent tab, create (or verify) the OGG_Source JAgent Server.

    The RMI Port 5559 should match the value in OGG source Conf i g. properti es, the Manager Port 7010 should match the value in OGG source mgr. prm. Save and close

    the New Data Server OGG_Source tab.

    4.

    On the JAgent tab, create (or verify) the OGG_Target JAgent Server.5.

    OGG Target

    [ myuser @myhost ~] $ cd /home/oracle/Oracle/Middleware/Oracle_Home_1213/odi/studio

    [ myuser @myhost st udi o] $ ./odi.sh

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    r 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    7/36

    The RMI Port 5561 should match the value in OGG target Conf i g. properti es, the Manager Port 7020 should match the value in OGG target mgr. prm. Save and close the

    New Data Server OGG_Target tab.

    When you are done, it should look like this:

    You will come back and test these agents shortly.

    6.

    The OGG agents are ready from the ODI side.

    3.2 Prepare ODI Data Servers

    If you are using the pre-configured VM, skip to step 3.2.13.

    Go to the Topology Navigator tab, and expand Physical Architecture > Technologies > Oracle, right-click, then New Data Server .

    If SRC_ODI DEMOand TRG_ODI DEMOalready exist, then open them to verify that they match the screens shown.

    1.

    On the Definition tab, create (or verify) the SRC_ODI DEMOData Server.2.

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    r 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    8/36

    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...)

    3.

    Test JDBC connectivity by clicking TestConnection . You will see this pop-up:

    Click Test  to continue.

    4.

    On the Definition tab, create (or verify) the TRG_ODI DEMOData Server.

    The Password is wel come1.

    5.

    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...)

    6.

    Test JDBC connectivity by clicking TestConnection . You will see this pop-up:

    Click Test  to continue.

    7.

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    r 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    9/36

    The Physical Architecture is only half of the Topology definition. You still have to do the Logical Architecture.

    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.

    9.

    Create a Logical Schema named ODI_DEMO_SRC with a Context of Gl obal  and a Physical Schema of SRC_ODI DEMO. ODI _DEMOas shown.

    Save your work. Close the Logical Schema tab.

    10.

    Create a Logical Schema named ODI_DEMO_TRG with a Context of Gl obal  and a Physical Schema of TRG_ODI DEMO. ODI _DEMOas shown.

    Save your work. Close the Logical Schema tab.

    11.

    Create a Logical Schema named OGG_ODI_DEMO_SRC with a Context of Gl obal  and a Physical Schema of SRC_ODI DEMO. OGG_ODI _DEMO_SRC as shown.

    Save your work. Close the Logical Schema tab.

    12.

    When you are all done, it should look like this:13.

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    r 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    10/36

    In the demo VM, all t hree 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.

    3.3 Prepare ODI Models

    If you are using the pre-configured VM, skip to step 3.3.6.

    Go to the Designer  Navigator tab, and expand Models, click the pull-down and select New Model Folder .

    Techncially this is optional, but it is a good convention.

    1.

    Name the folder ODI_DEMO.

    The Description is optional. It is a good convention to put the modification history in here. Save your work. Close the Model Folder tab.

    2.

    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.

    3.

    Create the Orders Application model using the parameters shown.4.

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    11/36

    Save your work. Click ReverseEngineer  to read the table metadata. You will see the following pop-up briefly:

    Create the Sales Administration model using the parameters shown.

    Save your work. Click ReverseEngineer  to read the table metadata. You will see the following pop-up briefly:

    5.

    The Models should now look like this.

    You may have additional datastores (tables) as well. The three datastores that you care about are:

    6.

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    12/36

    The ODI Models and Datastores are now ready to be populated.

    3.4 Initial Load of the Staging Table

    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.

    Go to the Designer  Navigator tab, and expand Projects, click the pull-down and select New Project.1.

    Name the project ODI and OGG Integration Demonstration.

    Save your work. Close the Project folder.

    2.

    Click the pull-down and select New Folder .

    You are going to do this twice.

    3.

    Name the folder Initial Load .

    Save your work. Close the folder.

    4.

    Click the pull-down and select New Folder  again. Name the folder Sync data.

    Save your work. Close the folder.

    5.

    When you are done, it should look like this:6.

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    13/36

    Right-click Knowledge Modules, select Import Knowledge Modules.

    They may already be present. Check what is already there.

    7.

    Import the following Knowledge Modules (KMs):

    CKM Oracle

    IKM Oracle Incremental Update

    IKM SQL Control Append

    JKM Oracle to Oracle Consistent (OGG Online)

    You can find them on the VM at / home/ oracl e/ Or acl e/ Mi ddl eware/ Or acl e_Home_1213/ odi / sdk/xml - r ef erence.

    You may accidentally import CKM Hive (a known bug), you can safely ignore it.

    8.

    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.

    9.

    Right-click Mappings, select .10.

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    14/36

    Name the mapping Initial Load Staging.

    Still on the Designer  Navigator tab, expand Models > ODI_DEMO > Orders Application and also expand Sales Administration.

    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.a.

    Hook the output of the source to the input of the target.b.

     Accept Auto Mapping of Attributes.c.

    You can check which OGG_CUSTOMER is which by clicking the title bar and looking at the Properties > General.

    11.

    Select the target OGG_CUSTOMER title bar and change the Target > Integration Type to Control Append.

    If it already is Control Append, then just confirm it.

    12.

    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.

    13.

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    15/36

    If it already is LKM Oracle to Oracle Pull (DB Link).GLOBAL, then just confirm it. Save your work, but leave the tab open.

    Click Run in the top menu bar to run the mapping to populate the table.

    Click OK  on the Run panel. Click OK  on the Information panel to continue.

    14.

    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.

    15.

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    16/36

    In the Mapping panel, right click on the target datastore.

    There are many ways to view the data in the table.

    16.

    Make sure there are 35 rows in the table.

    Click Close  to continue.

    17.

    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.

    Leave the client running to watch the OGG+ODI changes. Remember:

    Source: OGG_CUSTOMER (Orders App model)

    Staging: OGG_CUSTOMER (Sales Admin model)

    18.

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    17/36

    3.5 Initial Load of the Target Table

    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. CI TY_I D) as well as column

    transformations (e.g. CUST_NAME=FI RST_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).

    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_CI TY.

    1.

    Click OK  on the Run panel. Click OK  on the Information panel to continue.2.

    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 .

    3.

    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.

    4.

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    18/36

    Notice this Physical Mapping Design: Bulk Load, whereas the previous one was Physical Mapping Design: Physical.

    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 .

    6.

    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 FI RST_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.

    7.

    The initial load of the Target table is complete.

    The ODI environment is prepared.

    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.

    4.1 Configure OGG Extract and Datapump via ODI

    If you are using the pre-configured VM, skip to step 4.1.3.

    Go to the Topology Navigator tab, and expand Physical Architecture > Technologies Double-click Oracle GoldenGate.1.

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    19/36

    There are lots of options you can configure, but the most important is Technology Type: ODI Connector .

    Expand Oracle GoldenGate > OGG_Source, then open (double-click) CAP (capture, also known as ext ract). 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).

    2.

    Expand Logical Architecture > Technologies > Oracle GoldenGate , and open (double-click) CAP_LS (abbreviation for CAPture Logical Schema). It should look ike this:

    This matches the Physical Architecture.

    3.

    The OGG extract (CAPture) and datapump (DELivery) are now configured as both physical and logical entities.

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    20/36

    4.3 Start OGG Processes via GGSCI

    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.

    5.1 Configure ODI Change Data Capture (CDC)

    If you are using the pre-configured VM, you still need to do this whole section.

    Go to the Designer  Navigator tab, and expand Models > ODI_DEMO. open (double-click) Orders Application.1.

    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.

    2.

    Back on the Designer  Navigator tab, right-click Orders Application, and select Changed Data Capture > Add to CDC.3.

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    21/36

    Click Yes  to close the Question window.4.

    Right-click Orders Application, and select Changed Data Capture > Subscriber > Subscribe.

     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.

    5.

    In the List of Subscribers to Add, enter ODIDEMO.

    Click the green plus to add the name to the list.

    Click OK  to continue.

    6.

    This starts a session that creates the journalizing environment and adds the user.7.

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    22/36

    Click OK  to continue. This takes a few seconds to complete.

    Click OK  to continue.

    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.

    8.

    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.

    9.

    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.

    10.

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    23/36

    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.

    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.

    11.

    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.12.

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    24/36

    If the clock is yellow, that indicates waiting; a green clock indicates something else.

    ODI CDC is now configured and started.

    5.2 Configure ODI Mappings

    If you are using the pre-configured VM, you still need to do this whole section. It is mostly just looking at parameters.

    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: ODI DEMO.

    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.

    1.

    Click the Physical tab. Click Trickle Feed to display the incremental load Physical Des ign.

    Two deployment specifications have been created in this environment:

    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.

    2.

    Select OGG_CUSTOMER. Notice that the Properties > General > Journalized Data Only is selected.3.

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    25/36

    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.

    5.3 Configure ODI Packages

    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.

    Go to the Designer  Navigator tab, and expand Projects > Sync Data > Packages, then open Sync Data.

    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.

    1.

    The ODI Tool step Wait for Changes is doing the CDC detection using Odi Wai t ForLogData. It is waiting for some changed records to be published by OGG.2.

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    26/36

    Parameters of Note:

    Gl obal Row Count =1 says to only wait for one row to be changed before proceeding to the next step (i.e., a "micro-batch").

    Pol l i ng I nterval=1000 milliseconds, i.e., 1 second (basically near-real-time).

    Logi cal Schema=ODI _DEMO_TRG and Subscr i ber=ODI DEMOmatch previous configuration values.

    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 ODI DEMOsubscriber. "Locking"

    is what makes this a Consistent Journalizing set versus a Simple set.

    Parameters of Note:

    Subscr i bers =ODI DEMOmatch previous configuration values.

    Consumpt i on=Extend, Lock. This second step does the first two Consumption options; the fourth step does the last two Consumption options.

    3.

    The Mapping Load TRG_CUSTOMER will load the changed data using the Trickle Feed physical design and the ODI DEMOSubscriber 4.

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    27/36

    It would be a good practice to have an unsuccessful path ("ko" red arrow) to trap possible errors.

    This is the opposite of package step 2, "Extend and Lock."

    Parameters of Note:

    Subscr i bers =ODI DEMOmatch previous configuration values.

    Consumpt i on=Purge, Unl ock. The second step does the first two Consumption options; this fourth step does the last two Consumption options.

    5.

    The Package ends with a step executing a Scenario, the same scenario, recursively.6.

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    28/36

    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.

    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.

    Click OK  on the Run panel. Click OK  on the Information panel to continue.

    7.

    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.

    Since it is a continuous loop, it is not "finished" with this session.

    8.

    The ODI package is now configured and running in an infinite loop, waiting for records to deliver.

    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.

    6.1 Check BEFORE views of OGG processes and the tables

    Make sure the OGG Source Extract (CAPture) and Data Pump (DELivery) are created and St at us=RUNNI NG.1.

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    29/36

    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.

    Make sure the OGG Target Replicat (DELivery) is created and St at us=RUNNI NG.2.

    You can verify the contents of the tables with SQL*Plus, SQL Developer, or the Demo Client.

    Note that customer 104 has a first name of J oe. It says so in all three tables.

    3.

    Now you have seen what the processes and data looks like before anything has changed.

    6.2 Do DML on source data

    Do inserts, updates, and deletes on the OGG_ODI _DEMO_SRC. OGG_CUSTOMER source data, and watch it propagate through the system.

    Change the first name of customer 104 to Harry.1.

    OGG Source

    GGSCI ( source) > Info All

    Pr ogram Stat us Gr oup Lag at Chkpt Ti me Si nce ChkptMANAGER RUNNI NG J AGENT RUNNI NGEXTRACT RUNNI NG CAP 00: 00: 00 00: 00: 00EXTRACT RUNNI NG DELP 00: 00: 00 00:00: 05

    GGSCI ( source) > 

    OGG Target

    GGSCI ( t arget) > Info All

    Pr ogram Stat us Gr oup Lag at Chkpt Ti me Si nce ChkptMANAGER RUNNI NG J AGENT RUNNI NGREPLI CAT RUNNI NG DEL1 00: 00: 00 00: 00: 01

    GGSCI ( t arget) > 

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    30/36

    Nothing to do here, but watch carefully because it changes quickly!

    Now the Staging says Harr y.

    2.

    Nothing to do here, but watch carefully because it changes quickly!

    Now the Target says Harr y.

    3.

    The changes have replicated through OGG and then ODI CDC.

    6.3 Check OGG processes

    Sometimes DML breaks the OGG processes if they were mis-configured. Check thier Status.

    Make sure the OGG Source is still running.1.

    OGG Source

    GGSCI ( source) > !i nfo al l

    Pr ogram Stat us Gr oup Lag at Chkpt Ti me Si nce ChkptMANAGER RUNNI NG J AGENT RUNNI NGEXTRACT RUNNI NG CAP 00: 00: 00 00: 00: 00EXTRACT RUNNI NG DELP 00: 00: 00 00:00: 06

    GGSCI ( ODI Gett i ngStar t ed) 12> Stat s cap

    Sendi ng STATS request t o EXTRACT CAP . . .

    Start of Stat i st i cs at 2014- 07- 29 14: 18: 59.

    Output t o /home/ oracl e/ Or acl e/ Mi ddl eware/ OGG_Sour ce/ di r dat / oc:

    Ext r act i ng f r om OGG_ODI _DEMO_SRC. OGG_CUSTOMER t o OGG_ODI _DEMO_SRC. OGG_CUSTOMER:

    *** Total st ati st i cs si nce 2014-07- 29 14: 00: 52 *** Total i nser t s 0. 00 Total updat es 3. 00 Total del et es 0. 00 Total di scar ds 0. 00 Total operat i ons 3. 00

      (...many lines omitted for clarity...)

    GGSCI ( source) > 

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    31/36

    Make sure the OGG Target is still running.

    Even though the ODI CDC creates many sessions (micro-batches of 1 record each), OGG is just one big session.

    2.

    The OGG processes are still running, waiting for more changes.

    6.4 Check  AFTER views of the tables

    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.

    You can see the five steps (numbered 0-4) of the SYNC_DATA package for each session.

    1.

    If you want, you can check the OGG reports:2.

    OGG Target

    GGSCI ( t arget) > !i nfo al l

    Pr ogram Stat us Gr oup Lag at Chkpt Ti me Si nce ChkptMANAGER RUNNI NG J AGENT RUNNI NG

    REPLI CAT RUNNI NG DEL1 00: 00: 00 00: 00: 07

    GGSCI ( ODI Gett i ngStart ed) 8> Stats del 1

    Sendi ng STATS request t o REPLI CAT DEL1 . . .

    Start of Stat i st i cs at 2014- 07- 29 14: 19: 32.

    Repl i cat i ng f r om OGG_ODI _DEMO_SRC. OGG_CUSTOMER t o ODI _DEMO. OGG_CUSTOMER:

    *** Total st ati st i cs si nce 2014-07- 29 14: 00: 58 *** Total i nser t s 0. 00 Total updat es 3. 00 Total del et es 0. 00 Total di scar ds 0. 00 Total operat i ons 3. 00

      (...many lines omitted for clarity...)

    GGSCI ( t arget) > 

    OGG Source

    GGSCI ( source) > View Report CAP

    ***********************************************************************  Or acl e Gol denGate Capt ure f or Or acl e  Ver si on 12. 1. 2. 0. 0 17185003 OGGCORE_12. 1. 2. 0. 0_PLATFORMS_130924. 1316_FBO  Li nux, x64, 64bi t ( opt i mi zed) , Or acl e 11g on Sep 25 2013 00: 44: 16 Copyri ght (C) 1995, 2013, Oracl e and/ or i ts aff i l i ates. Al l ri ghts reserved.

      Star t i ng at 2014- 07- 28 12: 04: 06***********************************************************************

    Oper ati ng Syst emVersi on:Li nuxVer si on #1 SMP Fri Feb 22 18: 16: 18 PST 2013, Rel ease 2. 6. 39- 400. 17. 1. el 6uek. x86_64Node: ODI Gett i ngStar t edMachi ne: x86_64  soft l i mi t hard l i mi tAddr ess Space Si ze : unl i mi t ed unl i mi t edHeap Size : unl i mi t ed unl i mi t edFi l e Si ze : unl i mi ted unl i mi tedCPU Ti me : unl i mi t ed unl i mi t ed

    Process i d: 22568

    Descri pti on:

    ************************************************************************* Runni ng wi t h t he f ol l owi ng par ameter s *************************************************************************

      (...many lines omitted for clarity...)

    GGSCI ( source) >

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    32/36

    Go to the Designer  Navigator tab, and expand Models > ODI_DEMO > Orders Application. Right-click OGG_CUSTOMER and select Changed Data Capture > Journal Data.

    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.

    3.

    If you want to inspect the data with SQL*Plus, do the following queries:

    The above is for the source table.

    The above is for the staging table.

    The above is for the target table. All three should be the same, with a first name of Harr y.

    4.

    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.

    E-LT Source (OGG Source)

    [ myuser @myhost ~] $ sqlplus system/oracleSQL*Pl us: Rel ease xx. x. x. x. x Producti on on Mon dd hh: mm: ss yyyy

    SQL_SOURCE > select custid, last_name, first_name from OGG_ODI_DEMO_SRC.OGG_CUSTOMER where custid=104;

    CUSTI D LAST_NAME FI RST_NAME- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  104 Lar son Har r y 

    E-LT Staging (OGG Target, ODI Source)

    [ myuser @myhost ~] $ sqlplus system/oracleSQL*Pl us: Rel ease xx. x. x. x. x Producti on on Mon dd hh: mm: ss yyyy

    SQL_STAGI NG > select custid, last_name, first_name from ODI_DEMO.OGG_CUSTOMER where custid=104;

    CUSTI D LAST_NAME FI RST_NAME- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  104 Lar son Har r y 

    E-LT Target (ODI Target)

    [ myuser @myhost ~] $ sqlplus system/oracleSQL*Pl us: Rel ease xx. x. x. x. x Producti on on Mon dd hh: mm: ss yyyy

    SQL_TARGET > select custid, last_name, first_name from ODI_DEMO.TRG_CUSTOMER where custid=104;

    CUSTI D LAST_NAME FI RST_NAME- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  104 Lar son Har r y 

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    33/36

     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:

    7.1 Cleanup ODI

    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.

    1.

    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 f rom 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.

    This causes a session to start. Confirm in the usual way.

    2.

    Optionally you could have dropped the journals for all datastores in the model. Same process as for a datastore, only one level up.3.

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    34/36

    This causes a session to start. Confirm in the usual way.

    Like the journal, you can remove an object from CDC at the datastore level or at the model level. For the datastore, remove it from the CDC.

    The question prompts you, "Are you sure?"

    Click Yes  to continue.

    4.

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    35/36

    The question prompts you, "Are you sure?"

    Click Yes  to continue.

     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.

    7.2 Cleanup OGG

    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.

    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.

    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.

    1.

    On the OGG target, note that the replicat process is stopped and removed (unregistered), but the parameter file persists.2.

    OGG Source

    GGSCI ( source) > Info All

    Pr ogram Stat us Gr oup Lag at Chkpt Ti me Si nce ChkptMANAGER RUNNI NG J AGENT RUNNI NG

    GGSCI ( source) > View Param cap

    extr act CAPuseri d ODI _STAGI NG, password oracl eext t rai l / home/oracl e/Oracl e/Mi ddl eware/OGG_Source/di rdat/ oc

     TABLE OGG_ODI _DEMO_SRC. OGG_CUSTOMER;

    GGSCI ( sour ce) >

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...

    ur 36 21/10/2014 22:30

  • 8/9/2019 ODI+OGG Integration.pdf

    36/36

    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.

    Following the business scenario posed in the Introduction secti on, 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 _DEMOon 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.

    In this tutorial, you learned to:

    Prepare an Oracle Database for ODI and OGG replication

    Prepare ODI for CDC

    Prepare OGG for replication

    Start, Monitor, Stop ODI and OGG integration

    Resources

    Here is a list of conceptual or procedural Help topics relevant to this tutorial:

    ODI 12c full Documentation online (includes past versions).

    ODI 12c and OGG Integration Documentation .

    ODI 12c and OGG Webcast, specifically Integration.

    Specific courses where ODI is discussed in detail:

    [D82167GC10] "Oracle Data Integrator 12c: Integration and Administration"

    [D82171GC10] "Oracle Data Integrator 12c: New Features"

    [DxxxxxGC10] "Oracle Data Integrator 12c: Advanced Integration and Development"

    [D78191GC10] "Oracle Data Integrator 11g: Advanced Integration and Development"

    Specific courses where OGG is discussed in detail:

    [D84357GC10] "Oracle GoldenGate 12c: Fundamentals for Oracle"

    [D76689GC10] "Oracle GoldenGate 11g: Advanced Configuration for Oracle"

    External Web sites for related information: A-Team Blogs

    To learn more about ODI and OGG, refer to additional OBEs in the free Oracle Learning Library:

     A long list of ODI general OBEs here.

    Here is the same ODI+OGG tutorial but for ODI 11g.

    Credits

    Lead Curriculum Developer: Steve Friedberg

    Other Contributors: Julien Testut, Product Manager; Alex Kotopoulis, Product Manager, Tom Mangiacapre.

    OGG Target

    GGSCI ( t arget) > Info All

    Pr ogram Stat us Gr oup Lag at Chkpt Ti me Si nce ChkptMANAGER RUNNI NG J AGENT RUNNI NG

    GGSCI ( t arget) > View Param del1

    repl i cat DEL1useri d ODI _STAGI NG, password oracl edi scardfi l e , purgesourcedefs / home/ oracl e/ Or acl e/ Mi ddl eware/ OGG_Target/ di r def / CAP. def 

    map OGG_ODI _DEMO_SRC. OGG_CUSTOMER, TARGET ODI _DEMO. OGG_CUSTOMER, KEYCOLS (CUSTI D);

    map OGG_ODI _DEMO_SRC. OGG_CUSTOMER, t ar get ODI _STAGI NG. J $OGG_CUSTOMER, KEYCOLS ( CUSTI D, WI NDOW_I D) , I NSERTALLRECORDS, OVERRI DEDUPS,COLMAP (CUSTI D = CUSTI D,

    WI NDOW_I D = @STRCAT( @GETENV(' RECORD' , ' FI LESEQNO' ) , @STRNUM( @GETENV(' RECORD' , ' FI LERBA' ) , RI GHTZERO, 10))) ;

    GGSCI ( t arget ) >

    I+OGG Integration http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/o...


Recommended