![]() ![]() Note that after running this changeset, all the foreign key constraints will have been renamed… you’ll want to rename these back, as future liquibase changesets may reference them. To run it for “real” change “–dry-run” to “–execute”… but please review first and note that we haven’t run this in production yet!! ![]() (Note that there are backticks around the column names that seem to get lost in the formatting). ![]() Pt-online-schema-change -alter ‘ADD COLUMN form_namespace_and_path varchar(255), ADD COLUMN status varchar(32) NOT NULL DEFAULT “FINAL”, ADD COLUMN interpretation varchar(32), DROP COLUMN value_boolean, MODIFY COLUMN value_complex varchar(1000)’ D=openmrs,t=obs -u root -ask-pass -alter-foreign-keys-method drop_swap -charset utf8 -print -statistics -dry-run I was working yesterday on using Percona Toolkit to do this and have come up with something that appears to be working… it takes a few hours to run, but allows all 5 changesets to be run while the system is “online”… Percona Toolkit stresses through out its docs that you should use read the documentation very carefully, so here’s the command we use in ‘dryrun’ format: The changeset that alters the value_complex requires a full column copy and can take take 1-2 hours to run… it reading the docs it also appears that upgrading to MySQL 5.7 would not help this since the size of the VARCHAR field is being changed from 255 to 1000 (see ). We’ve confirmed that 4 of the 5 changesets (the ones that ADD and DROP) can be run “online” without locks in MySQL 5.6 (though they still take about an hour each to run), with one caveat… if your database was originally created with a version of MySQL prior to 5.6, the first change will need to lock and copy the entire table, at which point it will be updated to 5.6. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |