Cut-over - AWS Database Migration Service
AWS 文档中描述的 AWS 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 AWS 服务入门

如果我们为英文版本指南提供翻译,那么如果存在任何冲突,将以英文版本指南为准。在提供翻译时使用机器翻译。

Cut-over

在数据验证完成并解决任何问题后,您可以加载数据库触发器、功能和程序。

为此,请使用 routines.sql 从Mariadb生成的文件,以创建必要的例行程序 Aurora MySQL. 以下陈述将所有程序、功能和触发器加载到 Aurora MySQL 数据库。

$ mysql -h mysqltrg-instance-1.xxxxxxxxx.us-east-1.rds.amazonaws.com -u master -p migration -P 3306 < routines.sql

加载程序后,连接到 Aurora MySQL 要验证的数据库,如下所示。

$ mysql -h mysqltrg-instance-1.xxxxxxxxx.us-east-1.rds.amazonaws.com -u master -p migration -P 3306 Enter password: Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MariaDB monitor. Commands end with ; or \g. Your MySQL connection id is 957 Server version: 5.6.10 MySQL Community Server (GPL) Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MySQL [migration]> select routine_schema as database_name, -> routine_name, -> routine_type as type, -> data_type as return_type -> from information_schema.routines -> where routine_schema not in ('sys', 'information_schema', -> 'mysql', 'performance_schema'); +---------------+----------------+-----------+-------------+ | database_name | routine_name | type | return_type | +---------------+----------------+-----------+-------------+ | migration | CalcValue | FUNCTION | int | | migration | loadMLBPlayers | PROCEDURE | | | migration | loadNFLPlayers | PROCEDURE | | +---------------+----------------+-----------+-------------+ 3 rows in set (0.002 sec) MySQL [migration]> select TRIGGER_SCHEMA, TRIGGER_NAME from information_schema.triggers where TRIGGER_SCHEMA='migration'; +----------------+-----------------------+ | TRIGGER_SCHEMA | TRIGGER_NAME | +----------------+-----------------------+ | migration | increment_animal | | migration | contacts_after_update | +----------------+-----------------------+ 2 rows in set (0.009 sec)

前面的输出显示所有程序、触发器和功能均已成功加载到 Aurora MySQL 数据库。