Page 1 of 1

How do I recover a front-back DB

Posted: Fri Feb 22, 2013 7:16 pm
by MikeytheMagnificent
In an embedded odb....... 3> user> backup> My_emb_db.odb is a zip file renamed .odb containing 2 hefty files each about 4 meg +config stuff . and should just be a useable copy your odb complete with yesterdays closing data. currently about 8 meg.

In a filemode odb ........mydb.backup is just a Windows unrecognised filetype (a single file) in my case presently about 24meg (with different, not very similar data, but still 3 times as big as embedded) and mydb.data is about 24.5meg wheras mydb.file.odb (the executable) is a mere 0.05meg or 50k. 450k gone astray in housekeeping duties)
as would be mydb.server.odb (50k) if I kept its form.definitions etc synced up to the file version.

Now the nitty gritty:
I have no clue as how to use mydb.backup in the emergencies which it is presumably for, just now I changed its name to mydb.backup1 and reopened mydb.file.odb edited a couple of records to make sure and closed it again, and Yee-haa there's a new mydb.backup next to the old one but a tiny bit bigger, after the edits.
But what if someone mistakenly or maliciously trashed 75% of my datafile. How do I revert to last-days data because todays mydb.data now contains junk. at least I only lose 1 days stuff.
I note that even if my data shrinks that mydb.backup_newest still bloats, as does .data.
Also, please Where is 'ShutdownCompact' command? I've never found it. I thought it was supposed to be in tools
oh yes? oh no!
Perhaps if I try it in tools> sql.
Oh yes! sorry DACM, but wouldn't it just be a couple of loc's for 'em to stick it straight on the tools menu.
Thanx to all
We'll leave the autosave every few minutes versioning stuff 'til later

Re: How do I recover a front-back DB

Posted: Fri Feb 22, 2013 11:23 pm
by Greengiant224
MikeytheMagnificent:

Have you tried >>Tools>>SQL
and issuing a checkpoint defrag this may 'shrink' your db file by re-indexing any/all deleted entries you have made

Then issue in the same SQL dialog box Shutdown Defrag

This obviously shuts down the db and puts it to sleep, Until you re-open it. :super:

There are many ways to make a backup of your database, from batch scripts and Archive Tools (ie zip progs)
to versioning including the 'cloud', the choice is inevitably yours?

Always make a backup, you may need it sooner than you think :bravo:

Greengiant224

Re: How do I recover a front-back DB

Posted: Sat Feb 23, 2013 1:39 am
by MikeytheMagnificent
Thanks Greengiant the checkpoint defrag or shutdown compact thing is now sorted, perhaps one syntax is hsql the other MySql or similar. I'll see.

More importantly, the backup is already there I just need to know how to access it and extract lastdays data

Re: How do I recover a front-back DB

Posted: Sat Feb 23, 2013 3:03 am
by Sliderule
According to HSQL Version 1.8.0 documentation, found at:

http://www.hsqldb.org/doc/1.8/guide/ch05.html#N10F02
HSQL 1.8.0 Documentation: [url]http://www.hsqldb.org/doc/1.8/guide/ch05.html#N10F02[/url] wrote:
Backing Up Databases

The data for each database consists of up to 5 files in the same directory. The endings are *.properties, *.script, *.data, *.backup and *.log (a file with the *.lck ending is used for controlling access to the database and should not be backed up). These should be backed up together. The files can be backed up while the engine is running but care should be taken that a CHECKPOINT or SHUTDOWN operation does not take place during the backup. It is more efficient to perform the backup immediately after a CHECKPOINT. The *.data file can be excluded from the backup. In this case, when restoring, a dummy *.data file is needed which can be an empty, 0 length file. The engine will expand the *.backup file to replace this dummy file if the backup is restored. If the *.data file is not backed up, the *.properties file may have to be modified to ensure it contain modified=yes instead of modified=no prior to restoration. If a backup immediately follows a checkpoint, then the *.log file can also be excluded, reducing the significant files to *.properties, *.script and *.backup. Normal backup methods, such as archiving the files in a compressed bundle can be used.
Explanation: I elected, for clarity, to highlight by color, and, size, certain KEY issues above, to make sure they are all followed. Also, you did NOT say, which HSQL database VERSION you are using ( for example, 1.8.0.10 or, 2.2.8, or other ). The *.backup file is a 'compressed' version of the *.data file. :super:

I hope this helps, please be sure to let me / us know.

Sliderule

Thanks to add [Solved] in your 1st post Subject (edit button top right) if this issue has been resolved.