OceanBase 数据同步到 MySQL
使用 OceanBase Reader 和 MySQL 的 Writer 搭配实现 OceanBase 数据同步到 MySQL 。 配置文件如下:
{ "job": { "setting": { "speed": { "channel": 16 }, "errorLimit": { "record": 0, "percentage": 0.1 } }, "content": [ { "reader": { "name": "oceanbasev10reader", "parameter": { "where": "", "readBatchSize": 10000, "column": [ "*" ], "connection": [ { "jdbcUrl": ["||_dsc_ob10_dsc_||obdemo:oboracle||_dsc_ob10_dsc_||jdbc:oceanbase://127.0.0.1:2883/tpcc"], "table": [ "bmsql_oorder" ] } ], "username": "tpcc", "password":"********" } }, "writer": { "name": "mysqlwriter", "parameter": { "writeMode": "replace", "username": "tpcc", "password": "123456", "column": [ "*" ], "session": [ "set session sql_mode='ANSI'" ], "preSql": [ "truncate table bmsql_oorder" ], "batchSize": 512, "connection": [ { "jdbcUrl": "jdbc:mysql://127.0.0.1:3306/tpccdb?useUnicode=true&characterEncoding=utf8", "table": [ "bmsql_oorder" ] } ] } } } ] } }
OceanBase 数据同步到 ORACLE
配置文件如下:
{ "job": { "setting": { "speed": { "channel": 16 }, "errorLimit": { "record": 0, "percentage": 0.1 } }, "content": [ { "reader": { "name": "oceanbasev10reader", "parameter": { "where": "", "readBatchSize": 10000, "column": [ "*" ], "connection": [ { "jdbcUrl": ["||_dsc_ob10_dsc_||obdemo:oboracle||_dsc_ob10_dsc_||jdbc:oceanbase://127.0.0.1:2883/tpcc"], "table": [ "bmsql_oorder" ] } ], "username": "tpcc", "password":"********" } }, "writer": { "name": "oraclewriter", "parameter": { "username": "tpcc", "password": "********", "column": [ "*" ], "preSql": [ "truncate table bmsql_oorder" ], "batchSize": 512, "connection": [ { "jdbcUrl": "jdbc:oracle:thin:@127.0.0.1:1521:helowin", "table": [ "bmsql_oorder" ] } ] } } } ] } }
附录:
- 4.1 OceanBase 的 MySQL 兼容性简介
- 4.2 如何使用 mysqldump 迁移 MySQL 表 OceanBase
- 4.3 如何使用 dbcat 迁移 MySQL 表结构到 OceanBase
- 4.4 如何把 MySQL 表数据导出到 CSV 文件
- 4.5 如何使用 OceanBase 的 LOAD 命令加载 csv 数据文件 OceanBase
- 4.6 如何使用 DataX 加载 CSV 数据文件到 OceanBase
- 4.7 如何使用 DATAX 迁移 MySQL数据到 OceanBase
- 4.8 如何使用 OBDUMPER / OBLOADER 工具导出/导入 OceanBase 数据
- 4.9 如何使用 DATAX 迁移 OceanBase 数据到 MySQL/ORACLE
- 4.10 如何使用 CANAL 将 MySQL 数据实时同步到 OceanBase
结束语
加入教程直播群方式一:钉钉群号3255 4020
加入教程直播群方式二:扫码下方二维码加入