Not the answer you need?
Register and ask your own question!

pt-online-schema-change - rename FK problem

shkembshkemb EntrantCurrent User Role Beginner
Hi everyone,

I have a question regarding the toolkit ‘pt-online-schema-change’ (percona-toolkit-3.0.5-1.el6.x86_64).
We are using this toolkit for OPTIMIZE tables of our production databases (MySQL 5.5.42). Until now it is working well except name of constraints (foreign keys). Always when this tool execute a MySQL table, it renames (add or remove an underscore in front of FK name) all foreign keys on this table. I know that this is done because of MySQL restriction to not allow two foreign keys with the same name. But does it have this toolkit (pt-online-schema-change’) any parametrization that will rename again the foreign keys in previous name like before executing the toolkit (like rename of tables: _tablename_new --> tablename)?

Execution of this tool is done like below:
pt-online-schema-change -h ${MYSQL_HOST} -u ${MYSQL_USER} -p${MYSQL_PASSWORD} --execute --print --alter "ENGINE=InnoDB" --alter-foreign-keys-method=rebuild_constraints D=${DATABASE_NAME},t=$table

If anyone can support us in this question, I will appreciate.


Thanks,
Shkemb
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.