1. UnDROP Tool For InnoDB

UnDROP Tool For InnoDB

UnDROP Tool For InnoDB

The TwinDB data recovery toolkit is a set of tools that work with InnoDB tablespaces at low level.

Incredible Performance Of Stream_parser

stream_parser is a tool that finds InnoDB pages in a stream of bytes. It can be either a file such as ibdata1, *.ibd or a raw partition.
stream_parser runs as many parallel workers as the number of CPUs in the system.  The performance of stream_parser is amazing! Compare how stream_parser outperforms page_parser on a four-CPU virtual machine running on my laptop:

As you see, it takes almost 20 minutes to parse 18G partition.

Let’s check stream_parser

So, 18 minutes versus 31 seconds. 34 times faster! Impressive, isn’t it?

C_parser Improvements

c_parser is a tool that reads an InnoDB page or many pages, extracts records and stores them in tab-separated values dumps. However, an InnoDB page with user data doesn’t store information about table structure. You should tell c_parser what fields you’re looking for. Furthermore, the command line option -t specifies a file with CREATE TABLE statement.

For example, this is how it works. Here’s the CREATE statement (I took it from mysqldump)

And now, let’s fetch records of the table actor from InnoDB pages:

MySQL 5.6 introduced few format changes. However, most of them were already supported. On top of that, the c_parser fixes some bugs in the processing temporal fields.

The new UnDROP tool for InnoDB is still no reason not to take backups :-), but at least you can be better  armed if the inevitable happens.

How to Recover Table Structure

Normally, MySQL stores table structure in a respective .frm file. When the table is dropped, the .frm file is gone. Fortunately, InnoDB stores a copy of the structure in the dictionary. Sys_parser is a tool that can read the dictionary and generate a CREATE TABLE statement. Check how you can Recover Table Structure From the InnoDB Dictionary.

How to Install the TwinDB Data Recovery Toolkit

Check out the source code from GitHub:

Next, you can compile the source code. But first, don’t forget to install dependencies: make, gcc, flex, bison.

UPDATE:

The toolkit is tested on following systems:

  1. CentOS release 5.10 (Final) x86_64
  2. CentOS release 6.5 (Final) x86_64
  3. CentOS Linux release 7.0.1406 (Core) x86_64
  4. Fedora release 20 (Heisenbug) x86_64
  5. Ubuntu 10.04.4 LTS (lucid) x86_64
  6. Ubuntu 12.04.4 LTS (precise) x86_64
  7. Ubuntu 14.04 LTS (trusty) x86_64
  8. Debian GNU/Linux 7.5 (wheezy) x86_64

32 bit operating systems are not supported.

Have a question? Ask the experts!

Previous Post Next Post