[Solved] Data loss in non embedded database

Discuss the database features
Post Reply
path32
Posts: 136
Joined: Tue Oct 11, 2011 5:44 am
Location: Philippines

[Solved] Data loss in non embedded database

Post by path32 »

hi im having a problem in my database
my mydb.data having a size of 360,278 KB, mydb.backup= 123,763 KB, mydb.script= 13kb, mydb.properties= 1kb


when i open my database, all of my data disappear... :(


when i open my back up, the data and backup is almost the same, mydb.data= 356,326kb, mydb.backup= 334,958kb

then i overwrite my previous mydb.backup (334,958kb) to my present mydb.backup (123,763 KB) then my mydb.data become 356,326kb after i open my mydb.server
i don't know how this happen, somebody help me to this? and how can i retrieve my data with mydb.data (360,278 KB)
Last edited by path32 on Sat Sep 22, 2012 3:32 am, edited 1 time in total.
Apache Open Office 3.4, 4.0, HSQLDB 1.8(non embedded database) Windows 7, UBUNTU 10.04
User avatar
DACM
Volunteer
Posts: 1138
Joined: Tue Nov 03, 2009 7:24 am

Re: Data loss in non embedded database

Post by DACM »

path32 wrote:hi im having a problem...
mydb.data 360,278 KB
mydb.data become 356,326 KB
...how can i retrieve my data?
Did you recover most of your data from the backup, or are you still having problems with the data recovered from the backup?

Are you really working with a 360 MB (megabyte) database? Or do you mean 360 KB (360,278 Bytes)?
AOO 4.1.x; LO 4.2.x; Windows 7/8 64-bit
Warning: Avoid embedded databases --> Solution: Adopt a portable 'split database' folder
Soli Deo gloria
path32
Posts: 136
Joined: Tue Oct 11, 2011 5:44 am
Location: Philippines

Re: Data loss in non embedded database

Post by path32 »

thanks DACM,

im working with 360MB,

when i back up, theres no problem when i retrieve the data.

my problem is, how mydb.backup become 123MB, when my mydb.data is 360MB.

and how i can recover mydb.backup using mydb.data?
Apache Open Office 3.4, 4.0, HSQLDB 1.8(non embedded database) Windows 7, UBUNTU 10.04
User avatar
DACM
Volunteer
Posts: 1138
Joined: Tue Nov 03, 2009 7:24 am

Re: Data loss in non embedded database

Post by DACM »

path32 wrote:my problem is, how mydb.backup become 123MB, when my mydb.data is 360MB.
Wow, that's a large database (if you're not storing image files in the database). I hope you've enlarged your HSQLDB cache memory and perhaps adjust Java 'heap' memory to accommodate the large cache:
path32 wrote:...and how i can recover mydb.backup using mydb.data?
Recall that .backup is a zip archive of .data. So, if you mean recover .data from .backup, try renaming .backup to .zip and expand using a zip tool.
 Edit: Sorry to lead you astray here but the archive format of .backup is apparently proprietary. Thus, HSQL will be necessary to extract the contents of .backup and rebuild .data as Sliderule outlines below. 
Last edited by DACM on Tue Aug 13, 2013 11:12 pm, edited 4 times in total.
AOO 4.1.x; LO 4.2.x; Windows 7/8 64-bit
Warning: Avoid embedded databases --> Solution: Adopt a portable 'split database' folder
Soli Deo gloria
path32
Posts: 136
Joined: Tue Oct 11, 2011 5:44 am
Location: Philippines

Re: Data loss in non embedded database

Post by path32 »

Thanks for the reply,


Im trying to do,
Recover .backup from .data because my .backup. has lesser than .data

because when i open my database, all of my data are all erase
Apache Open Office 3.4, 4.0, HSQLDB 1.8(non embedded database) Windows 7, UBUNTU 10.04
User avatar
Sliderule
Volunteer
Posts: 1278
Joined: Thu Nov 29, 2007 9:46 am

Re: Data loss in non embedded database

Post by Sliderule »

