1.下载DataX并解压(本地环境安装有python)
DataX/userGuid.md at master · alibaba/DataX (github.com)
job文件夹下存放数据同步的json脚本
{ "job": { "setting": { "speed": { "channel": 1 } }, "content": [ { "reader": { "name": "mysqlreader", "parameter": { "username": "${readUsername}", "password": "${readPassword}", "column": [ "CreateTime","Id","OrderNum" ], "connection": [ { "table": [ "table1" ], "jdbcUrl": [ "jdbc:mysql://${readJdbcUrl}?useUnicode=true&characterEncoding=utf-8&useSSL=false" ] } ] } }, "writer": { "name": "oraclewriter", "parameter": { "username": "${writeUsername}", "password": "${writePassword}", "column": [ "CREATETIME","ID","ORDER_NUM" ], "connection": [ { "jdbcUrl": "jdbc:oracle:thin:@${writeJdbcUrl}", "table": [ "Table1" ] } ] } } } ] } } python D:\datax\bin\datax.py D:\datax\table1_job.json -p "-DreadJdbcUrl=127.0.0.1:3306/testdb -DreadUsername=root -DreadPassword=123456 -DwriteJdbcUrl=127.0.0.1:1521:TestDB -DwriteUsername=yonghuming -DwritePassword=mima"
{ "job": { "setting": { "speed": { "channel": 1, "byte": 1048576 }, "errorLimit": { "record": 0, "percentage": 0.02 } }, "content": [ { "reader": { "name": "mysqlreader", "parameter": { "username": "root", "password": "123456", "column": [ "Id" ], "where": "", "splitPk": "", "connection": [ { "table": [ "testtb" ], "jdbcUrl": [ "jdbc:mysql://127.0.0.1:3306/testdb" ] } ] } }, "writer": { "name": "oraclewriter", "parameter": { "username": "yonghuming", "password": "mima", "writeMode": "insert", "column": [ "Id" ], "connection": [ { "table": [ "testtb1" ], "jdbcUrl": "jdbc:oracle:thin:127.0.0.1:1521:TestDB" } ] } } } ] } }
python D:\datax\bin\datax.py D:\datax\table1_job.json
标签:name,column,数据库,job,datax,MySql,password,DataX From: https://www.cnblogs.com/sanday/p/18196137