chunjun
chunjun copied to clipboard
sync模式数据同步问题
trafficstars
我使用sync数据同步,mysql->oracle,schema名不同,报错表无法找到。 经分析,在PreparedStmtProxy类getOrCreateFieldNamedPstmt方法时,获取database和tableName均为从源数据库获取,而去目标数据源查该表,此处应该使用用户配置的数据(如无配置,可默认当前模式),请核实。谢谢。
可以通过配置schema 和 table参数来确定上下游对应的表。
例如:
{
"job": {
"content": [
{
"reader": {
"name": "mysqlreader",
"parameter": {
"column": [
{
"name": "id",
"type": "int"
},
{
"name": "name",
"type": "varchar"
},
{
"name": "price",
"type": "double"
}
],
"customSql": "",
"where": "",
"splitPk": "id",
"increColumn": "id",
"queryTimeOut": 1000,
"username": "root",
"password": "admin123",
"connection": [
{
"jdbcUrl": [
"jdbc:mysql://k3:3306/tiezhu?useSSL=false"
],
"table": [
"one"
]
}
]
}
},
"writer": {
"parameter": {
"column": [
{
"name": "ID",
"type": "INT"
},
{
"name": "NAME",
"type": "VARCHAR"
},
{
"name": "PRICE",
"type": "float"
}
],
"updateKey": {
"key": [
"ID"
]
},
"batchSize": 100,
"connection": [
{
"jdbcUrl": "jdbc:oracle:thin:@172.16.100.243:1521:orcl",
"table": [
"TIEZHU.TEST_THREE"
]
}
],
"writeMode": "UPDATE",
"timeOut": 5,
"username": "oracle",
"password": "oracle"
},
"name": "oraclewriter"
}
}
],
"setting": {
"speed": {
"bytes": 0,
"channel": 1
}
}
}
}
明白了,我想再请教一下,咱们支持binlog模式同步至oracle数据库或者logmonier同步之mysql吗
支持的。