datax的文档还是很齐全的,这里走了许多弯路。
{
"job": {
"setting": {
"speed": {
"channel": 5
}
},
"content": [
{
"reader": {
"name": "mysqlreader",
"parameter": {
"username": "selectuser",
"password": "selectpass",
"column": [‘*‘],
"splitPk": "id",
"connection": [
{
"table": ["user"],
"jdbcUrl": ["jdbc:mysql://192.168.0.2:3306/mall_db"],
}
]
}
},
"writer": {
"name": "oraclewriter",
"parameter": {
"username": "oracleuser",
"password": "oraclepass",
"column": [‘*‘],
"truncate": "true",
"preSql": ["truncate table user"],
"connection": [
{
"jdbcUrl": "jdbc:oracle:thin:@172.19.12.149:1521:oracleuser",
"table": [‘user‘],
}
]
}
}
}
]
}
}
注意:
1.在Oracle建立表的时候,所有的表名以及字段全部采用大写,否则出现缺失字段或者找不到表的问题
2.reader的数据库jdbc是要用[]数组形式的,否则将会报错
3.在用datax的时候在导入的数据排序不是按照id的自增的,这点注意下