Quantcast
Channel: MySQL Forums - InnoDB
Viewing all articles
Browse latest Browse all 1957

Can I recover Innodb data with a _bad_ ibdata file? (no replies)

$
0
0
Hi

Redhat 5 x86_64
MySQL 5.1.49sp1
using innodb_file_per_table


I recently used zmanda to restore a database that has only innodb tables to a different server.
After the restores was complete, I was unable to start the instance. The log was complaining about ibdata. For example:
<snip>
101228 13:29:37 [Note] Event Scheduler: Purging the queue. 0 events
101228 13:29:39 InnoDB: Starting shutdown...
101228 13:29:42 InnoDB: Shutdown completed; log sequence number 634 2955705313
101228 13:29:42 [Note] /usr/sbin/mysqld: Shutdown complete

101228 13:29:43 mysqld_safe mysqld from pid file /sqldata/data/r410-01.pid ended
101228 14:00:49 mysqld_safe Starting mysqld daemon with databases from /sqldata/data
101228 14:00:49 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: Log scan progressed past the checkpoint lsn 1821 3668139136
101228 14:00:50 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Error: trying to add tablespace 1003 of name './aaa/sessions.ibd'
InnoDB: to the tablespace memory cache, but tablespace
InnoDB: 1003 of name './sts/message_sent_archive#P#p201010.ibd' already exists in the tablespace
InnoDB: memory cache!
{skipping some more entries like those above...}
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 1821 3673381888
InnoDB: Doing recovery: scanned up to log sequence number 1821 3678624768
{skipping again...}
101228 14:08:36 InnoDB: Error: table 'CC/Companies'
InnoDB: in InnoDB data dictionary has tablespace id 6245,
InnoDB: but a tablespace with that id does not exist. There is
InnoDB: a tablespace of name ./CC/Companies.ibd and id 2225, though. Have
InnoDB: you deleted or moved .ibd files?
InnoDB: Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting-datadict.html
InnoDB: for how to resolve the issue.
</snip>

Since I was unable to restart the instance, I copied the most important databases to another location as well as the ibdata1 ,ib_logfile0 and ib_logfile1 to another location. The databases I copied contain only Innodb tables.

I deleted everything, but the mysql database, and started the instance as if it was _new_. It is up and running. Obviously all the data that was originally in this instance is gone.

Can I recover those databases that I moved?

Thanks
- Gabe

Viewing all articles
Browse latest Browse all 1957

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>