Score:0

Restore partition file after deleting the other files

ro flag

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

ua flag
When a `.ibd` is deleted from the filesystem, the only hope involves having a backup.
ro flag
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
Score:0
ua flag

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.

ua flag
If this answer does not work, move the Question to dba.stackexchange.com ; there are more people with suitable knowledge of MySQL there.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.