General SQL Error on Backup (How to repair H2 database?)

Hello - I’m currently running v1.7 and would like to upgrade. When I attempt to backup the (H2) database it errors out with a General SQL Error:

General error: “java.lang.RuntimeException: page[196201] data leaf table:276 RAZ1_FOLDER_SUBSCRIBE entries:8 parent:203404 keys:[166974193, 166974194, 166974195, 166974196, 166974197, 166974198, 166974199, 166974200] offsets:[1914, 1780, 1646, 1512, 1378, 1244, 1110, 977] parent 203404 expected 202848”; SQL statement: SELECT * FROM raz1_folder_subscribe [50000-174]

Is there a repair command for H2 that I’m missing? (Something that functions like mysqlcheck -r)

The tenant that it is having a problem with is the Demo tenant (raz1) which isn’t being used, if it makes any difference.

Any help would be greatly appreciated.

First off, DO NOT use the embedded database in production. Please switch to MySQL.

That said, we use the embedded H2 database. H2 has it’s own set of tool that allows you to check the data. We only bundle the JAR file with Razuna to access the file. However, you can use their tools too. Check out: https://h2database.com/html/main.html

1 Like

Thank you, Nitai - I was able to use the H2 recover tool (org.h2.tools.Recover) to extract the data, which is now getting loaded into MySQL. I appreciate the help!