--dry-run
Create and alter the new table, but do not create triggers, copy data, or replace the original table.
--execute
Indicate that you have read the documentation and want to alter the table.
You must specify this option to alter the table.
If you do not, then the tool will only perform some safety checks and exit.
This helps ensure that you have read the documentation and understand how to use this tool.
If you have not read the documentation, then do not specify this option.
用法:
验证是否可用
pt-online-schema-change --alter "modify treatment_afterday INT(4) NULL" D=portal,t=comment_expert -uroot -p*** --dry-run
执行:
pt-online-schema-change --alter "modify treatment_afterday INT(4) NULL" D=portal,t=comment_expert -uroot -pzhujie1986 --execute
原文链接:http://www.2cto.com/database/201401/272616.html