Oracle Data Integrator和GoldenGate集成

先上架构图:


先决条件

1. Oracle database 11g已安装,
2. Oracle GoldenGate 11g for Linux已安装
3. Oracle Data Integrator已安装在windows上

环境介绍

Oracle Linux 64 bit 6.4 (IP: 192.168.1.109), hosts both database and GoldenGate.

Oracle Database: 11.2.0.3 64 bit

Oracle GoldenGate 11.2.1.0.1 for Linux 64 bit and Oracle 11g

OGG source directory: /home/oracle/ogg_src

OGG staging directory: /home/oracle/ogg

Source table: cust_dw_dev.src_city

Staging table: gg_demo_stage.city

ODI 11g installed on Windows 7 64bit – IP: 192.168.1.154, master and work repository have been created.

数据库环境配置

For demonstration purposes, source, staging, target tables are in the same database.

Source Schema and Table

Login 192.168.1.109 as oracle/oracle

sqlplus “/as sysdba”

create user cust_dw_dev identified by a123456;

grant dba to cust_dw_dev;

create user odi_tmp identified by a123456;

grant dba to odi_tmp;

connect cust_dw_dev@orcl;

运行Oracle官网上下载的ODI demo.zip包含的建表语句创建src_city表

Staging and Target Schema and Table

Connect “/as sysdba”;

create user gg_demo_staging identified by a123456;

grant dba to gg_demo_staging;

create user gg_demo_target identified by gg_demo_target;

grant dba to gg_demo_target;

connect gg_demo_staging/a123456@orcl;

create table gg_demo_staging.CITY (

   CITY_ID              NUMERIC(10) not null,

   CITY                 VARCHAR(50),

   REGION_ID            NUMERIC(10),

   POPULATION           NUMERIC(10),

   constraint PK_SRC_CITY primary key (CITY_ID)

);

Connect gg_demo_target/a123456@orcl;

create table gg_demo_target.CITY (

   CITY_ID              NUMERIC(10) not null,

   CITY                 VARCHAR(50),

   REGION_ID            NUMERIC(10),

   POPULATION           NUMERIC(10),

   constraint PK_SRC_CITY primary key (CITY_ID)

);


ODI配置

Physical Architecture

  Start ODI Studio from Windows 7
  Connect to master and work repository.

Source

  Topology tab ? Physical Architecture ? Oracle, right click and select New Data Server
  Enter GG_SOURCE for Name
  On JDBC tab, Enter:
  oracle.jdbc.OracleDriver for JDBC Driver
  jdbc:oracle:thin:@192.168.1.109:1521:orcl for JDBC Url
  Click save and Test Connection.
  Right GG_SOURCE and select New Physical Schema
  Enter:
  cust_dw_dev for Schema (Schema)
  odi_tmp for Schema (Work Schema)
  Click save and close.

Staging and Target

  Follow the previous steps to create staging Data Server and Physical Schemas. Here, use gg_demo_staging as physical schema, gg_demo_target for target.

Logical Architecture

Source

  Topology tab ? Logical Architecture ? Oracle, right click and select New Logical Schema.
  Enter GG_SOURCE for Name
  Select GG_ONE for Physical Schema for Global Context.

Staging and Target

  Follow the same steps to create staging and target Logical Schema. Use appropriate names for staging and target.

Model

  Click Designer tab ? Models ? New Model. Enter “GG_SOURCE”, ”GG_STAGING”,”GG_TARGET” for source, staging and target schema, select “Oracle” for Technology, select Logical Schema respectively for source, staging and target.
  Right click each newly-created models and select Reverse Engineer, tables created from Database Step should show up in the list.
  Right click CITY table from GG_STAGING, Changed Data Capture ? Add to CDC, click Yes on the pop-up box.

CDC Configuration

Go to Designer --&gt Projects --&gt Knowledge Modules, right click and select Import Knowledge Modules, from the pop-up window, select JKM Oracle to Oracle Consistent (OGG), and click OK.

Double click “GG_STAGING” model, select Journalizing, and select Consistent Set for Journalizing Mode, JKM Oracle to Oracle Consistent(OGG). for Knowledge Module.

Enter the configuration as follows and save.


ODI will generation parameter and obey files for OGG extract, pump and replicat process based on above configuration, user is required to deploy parameter and obey files to OGG server.

Right click “GG_STAGING” --&gt Changed Data Capture --&gt Subscriber --&gt Subscribe, Enter ODI on the popup windows, click add and then save.
Right click “GG_STAGING” --&gt Changed Data Capture --&gt Start Journal.

Deploy CDC Infrastructure

Source

