Search code examples
sqlcorruptionh2database-restore

Restoring all possible information from a corrupt h2 database file


I have a seemingly corrupt h2 database. I can use org.h2.tools.Recover to get a .sql file with most of the information, however, a couple of tables are missing.

The contents of these tables is still in the original, corrupt database; and in the restored .sql file there is also the transaction log (although commented out) available. Is there any chance/tool to get back the contents of the left out tables?


Solution

  • I still don’t have 100% confirmation from my clients. But the problem only occurred in version 1.2.121 of the h2 db driver. A newer version, 1.2.147, could handle the problem and seemed to have fixed it. (It actually fixed it in a way that it still works in the older db version.)