当前位置:   article > 正文

DataX从Hive将数据写入Oracle_datax hive导入 oracle

datax hive导入 oracle

1、脚本

{
    "job": {
        "content": [
            {
                "reader": {
                    "name": "hdfsreader", 
                    "parameter": {
						"column": [
							{
								"index":0,
								"type":"STRING"
							},
							{
								"index":1,
								"type":"STRING"
							},
							{
								"index":2,
								"type":"STRING"
							},
							{
								"index":3,
								"type":"STRING"
							},
							{
								"index":4,
								"type":"STRING"
							},
							{
								"index":5,
								"type":"STRING"
							},
							{
								"index":6,
								"type":"STRING"
							},
							{
								"index":7,
								"type":"STRING"
							},
							{
								"index":8,
								"type":"STRING"
							},
							{
								"index":9,
								"type":"STRING"
							},
							{
								"index":10,
								"type":"STRING"
							},
							{
								"index":11,
								"type":"STRING"
							},
							{
								"index":12,
								"type":"STRING"
							},
							{
								"index":13,
								"type":"STRING"
							},
							{
								"index":14,
								"type":"STRING"
							},
							{
								"index":15,
								"type":"STRING"
							},
							{
								"index":16,
								"type":"STRING"
							},
							{
								"index":17,
								"type":"STRING"
							},
							{
								"index":18,
								"type":"STRING"
							},
							{
								"index":19,
								"type":"STRING"
							},
							{
								"index":20,
								"type":"STRING"
							},
							{
								"index":21,
								"type":"STRING"
							},
							{
								"index":22,
								"type":"STRING"
							},
							{
								"index":23,
								"type":"STRING"
							},
							{
								"index":24,
								"type":"DATE"
							},
							{
								"index":25,
								"type":"STRING"
							},
							{
								"index":26,
								"type":"DATE"
							}
                        ], 
                        "defaultFS": "hdfs://node01:9000", 
                        "encoding": "UTF-8", 
                        "fieldDelimiter": "|", 
                        "fileType": "text",
						"nullFormat":"",
                        "path": "/user/hive/warehouse/mask_data.db/health_code/*"
                    }
                }, 
                "writer": {
                    "name": "oraclewriter", 
                    "parameter": {
                        "column": [
							"ID_1",
							"NAME_1",
							"SN",
							"PASSPORT",
							"PHONE",
							"AREA",
							"STREET",
							"COMMUNITY",
							"ADDRESS",
							"CODE_TYPE",
							"APPLY_TYPE",
							"APPLY_MEMO",
							"AUDIT_MEMO",
							"AUDIT_STATUS",
							"AUDIT_TIME",
							"ATTACHMENT1",
							"ATTACHMENT2",
							"ADD_TIME",
							"CODE_ZM_TYPE",
							"AUDIT_STREET_MEMO",
							"AUDIT_AREA_MEMO",
							"UPDATE_TIME",
							"AUDIT_STREET_TIME",
							"AUDIT_AREA_TIME",
							"JLGXSJ12",
							"INC_ID",
							"RKSJ_CJYT"
						], 
                        "connection": [
                            {
                                "jdbcUrl": "jdbc:oracle:thin:@//ip:1521/orcl", 
                                "table": ["HEALTH_CODE"]
                            }
                        ], 
                        "password": "xxxxx", 
                        "preSql": ["truncate table HEALTH_CODE"], 
                        "username": "root"
                    }
                }
            }
        ], 
        "setting": {
            "speed": {
                "channel": "3"
            }
        }
    }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/176917
推荐阅读
相关标签
  

闽ICP备14008679号