I've spent a bit of time trying to reproduce the error on the partition scheme, but cannot get the exact error with the orphaned table
120927 16:57:04 [ERROR] Cannot find or open table reportingdb/v3_zone_date_cpm7k#P#pcurrent_2012926 from
the internal data dictionary of InnoDB though the .frm file for the
table exists.
By moving the .ibd file for the partition out of the data directory (which it seems somehow has happened), I get an expected error:
[ERROR] MySQL is trying to open a table handle but the .ibd file for
table foo/v3_zone_date_cpm7k#P#pcurrent_2012822 does not exist.
From a chat discussion I know you have an outdated backup file. Barring actually being able to force drop the partition 'pcurrent_2012926' (some data loss), the steps to restore this backup are as follows (a month worth of data loss unfortunately):
- Take a backup of your main server (just in case!)
- Restore the backup on a different server
- Take a mysqldump of the table:
mysqldump -uuser -p reportingdb v3_zone_date_cpm7k > v3_zone_date_cpm7k.sql
- copy v3_zone_date_cpm7k.sql to the main server
- On the main server, attempt to do this:
DROP TABLE reportingdb.v3_zone_date_cpm7k
- If that works, import your dumpfile:
mysql -uuser -p reportingdb < v3_zone_date_cpm7k.sql
which should restore that table (with a month-old table)
- If the
DROP TABLE
does not work, try moving the v3_zone_date_cpm7k.frm
and other files to a different location and restarting the server. Then import the dump file
The last step is in regards to the error message telling you you have an orphaned table:
This means that there is an orphaned .frm file without a corresponding table inside InnoDB. You can drop the orphaned .frm file by deleting it manually. [src]
I really hope this is not necessary and you can restore the partition by another means. This is a last resort method.
I finally reproduced your initial error. Though it will do little to restore the partition, it might be helpful to understand to keep this from happening in the future (potential issue in how backup/restore process is handled, or how the partitions are created):
[ERROR] Cannot find or open table v3_zone_date_cpm7k#P#p00 from
the internal data dictionary of InnoDB though the .frm file for the
table exists.
Best Answer
The log buffer writes redo log information to ib_logfile0 and ib_logfile1 for transactional purposes only. There is nothing text readable within those files.
The file /var/log/mysqld.log is the main error-logging mechanism built in mysql. Anything additional would probably be in /var/log/messages.