chunjun icon indicating copy to clipboard operation
chunjun copied to clipboard

sync模式数据同步问题

Open hj102015 opened this issue 3 years ago • 3 comments
trafficstars

我使用sync数据同步,mysql->oracle,schema名不同,报错表无法找到。 经分析,在PreparedStmtProxy类getOrCreateFieldNamedPstmt方法时,获取database和tableName均为从源数据库获取,而去目标数据源查该表,此处应该使用用户配置的数据(如无配置,可默认当前模式),请核实。谢谢。

hj102015 avatar Jun 17 '22 09:06 hj102015

可以通过配置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
      }
    }
  }
}

FlechazoW avatar Jun 19 '22 13:06 FlechazoW

明白了,我想再请教一下,咱们支持binlog模式同步至oracle数据库或者logmonier同步之mysql吗

hj102015 avatar Jun 20 '22 07:06 hj102015

支持的。

FlechazoW avatar Jun 20 '22 07:06 FlechazoW