189 8069 5689

Datax离线数据抽取(MySQL--Oracle)-创新互联

Datax下载地址:/tupian/20230522/DataX

为雁江等地区用户提供了全套网页设计制作服务,及雁江网站建设行业解决方案。主营业务为成都做网站、网站设计、雁江网站设计,以传统方式定制建设网站,并提供域名空间备案等一条龙服务,秉承以专业、用心的态度为用户提供真诚的服务。我们深信只要达到每一位用户的要求,就会得到认可,从而选择与我们长期合作。这样,我们也可以走得更远!

Datax MySQL读:   /tupian/20230522/DataX/blob/master/mysqlreader/doc/mysqlreader.md

Datax MySQL写:   /tupian/20230522/DataX/blob/master/mysqlwriter/doc/mysqlwriter.md

1.下载安装Datax软件(必须安装jdk 1.8版本以上)  

[root@localhost ~]# tar xvf jdk-8u65-linux-x64.tar.gz  

[root@localhost ~]# mv jdk1.8.0_151  /usr/local/jdk1.8.0_151

[root@localhost ~]# vim /etc/profile

export PATH=$PATH:/usr/local/jdk1.8.0_151/bin

[root@localhost ~]# vim /etc/ld.so.conf.d/mysql-x86_64.conf

/usr/local/jdk1.8.0_151/lib

[root@localhost ~]# tar xvf  datax.tar.gz

[root@localhost ~]# cd datax/job/

2.编辑配置文件(首先用kettle将表结构同步过去)

[root@localhost job]# vim job1.json 

{
    "job": {
        "setting": {
            "speed": {
                "channel": 5
            }
        },
        "content": [
            {
                "reader": {
                    "name": "mysqlreader",
                    "parameter": {
                        "username": "wangying",
                        "password": "wangying",
                        "column": ["*"],
                        "connection": [
                           {
                              "table": ["t3"],
                              "jdbcUrl": ["jdbc:mysql://172.16.8.93:3306/db_stktag"]
                           }
                        ]
                    }
                },
                "writer": {
                    "name": "oraclewriter",
                    "parameter": {
                        "username": "upcenter",
                        "password": "upcenter",
                        "column": ["*"],
                        "connection": [
                            {
                               "jdbcUrl": "jdbc:oracle:thin:@192.168.7.7:1521:upqc",
                               "table": ["t3"]
                            }
                        ]
                      }
                    }
                }
        ]
    }
}

[root@localhost job]# 

3.数据抽取

[root@localhost job]# python2 /root/datax/bin/datax.py job1.json

DataX (DATAX-OPENSOURCE-3.0), From Alibaba !

Copyright (C) 2010-2017, Alibaba Group. All Rights Reserved.

2019-01-29 16:10:00.236 [main] INFO  VMInfo - VMInfo# operatingSystem class => sun.management.OperatingSystemImpl

2019-01-29 16:10:00.246 [main] INFO  Engine - the machine info  => 

osInfo:Oracle Corporation 1.8 25.151-b12

jvmInfo:Linux amd64 3.10.0-123.el7.x86_64

cpu num:8

totalPhysicalMemory:-0.00G

freePhysicalMemory:-0.00G

maxFileDescriptorCount:-1

currentOpenFileDescriptorCount:-1

。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。

。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。

2019-01-29 15:10:04.908 [job-0] INFO  JobContainer - 

2019-01-29 16:10:14.407 [job-0] INFO  JobContainer - 

任务启动时刻                    : 2019-01-29 16:10:00

任务结束时刻                    : 2019-01-29 16:10:14

任务总计耗时                    :                 14s

任务平均流量                    :          176.48KB/s

记录写入速度                    :           4047rec/s

读出记录总数                    :               40475

读写失败总数                    :                   0

[root@localhost job]#


标题名称:Datax离线数据抽取(MySQL--Oracle)-创新互联
本文来源:http://jkwzsj.com/article/cogohg.html

其他资讯