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

相關文章
相關標籤/搜索