justinbieber1997 2020-10-29 10:21
浏览 532

老数据迁移到现有数据库,现有数据库用sharding-jdbc分库分表了,那么我该迁移到哪个库的哪个表呢?

我的方案是在主库里新建一个表,把老数据手动迁移过去,并且不希望后续系统往里插数据
新表只存我手动迁移的老数据,并且老数据也能在系统里查到,现有配置如图图片说明
spring.shardingsphere.sharding.tables.ent_invoice.actual-data-nodes=ds$->{0..1}.ent_invoice$->{0..1}

spring.shardingsphere.sharding.tables.ent_invoice.databaseStrategy.inline.shardingColumn=FPFM

spring.shardingsphere.sharding.tables.ent_invoice.databaseStrategy.inline.algorithmExpression=ds$->{Math.abs(FPFM.substring(FPFM.length()-1,FPFM.length()).hashCode()) % 2}

spring.shardingsphere.sharding.tables.ent_invoice.table-strategy.inline.sharding-column=FPFM

spring.shardingsphere.sharding.tables.ent_invoice.table-strategy.inline.algorithm-expression=ent_invoice$->{Math.abs(FPFM.hashCode()) % 2}

我是不是只需要在第一行配置后面加上我的新表(ds0.ent_invoice_sk)就行,别的不用动?

  • 写回答

0条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥70 基于模糊控制的统一混沌控制器代码
      • ¥15 有没有精通光束整形的能读懂
      • ¥15 关于#STM32#与AMG8833采用双插值算法进行热成像显示不正常的问题,如何解决?
      • ¥15 求解! 头歌操作系统 课堂练习6.1 块设备访问
      • ¥15 comsol低温等离子体射流气体摩尔分数作为初始摩尔浓度参数输入到介质管出口流注无法推进了
      • ¥15 有没有人解答51的这个问题,如何解决?(关键词-数码管)
      • ¥15 python 爬虫问题
      • ¥15 求运用模拟退火算法寻优,以下是参考我的参考代码
      • ¥15 VB6.0中OptionButton不能赋值TextBox100
      • ¥15 主窗体激活keydown事件,但是阻塞了主线程