Think I've found what I'm looking for.

So, whenever I need to create an online backup, I run:

stmt.execute("SCRIPT TO 'backup.sql'");

And later, when I want to remove everything from the db and restore it to 
an earlier stage, I run:

stmt.execute("DROP ALL OBJECTS");

stmt.execute("RUNSCRIPT FROM 'backup.sql'");

Does this look like the right approach? 

Also, when I run the RUNSCRIPT statement, does it lock the db while it is 
executing?

Thanks.




On Friday, November 8, 2013 2:49:08 PM UTC, Rory wrote:
>
> Heres my scenario.
>
> I am using the H2 embedded database in a Java program, and the program is 
> currently running.
>
> So, say I had previously created an *online* backup, 'backup.zip', and now 
> want to replace the contents of the running database with the contents of 
> the database that was previously backup up.
>
> So, given that I have to do this programatically, what are my options?
>
> Would it be to:
>
> 1. Stop the currently running database (if so how do i do this - 
> programmatically?)
>
> 2. Delete the current .db that is present on disk, and replace it with the 
> online backup created previously (i.e. extract the .db file from the zip 
> and place it on the correct location on disk)?
>
> 3. Restart the database (programatically)?
>
>
>
> Listed on the London Stock Exchange: 
> WAND<http://www.bloomberg.com/quote/WAND:LN>
>
> THIS MESSAGE AND ANY ATTACHMENTS ARE CONFIDENTIAL, PROPRIETARY, AND MAY BE 
> PRIVILEGED.  If this message was misdirected, WANdisco, Inc. and its 
> subsidiaries, ("WANdisco") does not waive any confidentiality or privilege. 
>  If you are not the intended recipient, please notify us immediately and 
> destroy the message without disclosing its contents to anyone.  Any 
> distribution, use or copying of this e-mail or the information it contains 
> by other than an intended recipient is unauthorized.  The views and 
> opinions expressed in this e-mail message are the author's own and may not 
> reflect the views and opinions of WANdisco, unless the author is authorized 
> by WANdisco to express such views or opinions on its behalf.  All email 
> sent to or from this address is subject to electronic storage and review by 
> WANdisco.  Although WANdisco operates anti-virus programs, it does not 
> accept responsibility for any damage whatsoever caused by viruses being 
> passed.
>
>
-- 
Listed on the London Stock Exchange: 
WAND<http://www.bloomberg.com/quote/WAND:LN>

THIS MESSAGE AND ANY ATTACHMENTS ARE CONFIDENTIAL, PROPRIETARY, AND MAY BE 
PRIVILEGED.  If this message was misdirected, WANdisco, Inc. and its 
subsidiaries, ("WANdisco") does not waive any confidentiality or privilege. 
 If you are not the intended recipient, please notify us immediately and 
destroy the message without disclosing its contents to anyone.  Any 
distribution, use or copying of this e-mail or the information it contains 
by other than an intended recipient is unauthorized.  The views and 
opinions expressed in this e-mail message are the author's own and may not 
reflect the views and opinions of WANdisco, unless the author is authorized 
by WANdisco to express such views or opinions on its behalf.  All email 
sent to or from this address is subject to electronic storage and review by 
WANdisco.  Although WANdisco operates anti-virus programs, it does not 
accept responsibility for any damage whatsoever caused by viruses being 
passed.

-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to