[Solved] Data loss in non embedded database

Discuss the database features

[Solved] Data loss in non embedded database

Postby path32 » Sat Jul 21, 2012 5:49 am

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
path32
 
Posts: 136
Joined: Tue Oct 11, 2011 5:44 am
Location: Philippines

Re: Data loss in non embedded database

Postby DACM » Sat Jul 21, 2012 11:35 pm

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
User avatar
DACM
Volunteer
 
Posts: 1138
Joined: Tue Nov 03, 2009 7:24 am

Re: Data loss in non embedded database

Postby path32 » Tue Jul 24, 2012 2:52 am

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
path32
 
Posts: 136
Joined: Tue Oct 11, 2011 5:44 am
Location: Philippines

Re: Data loss in non embedded database

Postby DACM » Tue Jul 24, 2012 3:07 am

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
User avatar
DACM
Volunteer
 
Posts: 1138
Joined: Tue Nov 03, 2009 7:24 am

Re: Data loss in non embedded database

Postby path32 » Tue Jul 24, 2012 4:45 am

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
path32
 
Posts: 136
Joined: Tue Oct 11, 2011 5:44 am
Location: Philippines

Re: Data loss in non embedded database

Postby Sliderule » Tue Jul 24, 2012 5:14 pm

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   Expand viewCollapse view
    modified=no

    change it to:

    Code: Select all   Expand viewCollapse view
    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 157 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   Expand viewCollapse view
    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
Sliderule
Volunteer
 
Posts: 1167
Joined: Thu Nov 29, 2007 9:46 am

Re: Data loss in non embedded database

Postby RoryOF » Tue Jul 24, 2012 5:24 pm

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.6 on Xubuntu 18.04.2 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 28740
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Data loss in non embedded database

Postby path32 » Wed Jul 25, 2012 2:23 am

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
path32
 
Posts: 136
Joined: Tue Oct 11, 2011 5:44 am
Location: Philippines

Re: Data loss in non embedded database

Postby Sliderule » Wed Jul 25, 2012 2:40 am

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
User avatar
Sliderule
Volunteer
 
Posts: 1167
Joined: Thu Nov 29, 2007 9:46 am


Return to Base

Who is online

Users browsing this forum: No registered users and 1 guest