0

I have a date based partitioned database table like this

archivedmsgs#p#p202001.ibd
archivedmsgs#p#p202002.ibd
archivedmsgs#p#p202003.ibd
.
.
archivedmsgs#p#p202012.ibd
archivedmsgs#p#p2021.ibd

the 2020 partition files got deleted only archivedmsgs#p#p2021.ibd left how can I restore it's data

Halfgaar
  • 8,084
  • 6
  • 45
  • 86
  • When a `.ibd` is deleted from the filesystem, the only hope involves having a backup. – Rick James Feb 08 '22 at 01:31
  • I don't want to restore the deleted files, only archivedmsgs#p#p2021.ibd left and I need it's data but when I try to access the table I get "table doesn't exist in engine" error – Mustafa Feb 08 '22 at 05:31

1 Answers1

0

Is this what you mean? "When you try to use the table archivedmsgs, it claims to be missing?" Apparently, that is the message you get even when one partition is missing.

There may be a cure.

Create a similar table with a the same schema and same partitioning. That will create a file called archivedmsgs#p#p2021.ibd. Move that into place.

Do that in a different DATABASE so that the table (and file) name can be the same without conflicting.

Rick James
  • 2,463
  • 1
  • 6
  • 13
  • If this answer does not work, move the Question to dba.stackexchange.com ; there are more people with suitable knowledge of MySQL there. – Rick James Feb 08 '22 at 07:15