July 19, 2009

Recovery after DROP [ TABLE | DATABASE ]

Posted by Vadim |

In your recovery practice we often face the problem when data lost by execution DROP TABLE or DROP DATABASE statement. In this case even our InnoDB Data Recovery tool can’t help, as table / directory with files was deleted (if you have innodb-file-per-table). And the same for MyISAM, all .MYD / .MYI / .frm – files are deleted in this case.

So first step after DROP is to restore files, and for ext3 file system there are two utilities which can help of you are fast (and lucky) enough.
First one is ext3grep http://code.google.com/p/ext3grep/, with some instruction on this page http://www.xs4all.nl/~carlo17/howto/undelete_ext3.html.
And also there is TestDisk, with wide list of functionality, one of them is to restore deleted files.

I don’t know such tools for xfs, so in this case DROP will be fatal.

But better advise is do your backups :)

Related posts: :Magic Innodb Recovery self healing::Dropping unused indexes::Slow DROP TABLE:
 

4 Comments »

  1. 1. zer4tul

    photorec or foremost might work for xfs. you can have a try.

    Comment :: July 20, 2009 @ 1:09 am

  2. 2. paul

    The real recovery process is called restore from last backup then relay binlog files since last backup up to point in time now().

    Comment :: July 20, 2009 @ 2:47 am

  3. 3. Aleksandr Kuzminsky

    If lost data worth time spent, InnoDB recovery tool can scan a disk image as well.

    Comment :: July 20, 2009 @ 8:38 am

  4. paul,

    I am all for it. Unfortunately this is not answer when one calls us asking for help with recovering data (and not having backup).

    Comment :: July 20, 2009 @ 9:25 am

 

Subscribe without commenting

Trackbacks/Pingbacks