当前位置:网站首页>datax oracle to oracle incremental synchronization
datax oracle to oracle incremental synchronization
2022-08-04 10:43:00 【51CTO】
关于增量更新
DataX 支持多种数据库的读写, json 格式配置文件很容易编写, 同步性能很好, 通常可以达到每秒钟 1 万条记录或者更高, 可以说是相当优秀的产品, 但是缺乏对增量更新的内置支持.
其实增量更新非常简单, 只要从目标数据库读取一个最大值的记录, 可能是 DateTime 或者 RowVersion 类型, Then filter the tables to be synchronized in the source database based on this maximum value, 然后再进行同步即可.
由于 DataX 支持多种数据库的读写, A relatively simple and reliable way of thinking is:
1.利用 DataX 的 DataReader 去目标数据库读取一个最大值;
2.将这个最大值用 TextFileWriter 写入到一个 CSV 文件;
3.用 Shell 脚本来读取 CSV 文件, 并动态修改全部同步的配置文件;
4.执行修改后的配置文件, 进行增量同步.
5.将shell脚本加入crontab命令中
源端数据库192.168.56.100,目标端192.168.56.113
要实现增量更新, 首先要 oraclereader 从目标数据库读取最大日期, 并用 TextFileWriter 写入到一个 csv 文件,
Incremental synchronization using scripts
insert into t1 values(to_timestamp(‘2021-10-22 15:23:23.123456’,’yyyy-mm-dd hh24:mi:ss.ff’));
select to_char(update_time,’yyyy-MM-dd hh24:mi:ss’) from t1;
边栏推荐
猜你喜欢
Graphical Hands-on Tutorial--ESP32 OTA Over-the-Air Upgrade (VSCODE+IDF)
HCIP 第十八天
Use pytest hook function to realize automatic test result push enterprise WeChat
MATLAB程序设计与应用 3.2 矩阵变换
8月活动|51CTO十七周年庆,发博文得茶具/笔记本/T恤等礼品!
《迁移学习导论》第2版,升级内容抢先看!
OD-Model【5】:YOLOv1
zabbix deployment
MySQL: Integrity Constraints and Table Design Principles
Meishe Q&A Room | Meiying VS Meishe Cloud Editing
随机推荐
再次搞定 Ali 云函数计算 FC
云计算适合什么企业_当前全球云计算处于发展
MySQL核心SQL:结构化查询语句SQL、库操作、表操作、CRUD
OD-Model【5】:YOLOv1
在 .NET MAUI 中如何更好地自定义控件
在测试集上训练,还能中CVPR?这篇IEEE批判论文是否合理?
Maple 2022软件安装包下载及安装教程
Apache Calcite 框架原理入门和生产应用
JUC(1)线程和进程、并发和并行、线程的状态、lock锁、生产者和消费者问题
AWS Lambda related concepts and implementation approach
常用的输入对象
Jenkins使用手册(1) —— 软件安装
小程序容器加快一体化在线政务服务平台建设
LeetCode第三题(Longest Substring Without Repeating Characters)三部曲之三
zabbix部署
The difference between Mysql application log time and system time is eight hours
tp5+微信小程序 分片上传
粤黔协作,山海同心!578种贵州特色农产品走进粤港澳大湾区
Introduction to the core methods of the CompletableFuture interface
[论文翻译] Unpaired Image-to-Image Translation using Adversarial Consistency Loss