Getting a copy of your tablespace fileWaste no time. As soon as damage has been done, or as soon as you can react upon it, take a snapshot of your tablespace. Exactly what is your tablespace depends on your settings. - When using innodb_file_per_table, the answer is easy. It's the .ibd file.
- When using shared tablespace, this may be the ibdata file; some prefer to split it. The may be more tablespace files. If you're not sure, you're looking for ibdata1.
Making the copyThe tools work offline the MySQL server. They work directly on the tablespace file. It is therefore important to have a quite file, to which no one writes. Best to copy it somehow aside. There are a few options for that: - Taking a snapshot (LVM; FS based; appliance based).
- Setting innodb_fast_shutdown; taking MySQL down; copying the tablespace file(s).
- Using Google Patches v2, SET GLOBAL innodb_disallow_writes=1, then copy tablespace file(s).
Next: Splitting shared tablespace file
|