上篇讲到了迁移库表结构:https://blog.51cto.com/u_15162069/2697769,这篇继续迁移数据,迁移数据使用的是dataX,我这安装的是ob技术人员给的一个rpm:t_dp_dw_datax_3_core_all-20210223-external.noarch.rpm,装完之后叫datax3,刚开始用datax没找到

把oracle数据迁移到oceanbase(二)_oracle数据迁移

使用命令:python /home/admin/datax3/bin/datax.py /ob/soft/datax/job/full_nan.json

主要就是那个job json文件,在我这的示例如下:

{
    "job": {
        "setting": {
            "speed": {
                "channel":128
            },
            "errorLimit": {
                "record": 0
            }
        },
        "content": [
            {
                "reader": {
                    "name": "oraclereader",
                    "parameter": {
                        "username": "oracle用户名",
                        "password": "密码",
                        "column": ["*"],
                        "connection": [
                            {
                                "table": ["APPLICATION"],
                                "jdbcUrl": [
                                     "jdbc:oracle:thin:@192.168.8.176:1521/orcl"
                                ]
                            }
                        ]
                    }
                },
            "writer": {
                    "name": "oceanbasev10writer",
                    "parameter": {
                        "writeMode": "update",
                        "username": "ob oracle租户下的用户名",
                        "password": "密码",
                        "writerThreadCount": 128,
                        "batchSize": 256,
                        "useObproxy": true,
                        "preSql": ["truncate table @table"],
                        "column": ["*"],
                        "connection": [
                            {
                                "jdbcUrl": "||_dsc_ob10_dsc_||ob集群名:oracle租户名||_dsc_ob10_dsc_||jdbc:oceanbase:oracle://192.168.1.45:2881/zhjxkh_test", 
                                "table": ["APPLICATION"]
                            }
                        ]
                    }
                }
            }
        ]
    }
}

 

dataX在网上的示例挺多的,就不在赘述了