path32 wrote:Thanks for the reply,


Im trying to do,
Recover .backup from .data because my .backup. has lesser than .data

because when i open my database, all of my data are all erase
I will attempt to explain to you what I would do, BUT, I cannot guarantee it will be successful, since, it is very possible that the contents of your your mydb.data and mydb.backup files are the same, and, therefore, bringing back data from the mydb.backup file will not result in any differences, unless, you have kept a SAFE copy of the mydb.backup file.

Please carefully follow these steps:
  1. Shut down your OpenOffice Base files, and, server if running HSQL as a server. This means, there should be NO mydb.lck file. :super:
  2. Keep / make safe copies of the following files on your computer:
    1. mydb.data
    2. mydb.backup
    3. mydb.properties
    4. mydb.script
  3. Use a text editor, such as Notepad, or whatever, to modify the contents of the mydb.properties file. Line 15 of the file ( at least on my 1.8.0.10 files ) has a line that says:

    Code: Select all

    modified=no
    change it to:

    Code: Select all

    modified=yes
    That is, just change the no ( if that is the current content of the line ) to a yes .
  4. Rename ( change the file name ) of mydb.data to mydb.XXdata

    The reason for the above is so the database engine ( HSQL ) will 're-create' the mydb.data file from the contents of mydb.backup ( this is what you said you wanted :super: ) .
  5. Below download the zero byte file, mydb.data , place it in your folder with the other mydb.* files. Because it is one byte, the file is a 'dummy' file and will be overwritten with the contents of you mydb.backup after you start your database engine. Because this forum will NOT allow an attachment file with a file type of .data, you will have to rename the file below to: mydb.data :bravo:
    mydb.odb
    Change the name of file from mydb.odb to mydb.data
    (1 Bytes) Downloaded 380 times
  6. Start your OpenOffice Base file. The above operation will be performed 'automatically' by the database engine ( hsqldb.jar ).
  7. You can now check to see if your Tables contains the data you think should be in them.
  8. Important step: If your database is now working as desired, you want to recover the database file space ( shrink the size of the mydb.data and mydb.backup files ). This is accomplished by:

    From the OpenOffice Base file menu: Tools -> SQL...

    enter the following command in the Command to execute box:

    Code: Select all

    checkpoint defrag
  9. Press the Execute button
  10. Press the Close button
  11. Shut down your OpenOffice Base file, and, make safe backups of the four HSQL files ( mydb.* )
  12. Let the forum know the outcome. :bravo:
Just to repeat, the above will be successful, ONLY IF, the contents of your mydb.backup file actually contains 'clean' data, rather than a backup of 'bad' data from the mydb.data file.

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.
Last edited by Sliderule on Tue Jul 24, 2012 7:59 pm, edited 2 times in total.
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Data loss in non embedded database

Post by RoryOF »

DACM wrote:
path32 wrote:my problem is, how mydb.backup become 123MB, when my mydb.data is 360MB.
Wow, that's a large database (if you're not storing image files in the database)
Out of curiosity I did a quick search and found information that suggests mydb has a DB file limit of over 2 gigabytes; there were also reports of someone using it with one million records.
http://www.mghsoft.com/
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
path32
Posts: 136
Joined: Tue Oct 11, 2011 5:44 am
Location: Philippines

Re: Data loss in non embedded database

Post by path32 »

thanks for the reply,
Sliderule,
i already try that,
this only possible if, the mydb.data is having a bad data than backupdata
and it works, my problem is vice-versa
Apache Open Office 3.4, 4.0, HSQLDB 1.8(non embedded database) Windows 7, UBUNTU 10.04
User avatar
Sliderule
Volunteer
Posts: 1278
Joined: Thu Nov 29, 2007 9:46 am

Re: Data loss in non embedded database

Post by Sliderule »

path32 wrote:thanks for the reply,
Sliderule,
i already try that,
this only possible if, the mydb.data is having a bad data than backupdata
and it works, my problem is vice-versa
I do not understand what you are saying, so, perhaps someone else can help you.

Sliderule
Post Reply