Search code examples
mysqllinuxinnodbdisaster-recovery

How can I recover the fike base from this ID? Data Recovery for MySQL


I'm actually confused now on how can I get the right page number for the current result from my ibdata1. Most of the documentation, consist and instruct to do like this:

With this monitor enabled, we had to look at the MySQL error log (/var/log/mysql/error.log) in order to locate the page index of our corrupted table:

TABLE: name database/sp_account, id 0 85, columns 23, indexes 2, appr.rows 220
...
INDEX: name PRIMARY, id 0 215, fields 1/22, uniq 1, type 3
root page 401, appr.key vals 220, leaf pages 3, size pages 4
...
In this output, it shows that we have to look at the page located in the 0-215 subdirectory of our extracted pages (ie pages-1328713071/FIL_PAGE_INDEX/0-215/).

Then, we had to merge the pages files into one:

find pages-1328713071/FIL_PAGE_INDEX/0-215/ -type f -name '*.page' | sort -n | xargs cat > merged_file

But, what I have here is this:


TABLE: name db/tablename, id 512, flags 29, columns 16, indexes 9, appr.rows 0
  COLUMNS: id: DATA_INT DATA_BINARY_TYPE DATA_NOT_NULL len 4; createdAt: DATA_FIXBINARY DATA_BINARY_TYPE len 5; updatedAt: DATA_FIXBINARY DATA_BINARY_TYPE len 5; nid: DATA_VARMYSQL len 765; ngroup: DATA_VARMYSQL len 765; tour: DATA_VARMYSQL len 765; value: DATA_VARMYSQL len 765; action: DATA_VARMYSQL len 765; IPAddress: DATA_VARMYSQL len 765; browser: DATA_VARMYSQL len 765; isMonitoring: DATA_INT DATA_BINARY_TYPE len 1; isEmbedded: DATA_INT DATA_BINARY_TYPE len 1; companyId: DATA_INT DATA_BINARY_TYPE len 4; DB_ROW_ID: DATA_SYS prtype 256 len 6; DB_TRX_ID: DATA_SYS prtype 257 len 6; DB_ROLL_PTR: DATA_SYS prtype 258 len 7;
  INDEX: name PRIMARY, id 586, fields 1/15, uniq 1, type 3
   root page 3, appr.key vals 100, leaf pages 1, size pages 1

If you will notice the difference the PRIMARY KEY id value of the first from the documenation is id 0 215, where in the result on my end is only this id 586.

Please help me and any help is highly and really appreciated.

Cheers,


Solution

  • Because stream_parser from undrop-for-innodb doesn't support compressed tablespace. You should use page_parser from https://code.launchpad.net/~akuzminsky/percona-data-recovery-tool-for-innodb/decompress