MySQL Forums
Forum List  »  InnoDB

Re: Is it OK to manually delete stray .ibd temporary file after crash?
Posted by: Shawn Heisey
Date: October 22, 2008 07:06AM

I'm no expert, but this is at least partially related to what I posted about late last night. I am inferring from what you've said that you turned on innodb_file_per_table well after your database was established, and that this table is at least 8GB in size, perhaps larger. Are you low on disk space?

When file_per_table is active and working as expected, the .ibd file IS your table, it's not a temporary file. If however the database structure was last modified before you turned the option on, the table will exist in the ibdata1 file.

Making structural changes to your database after changing the setting will cause MySQL to extract your table from the ibdata1 file and create the .ibd file ... but it will never reduce the size of the ibdata1 file when it does this. The only way to reclaim the disk space is to export all your data, drop the databases, delete the ibdata1 file, and re-import the databases. This is the procedure I am having trouble doing that I posted about.

If your database is working, the .ibd file still has the August 7th date, and it is not mentioned in the output of the following command while MySQL is running, it is probably safe to delete it.

lsof | grep "\.ibd"

If you don't have enough disk space to have a complete copy of your table in the database directory at the same time as the data exists in the ibdata1 file, you won't be able to make any changes to your table structure with the file_per_table option active.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Is it OK to manually delete stray .ibd temporary file after crash?
8255
October 22, 2008 07:06AM


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.