Hello,

We are not being able to access one of our H2 databases. The message which 
we get when we try to connect to the database from H2 console is:

Exception in thread "main" org.h2.jdbc.JdbcSQLException: File corrupted 
while reading record: "92638602 of 92603520". Possible solution: use the 
recovery tool [90030-176]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:
344)
        at org.h2.message.DbException.get(DbException.java:178)
        at org.h2.message.DbException.get(DbException.java:154)
        at org.h2.store.PageStore.readPage(PageStore.java:1322)
        at org.h2.store.PageStore.getPage(PageStore.java:750)
        at org.h2.index.PageDataIndex.getPage(PageDataIndex.java:234)
        at org.h2.index.PageDataNode.getLastKey(PageDataNode.java:215)
        at org.h2.index.PageDataNode.getLastKey(PageDataNode.java:215)
        at org.h2.index.PageDataIndex.<init>(PageDataIndex.java:88)
        at org.h2.table.RegularTable.<init>(RegularTable.java:84)
        at org.h2.store.PageStore.openMetaIndex(PageStore.java:1610)
        at org.h2.store.PageStore.recover(PageStore.java:1405)
        at org.h2.store.PageStore.openExisting(PageStore.java:368)
        at org.h2.store.PageStore.open(PageStore.java:289)
        at org.h2.engine.Database.getPageStore(Database.java:2366)
        at org.h2.engine.Database.open(Database.java:657)
        at org.h2.engine.Database.openDatabase(Database.java:260)
        at org.h2.engine.Database.<init>(Database.java:254)
        at org.h2.engine.Engine.openSession(Engine.java:57)
        at org.h2.engine.Engine.openSession(Engine.java:164)
        at org.h2.engine.Engine.createSessionAndValidate(Engine.java:142)
        at org.h2.engine.Engine.createSession(Engine.java:125)
        at org.h2.engine.Engine.createSession(Engine.java:27)
        at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote
.java:331)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:107)
        at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:91)
        at org.h2.Driver.connect(Driver.java:74)
        at java.sql.DriverManager.getConnection(DriverManager.java:571)
        at java.sql.DriverManager.getConnection(DriverManager.java:215)
        at org.h2.tools.Script.execute(Script.java:159)
        at org.h2.tools.Script.execute(Script.java:137)
        at org.h2.tools.Script.runTool(Script.java:104)
        at org.h2.tools.Script.main(Script.java:53)


The error we are also getting is: 
*File corrupted while reading record: "index not found 16012". Possible 
solution: use the recovery tool [90030-171] 90030/90030 (Help).*

Just like the error message says, we have tried to recover the database 
using the recovery tool but the process failed. 
Database's file db.h2 is very large. Over 180GB in size. When we 
run org.h2.tools.Recover over that database to create an sql file we got 
the file which contains a different structure than the files we get when we 
perform the Recovery over some other h2 database.
By looking at the end of the file, the usual lines like dropping tables 
with generic names are not present. A lot more tables are created that the 
actual number of tables which should exist.

When we started org.h2.tools.RunScript by passing this sql file the 
database was successfully created and we could connect to it but the 
problem is that not all tables were restored (not sure if they exist at all 
in the sql file since it is too large to open and search through) and 
restored tables still contained generic names, for example O_65.

We suspect that the issue with indexes occurred because during some update 
operations over the database, Tomcat which was running the application 
which talks to h2 database got killed.

This is giving us a lot of trouble because the database in question is used 
by our customers in production.

Do you have any idea how we can recover our db file? Are you able to 
provide any help or hint how we can resolve the issue?

Regards,
Marko

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to