Hi,
I have the same requirement (So mustn't be too unusual). I achieve this
by just backing up the database using the BACKUP statement. It basically
takes a copy of the database and zips it. Very quick. I run it with
multithreaded mode on so it doesn't block access while it is backing up
(Although I remember something on the forums saying it does block, but
it seems to work fine for me). I haven't had any corruptions occur yet,
but I must say the database isn't under heavy use and a corruption of
the snapshot isn't a big deal for my case. In any case if you just back
it up without the multithreaded it will be safe and only block
momentarily. Just unzip it and you have your snapshot. :)
Cheers, Ryan
On 7/04/2011 6:57 AM, timbo wrote:
We are using H2 in embedded mode, and have an unusual requirement to
copy snapshots of an open DB file periodically. Is the following
procedure safe (won't lose/corrupt data in the master or snapshot DB
file)?
1) SET EXCLUSIVE 1
2) CHECKPOINT SYNC
3) Copy DB file
4) SET EXCLUSIVE 0
5) Continue using database
This would seem to be much faster than shutting down, copying and
opening the db.
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en.