MySQL Forums
Forum List  »  Data Recovery

InnoDB recovery
Posted by: Rudolf Poels
Date: July 24, 2007 01:53AM

Hi!

Situation:

We have a corrupted ibdata1 file, and no logs.
I need to salvage whatever I can from this file. How would I go about it?

I tried:

fresh mysql installation
stopped db
recreated the frm files (first took backup, later redid create table statements)
removed innodb log and data files
replaced innodb data file with the corrupted one
started first with recovery set to 0, failed
started with recovery set to 1, failed
started with recovery set to 2, database started, complaining that the number of pages in the header was not equal to the actual number of pages (which is correct, as about 243M of the file is lost)

<snip>
InnoDB: Your database may be corrupt or you may have copied the InnoDB
InnoDB: tablespace but not the InnoDB log files. See
InnoDB: http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html
InnoDB: for more information.
InnoDB: Error: tablespace size stored in header is 978944 pages, but
InnoDB: the sum of data file sizes is only 948992 pages
070724 0:11:30 InnoDB: Started; log sequence number 671 2302454239
</snip>

show tables now shows the correct tables, but a select from the table tells me that it's not there

<snap>
mysql> select count(id) from table_name;
ERROR 1146 (42S02): Table 'database.table_name' doesn't exist
mysql>
</snap>

I am at a loss. is there any way to recover at least some of the data from the ibdata file?

Kind regards,

Rudolf

Options: ReplyQuote


Subject
Views
Written By
Posted
InnoDB recovery
12061
July 24, 2007 01:53AM
7516
August 02, 2007 03:13AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.