Just a couple of quick follow-ups: 1. Since I want a backup operation, I don't mind losing some currently live data, but can I safely assume that the zip file will be in a usable state when restored? 2. h2 creates three files, .data, .index and .log. Can I safely assume that I only need to back up the .data file, and that the .index and .log files will be recreated if necessary by h2 if the backup is restored?
Thanks in advance, Sridhar On Jul 31, 7:32 am, bob mcgee <[email protected]> wrote: > Hi, > What about using the BACKUP function? It should do his automatically > and cleanly -- seehttp://www.h2database.com/html/grammar.html#backup > > Your suggested idea actually works too though, from personal > experience. I tend to zip up my larger DBs with 7Zip for compact > offline storage, and I've accidentally zipped a running DB a couple > times. Nothing says "good times" quite like a 700 MB DB compressing > to 100 MB or less! > > Remember, like any good DBMS, H2 is durable against power outage, so > being suddenly cut off (by writing to ZIP intermediately) cannot leave > the DB in an inconsistent or destructive state. > > You will lose the current transaction and have to rebuild the index > though, and may lose *some* of the data, including modifications > within the WRITE_DELAY time interval. Those are why I don't suggest > it. > > Cheers, > Bob McGee > > On Jul 31, 1:35 am, "M. A. Sridhar" <[email protected]> wrote: > > > Hello, > > > I use h2 in embedded mode. I'm wondering if I can simply zip up the > > files in its directory as a backup, while the application is running. > > The intent is that I can simply unzip the files to restore from the > > backup. The problem I'm worried about is if the embedded database's > > state is cached by the currently running application, in which case > > the zip file's contents can be inconsistent and therefore unusable. > > > Of course I can perform the zip operation after shutting down the > > application, but I want to avoid that if possible, because it is a > > running web app. > > > Thanks in advance for your advice. > > > Regards, > > Sridhar --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
