Loading Data From Oracle To Hive By ODI 12c

本文描述如何经过ODI将Oracle表数据同步到Hive。
一、准备工做
在hadoop集群的各个节点分别安装Oracle Big Data Connectors,具体的组件以下图所示:
Loading Data From Oracle To Hive By ODI 12c
这里只需安装Oracle Loader For Hadoop(oraloader)以及Oracle SQL Connector for Hadoop Distributed File System (oraosch)两个软件。安装比较简单,直接解压便可使用(这里的ODI、oraosch以及oraloader组件都是以oracle用户身份安装的。)
二、建立目标表
在Hive上建立目标表,以下:cookie

CREATE TABLE `RHNPACKAGE2`(
  `id` bigint, 
  `org_id` bigint, 
  `name_id` bigint, 
  `evr_id` bigint, 
  `package_arch_id` bigint, 
  `package_group` bigint, 
  `rpm_version` string, 
  `description` string, 
  `summary` string, 
  `package_size` bigint, 
  `payload_size` bigint, 
  `installed_size` bigint, 
  `build_host` string, 
  `build_time` timestamp, 
  `source_rpm_id` bigint, 
  `checksum_id` bigint, 
  `vendor` string, 
  `payload_format` string, 
  `compat` bigint, 
  `path` string, 
  `header_sig` string, 
  `copyright` string, 
  `cookie` string, 
  `last_modified` timestamp, 
  `created` timestamp, 
  `header_start` bigint, 
  `header_end` bigint, 
  `modified` timestamp);

三、建立映射
以前已经建立好oracle和hive模型,这里直接使用其建立映射。以下图所示:
Loading Data From Oracle To Hive By ODI 12c
Integration Type设置属性:
Loading Data From Oracle To Hive By ODI 12c
链接设置属性:
Loading Data From Oracle To Hive By ODI 12c
过滤设置属性:
Loading Data From Oracle To Hive By ODI 12c
LKM设置属性:
Loading Data From Oracle To Hive By ODI 12c
IKM设置属性:
Loading Data From Oracle To Hive By ODI 12c
若是设置TRUNCATE的值为True,每次导入以前,会把表里的数据清空再导入,默认为false。
四、执行映射
结果以下图:
Loading Data From Oracle To Hive By ODI 12coracle

相关文章
相关标签/搜索