I have a large MyISAM table which has crashed. Repairing the table will take some time. The table only INSERTed to and SELECTed from, never updated. To allow the application to continue working, albeit with reduced capability, I thought of
- renaming the crashed table
- creating a new table with the original name
- switching processing back on
- repairing the backup table
- switching off processing
- merging the repaired and new data
- switching on processing
The other steps in this process do not pose any risk due to the nature of the application. Is it safe to rename a crashed MyISAM table? How?
I believe that I can't simply do ALTER TABLE...RENAME.... as this always does a row-by-row copy into a new table.
Apparently Peter Zaitsev uses a "tiny script which moves out all MyISAM tables out of MySQL database directory" but doesn't seem to give details of what this script does (presumably stops database first?).