简体   繁体   English

AWS DMS和Redshift

[英]AWS DMS and Redshift

I am using DMS to migrate data from MySQL to Redshift. 我正在使用DMS将数据从MySQL迁移到Redshift。 Inside DMS, I use the 'full-load-and-ongoing' option to load data to Redshift. 在DMS内部,我使用'full-load-and-ongoing'选项将数据加载到Redshift。 Assuming the full-load is complete and the on-going is in progress,I would like to know how I can resume the DMS task in case we restore Redshift using an old snapshot. 假设已完成满载并且正在进行中,我想知道如果我们使用旧快照还原Redshift,如何恢复DMS任务。

Thanks in advance. 提前致谢。

You would need to 您需要

  1. Stop the DMS task 停止DMS任务
  2. Restore your target redshift 恢复目标红移
  3. RESTART your DMS task. 重新启动您的DMS任务。 (This will do the initial copy again and then reinstate the continuous replication) (这将再次执行初始复制,然后恢复连续复制)

If you have made any modifications to the target tables then change your task to truncate rather than drop and create. 如果对目标表进行了任何修改,则将您的任务更改为截断而不是删除和创建。

If you cannot have any downtime on your Redshift table then you could do the following. 如果您的Redshift表上没有任何停机时间,则可以执行以下操作。

  1. Rename your existing Redshift table to be _inuse, eg if your table is called orders then call it orders_inuse 将现有的Redshift表重命名为_inuse,例如,如果您的表被称为orders,则将其命名为orders_inuse
  2. Create a new "late binding" view like this 像这样创建一个新的“后期绑定”视图

    CREATE VIEW orders as SELECT * FROM orders_inuse WITH NO SCHEMA BINDING; 以SELECT * FROMorders_inuse的方式创建视图订单,不进行模式绑定;

  3. Set up DMS to replicate to orders_new table 设置DMS以复制到orders_new表

  4. Drop orders_inuse 删除订单

  5. recreate your view 重新创建您的视图

    CREATE or replace VIEW orders as SELECT * FROM orders_new WITH NO SCHEMA BINDING; 创建或替换VIEW订单为SELECT * FROMorders_new且没有模式绑定;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM