Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Datax offline data extraction (MySQL--Oracle)

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Datax download address: https://github.com/alibaba/DataX

Datax MySQL read: https://github.com/alibaba/DataX/blob/master/mysqlreader/doc/mysqlreader.md

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

1. Download and install Datax software (jdk version 1.8 or above must be installed)

[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/

two。 Edit the configuration file (first synchronize the table structure with 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. Data extraction

[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 VMInfo# operatingSystem class 1015 00.236 [main] INFO VMInfo-VMInfo# operatingSystem class = > sun.management.OperatingSystemImpl

2019-01-29 16 the machine info 1014 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 1014 04.908 [job-0] INFO JobContainer-

2019-01-29 16 10 14. 407 [job-0] INFO JobContainer-

Mission start time: 2019-01-29 16:10:00

End of mission: 2019-01-29 16:10:14

Total task time: 14s

Average task traffic: 176.48KB/s

Record write speed: 4047rec/s

Total number of read records: 40475

Total number of read and write failures: 0

[root@localhost job] #

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report