Repair Db with missing LOB-Data

60 views
Skip to first unread message

sascha

unread,
Oct 1, 2012, 4:20:28 AM10/1/12
to h2-da...@googlegroups.com
Hi

I searched this group for a solution to my problem, but couldn't find anything. Hope I didn't just miss it. If so, my apologies.

We are using H2 for many years now in our consumer product; currently we are using V1.2.123 (which is quite old and we are planning to update to a newer version).

Every now and then we are seeing users having problems with missing LOB-Files in their database. This problem usually shows when we have to migrate the data from one version of our software to a newer version. We do this by creating a SQL-Dump that then is imported into an new database which then gets migrated. Now in some cases the dump file cannot be imported because of a FileNotFoundException for one or more LOB-Files:

File not found: D:\Project\websites\Kunden\xxx\data\data.lobs.db\6.t225.lob.db; SQL statement:
SCRIPT [90124-118]

This also happens when we try to import the dump of a Db that is corrupted in this way via runscript from the H2 Console.
We have also tried the repair-Tool, which leads to the same result: the file causes an exception when we try to import it via runscript in the H2 Console.

Now my question: is there a way to "repair" the Database, e.g. by just ignoring the missing LOB-Data?
(Loosing some data is still better than having a database that is completely unusable since it cannot be recreated from a dump.)

Many thanks in advance for any help.
Message has been deleted
Message has been deleted

Thomas Mueller

unread,
Oct 19, 2012, 3:19:53 AM10/19/12
to H2 Google Group
Hi,

Please send emails to the group and not to me directly.

If the database can't be read from the new version, it is required to load two versions of H2 (but not strictly at the same time). H2 automatically does this if the data file is called <dbName>.data.db and not <dbName>.h2.db, but in this case the upgrade jar file needs to be in the class path.

If the database is readable from the new version, you should be able to just use the new version of H2 to do the migration.

Regards,
Thomas


On Thu, Oct 18, 2012 at 10:02 AM, sascha frick (empros gmbh) ... wrote:
Hi Thomas

No problem at all. Your answer is very much appreciated.
Hope you had a good vacation time!

One last question regarding the migration of existing DBs:  The docu suggests to dump the DB with the old version and then to import the script using the new version.
Is this the only way or is it save to use the new version to dump the DB? We ship H2 as part of our software and need to migrate databases upon opening them. Therefore we would need to load two different version of the H2 lib at the same time.

Many thanks!
Regards,
-sascha

Reply all
Reply to author
Forward
0 new messages