Skip to main content
added step-by-step to reproduce the orphaned table error
Source Link
Derek Downey
  • 23.5k
  • 11
  • 78
  • 104

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):

  • I copied the v3_zone_date_cpm7k to a different location (as a backup).

  • issue a DROP TABLE v3_zone_date_cpm7k

  • copy the v3_zone_date_cpm7k files BACK to the datadir

    desc v3_zone_date_cpm7k;

    ERROR 1146 (42S02): Table 'v3_zone_date_cpm7k' doesn't exist

[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.

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'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):

  • I copied the v3_zone_date_cpm7k to a different location (as a backup).

  • issue a DROP TABLE v3_zone_date_cpm7k

  • copy the v3_zone_date_cpm7k files BACK to the datadir

    desc v3_zone_date_cpm7k;

    ERROR 1146 (42S02): Table 'v3_zone_date_cpm7k' doesn't exist

[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.

fixed a logical step issue
Source Link
Derek Downey
  • 23.5k
  • 11
  • 78
  • 104

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. And reissueThen import the DROP TABLE command.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'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. And reissue the DROP TABLE command.

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'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.

Source Link
Derek Downey
  • 23.5k
  • 11
  • 78
  • 104

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. And reissue the DROP TABLE command.

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.