zoukankan      html  css  js  c++  java
  • datax 数据同步迁移

    https://github.com/alibaba/DataX/blob/master/mysqlwriter/doc/mysqlwriter.md

    https://github.com/alibaba/DataX/blob/master/oraclewriter/doc/oraclewriter.md

    [root@OracNode1 job]# vim mysql2oracle.json
    {
    "job": {
    "content": [
    {
    "reader": {
    "name": "mysqlreader",
    "parameter": {
    "username": "testAdmin",
    "password": "tsj123456",
    "column": ["first_name","last_name"],
    "where": "first_name like 'C%'",
    "connection": [
    {
    "table": [
    "actor"
    ],
    "jdbcUrl": [
    "jdbc:mysql://192.168.1.139:3306/sakila"
    ]
    }
    ]
    }
    },
    "writer": {
    "name": "oraclewriter",
    "parameter": {
    "username": "scott",
    "password": "tiger",
    "column": [
    "first_name",
    "last_name"
    ],
    "preSql": [
    "delete from actor_test"
    ],
    "connection": [
    {
    "jdbcUrl": "jdbc:oracle:thin:@192.168.1.146:1521:ORCL",
    "table": [
    "actor_test"
    ]
    }
    ]
    }
    }
    }
    ],
    "setting": {
    "speed": {
    "channel": 1
    }
    }
    }

    ===============

    [root@OracNode1 job]# vim oracle2mysql.json
    {
    "job": {
    "content": [
    {
    "reader": {
    "name": "oraclereader",
    "parameter": {
    "column": ["EMPNO","ENAME", "JOB ","MGR"],
    "connection": [
    {
    "jdbcUrl": ["jdbc:oracle:thin:@192.168.1.146:1521:ORCL"],
    "table": ["emp"]
    }
    ],
    "password": "tiger",
    "username": "scott"
    }
    },
    "writer": {
    "name": "mysqlwriter",
    "parameter": {
    "column": ["EMPNO","ENAME", "JOB ","MGR"],
    "connection": [
    {
    "jdbcUrl": "jdbc:mysql://192.168.1.139:3306/sakila",
    "table": ["emp"]
    }
    ],
    "password": "tsj123456",
    "preSql": ["delete from emp"],
    "session": [],
    "username": "testAdmin",
    "writeMode": "insert"
    }
    }
    }
    ],
    "setting": {
    "speed": {
    "channel": "1"
    }
    }
    }
    }

  • 相关阅读:
    Hive-03 常用函数
    linux定时运行命令脚本crontab
    Flink| time| watermark| Windows窗口
    多个线程运行MR程序时hadoop出现的问题
    maxwell实时同步mysql中binlog
    Hive-04 参数调优
    gopm的使用和更新go语言
    flutter的成功
    数据库系统概论--数据模型
    mysql设置编码格式--支持中文
  • 原文地址:https://www.cnblogs.com/moss_tan_jun/p/9226742.html
Copyright © 2011-2022 走看看