I think it has something to do with the BACKUP TO command. 

I have done the following tests:

1) "Offline copy"
* Shutdown my application (using 2.1.212)
* copy the mv.db to my PC
* open it with the H2 console (2.2.219)
* run "SHUTDOWN COMPACT"
=> the database file shrinked and could be opened without problems

2) "Online copy" 
* start my application (2.1.212)
* export the database with: "java  org.h2.tools.Shell -url 
"jdbc:h2:tcp://localhost/~/data/database;LOCK_TIMEOUT=86400000" -user 
xxx-password xxx -sql "BACKUP TO 'database.mv.db'"
* copy the exported database.mv.db to my PC
* open it with the H2 console (2.2.219)
 => database could not be opened: File corrupted while reading record 
"database.mv.db"

I used the Recovery tool to examin the corrupted database.mv.db (before 
opening it with the H2 console).
I exits with: "Error: org.h2.mvstore.MVStoreException: Store header is 
corrupt: F:/temp/database.mv.db" [2.2.219/6]"
The txt file created by the Recover tool ends with:

ERROR illegal position 662614016

277eada0 eof

page size total: 0 bytes, page count: 1, average page size: 0 bytes
ERROR: org.h2.mvstore.MVStoreException: Store header is corrupt: 
F:/temp/database.mv.db [2.2.219/6]
org.h2.mvstore.MVStoreException: Store header is corrupt: F:/database.mv.db 
[2.2.219/6]
    at org.h2.mvstore.DataUtils.newMVStoreException(DataUtils.java:1003)
    at org.h2.mvstore.MVStore.readStoreHeader(MVStore.java:869)
    at org.h2.mvstore.MVStore.<init>(MVStore.java:463)
    at org.h2.mvstore.MVStore$Builder.open(MVStore.java:4082)
    at org.h2.mvstore.MVStoreTool.info(MVStoreTool.java:352)
    at org.h2.tools.Recover.process(Recover.java:243)
    at org.h2.tools.Recover.runTool(Recover.java:136)
    at org.h2.tools.Recover.main(Recover.java:102)

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/4ea6fbb7-72c7-40b5-a777-4d272a0ce82en%40googlegroups.com.

Reply via email to