datax离线同步oracle表到clickhouse实践1
{
"job": {
"setting": {
"speed": {
"channel": 1
}
},
"content": [
{
"reader": {
"name": "oraclereader",
"parameter": {
"username": "your_oracle_username",
"password": "your_oracle_password",
"connection": [
{
"querySql": [
"select * from your_oracle_table"
],
"jdbcUrl": [
"jdbc:oracle:thin:@//hostname:port/SID"
]
}
]
}
},
"writer": {
"name": "clickhousewriter",
"parameter": {
"username": "your_clickhouse_username",
"password": "your_clickhouse_password",
"column": [],
"session": [
"shard_by_expr_list=toInt32(id)%2",
"distributed_by_expr_list=toInt32(id)%2"
],
"bulk_size": 1000,
"jdbcUrl": "jdbc:clickhouse://your_clickhouse_host:port/database"
}
}
}
]
}
}
这个JSON配置文件定义了一个DataX作业,它从Oracle数据库的your_oracle_table
表中读取数据,并将数据写入ClickHouse数据库。在这个例子中,我们假设你已经替换了相关的数据库连接信息和查询语句。注意,在实际部署时,你需要根据你的数据库表结构和ClickHouse表结构相应地调整column
参数。
评论已关闭