Zip d:\ODIS_to_ODIT1 and upload to user oracle’s home directory in 192.168.1.109.
Login 192.168.1.109 as oracle.
Unzip ODIS_to_ODIT1.
cp ~/ODIS_to_ODIT1/src/dirprm/* ~/ogg_src/dirprm/
cp ~/ODIS_to_ODIT1/src/diroby/* ~/ogg_src/dirprm/
cd ~/ogg_src/dirdat
mkdir ODISoc
cd ..
./ggsci
obey ODISS.oby
start mgr
info all –Check every process is running
exit
defgen PARAMFILE ./dirprm/ODISD.prm
cp ./dirdef/ODISC.def ~/ogg/dirdef/

Target

cd ~/ogg
cp ~/ODIS_to_ODIT1/stg/dirprm/* ./dirprm/
cp ~/ODIS_to_ODIT1/stg/diroby/* ./dirprm/
mkdir ./dirdat/ODIT1op
./ggsci
obey ODIT1T.oby
start mgr
info all
exit

Build CDC Interface

From ODI studio --&gt  Designer tab --&gt   --&gt   --&gt  Interfaces, right click and select New Interface, enter a name for your interface.

Select Mapping tab, drag the city table from GG_STAGING model and drop it to the source panel.


Drag the city from GG_TARGET model and drop it to Target Database panel.

Select city, the Property Inspector tab shows on the right-down, and select “Journalized Data Only” check box, and save.

Click filter next to city, from Property Inspector tab à Implementation, change it to JRN_SUBSCRIBER=’ODI’, and save your changes.

Run the Interface

Designer tab --&gt  Models --&gt  GG_STAGING --&gt  Changed Data Capture --&gt  Consumption, click Extend Window.

Designer tab --&gt Models --&gt GG_STAGING --&gt Changed Data Capture --&gt Consumption, click Lock Subscriber.

ODI menu --&gt Execute.

Designer tab --&gt Models --&gt GG_STAGING --&gt Changed Data Capture --&gt Consumption, click Unlock Subscriber.

Check execution status

Operator tab --&gt  Agent --&gt  


To view data in the target schema, Models --&gt GG_TARGET --&gt CITY, right click and select View Data.



来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/638844/viewspace-1062175/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/638844/viewspace-1062175/

Contents Document Control ii 1. ODI基础 2 1.1. 参考资料 2 1.2. ODI基础 2 1.3. ODI理解之1 6 1.4. ODI组件 6 1.5. ODI安装 8 1.6. 服务和菜单 10 1.7. 基本训练 10 2. 完整的简单例子(资料库、体系结构、项目、模型、接口、包、方案) 11 2.1. ODI理解之2 11 2.2. 环境准备 12 2.3. 创建资料库 13 2.4. 创建物理体系结构 17 2.5. 创建逻辑体系结构 20 2.6. 创建项目 20 2.7. 创建模型 21 2.8. 创建接口 23 2.9. 运行接口 25 2.10. 监控和查看会话状态 26 2.11. 创建并运行包 27 2.12. 创建并运行方案 28 2.13. ODI理解之3 28 3. 最常用特性和功能实例一(CDC、Agent、Schedule) 30 3.1. ODI理解之4 30 3.2. ODI理解之5(CDC) 30 3.3. O2O CDC(Simple) 32 3.4. O2O CDC(Consistent Set) 35 3.5. O2O CDC(Consistent Set Using Log Minner) 41 3.6. Agent 42 3.7. Schedule 43 4. 最常用特性和功能实例二(SQL Server、XML) 45 4.1. Oracle to SQL Server 45 4.2. SQL Server to Oracle 46 4.3. XML to Oracle 47 5. Sequence、Variable、User Function、Procedure 50 5.1. 作用域 50 5.2. Variable变量 50 5.3. Sequence序列 51 5.4. User Function自动义函数 53 5.5. Procedure过程 54 5.6. Procedure最简单的例子 55 5.7. 在Procedure中用序列、函数 56 6. Knowledge Module 58 6.1. 客户化KM最佳简单例子 58 7. Package及ODI工具箱 59 7.1. 概述 59 8. Web Service 61 8.1. 安装Public Web Services 61 8.2. 设置Data Services 61 9. FAQ&How To 62 9.1. 常见问题 62 9.2. 中英文名词 62 9.3. 对象加密 63 9.4. Agent负载均衡 63 9.5. Jython 63 9.6. Substitution Methods 64 9.7. 常用代码块 64 9.8. 命令行工具 64 9.9. 升级 65 9.10. 用户权限 65 9.11. 安装Metadata Navigator 67 9.12. 安装Lightweight Designer 68 10. 专题 70 10.1. DBLink 70 10.2. 对象冲突 70 11. Open and Closed Issues for this Deliverable 71 Open Issues 71 Closed Issues 71
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值