Recovery tool ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Recovery tool ?

zze-ContentLab MARTINEAU Y ext RD-SIRP-REN
Hello,

I had an alimentation interruption on my sqlite database running on
linux. And now the data file seems to be corrupted. Is there any tool to
cleanup this file ? Or is it necessary to restart from a blank new data
file ?

Thank you,

yohann
Reply | Threaded
Open this post in threaded view
|

Re: Recovery tool ?

D. Richard Hipp
"zze-ContentLab MARTINEAU Y ext RD-SIRP-REN" <[hidden email]> wrote:
> Hello,
>
> I had an alimentation interruption on my sqlite database running on
> linux. And now the data file seems to be corrupted. Is there any tool to
> cleanup this file ? Or is it necessary to restart from a blank new data
> file ?
>

What is an "alimentation interruption" and how might such a thing
corrupt the database?
--
D. Richard Hipp   <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: Recovery tool ?

Chris Peachment
Alimentation is the French word and alimentacion is the
Spanish word for "food" or "feed".

In this case the poster is referring to an electrical power failure
on the computer.

On Tue, 08 Aug 2006 11:38:09 +0000, [hidden email] wrote:

>"zze-ContentLab MARTINEAU Y ext RD-SIRP-REN" <[hidden email]> wrote:
>> Hello,
>>
>> I had an alimentation interruption on my sqlite database running on
>> linux. And now the data file seems to be corrupted. Is there any tool to
>> cleanup this file ? Or is it necessary to restart from a blank new data
>> file ?
>>

>What is an "alimentation interruption" and how might such a thing
>corrupt the database?
>--
>D. Richard Hipp   <[hidden email]>




Reply | Threaded
Open this post in threaded view
|

RE: Recovery tool ?

Griggs, Donald
In reply to this post by zze-ContentLab MARTINEAU Y ext RD-SIRP-REN
 "...alimentation interruption..." --- Power interruption -- fascinating how
languages work!

Yohann,

Sqlite tends to be pretty good in the face of power interruptions on most
OS's, sorry you are having trouble.

I think you'll want to:
  1) copy your database in its current state (for safekeeping).
  2) See if the "vacuum" command will run, and if all tables remain
afterwards.
               http://www.sqlite.org/lang_vacuum.html
  3) Try a ".dump" command on the entire database.
  4) If the above .dump aborts on a particular table, try individual .dump
of
     all OTHER tables.
  5) Now gauge how much data, if any, is missing, and plan your remediation.

-----Original Message-----
From: zze-ContentLab MARTINEAU Y ext RD-SIRP-REN
[mailto:[hidden email]]
Sent: Tuesday, August 08, 2006 4:48 AM
To: [hidden email]
Subject: [sqlite] Recovery tool ?

Hello,

I had an alimentation interruption on my sqlite database running on linux.
And now the data file seems to be corrupted. Is there any tool to cleanup
this file ? Or is it necessary to restart from a blank new data file ?

Thank you,

yohann
Reply | Threaded
Open this post in threaded view
|

RE: Recovery tool ?

zze-ContentLab MARTINEAU Y ext RD-SIRP-REN
In reply to this post by zze-ContentLab MARTINEAU Y ext RD-SIRP-REN
Sorry, I meant a power failure, or a power loss if you prefer.

I have generated a new data file, this is not a problem in a development environment, but what should I do in a production environment ?

Thanks

-----Message d'origine-----
De : [hidden email] [mailto:[hidden email]]
Envoyé : mardi 8 août 2006 13:38
À : [hidden email]
Objet : Re: [sqlite] Recovery tool ?

"zze-ContentLab MARTINEAU Y ext RD-SIRP-REN" <[hidden email]> wrote:
> Hello,
>
> I had an alimentation interruption on my sqlite database running on
> linux. And now the data file seems to be corrupted. Is there any tool
> to cleanup this file ? Or is it necessary to restart from a blank new
> data file ?
>

What is an "alimentation interruption" and how might such a thing corrupt the database?
--
D. Richard Hipp   <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

RE: Recovery tool ?

zze-ContentLab MARTINEAU Y ext RD-SIRP-REN
In reply to this post by zze-ContentLab MARTINEAU Y ext RD-SIRP-REN
Ok, I'll try those steps and I keep you informed.


-----Message d'origine-----
De : Griggs, Donald [mailto:[hidden email]]
Envoyé : mardi 8 août 2006 14:54
À : [hidden email]
Objet : RE: [sqlite] Recovery tool ?

 "...alimentation interruption..." --- Power interruption -- fascinating how languages work!

Yohann,

Sqlite tends to be pretty good in the face of power interruptions on most OS's, sorry you are having trouble.

I think you'll want to:
  1) copy your database in its current state (for safekeeping).
  2) See if the "vacuum" command will run, and if all tables remain afterwards.
               http://www.sqlite.org/lang_vacuum.html
  3) Try a ".dump" command on the entire database.
  4) If the above .dump aborts on a particular table, try individual .dump of
     all OTHER tables.
  5) Now gauge how much data, if any, is missing, and plan your remediation.

-----Original Message-----
From: zze-ContentLab MARTINEAU Y ext RD-SIRP-REN [mailto:[hidden email]]
Sent: Tuesday, August 08, 2006 4:48 AM
To: [hidden email]
Subject: [sqlite] Recovery tool ?

Hello,

I had an alimentation interruption on my sqlite database running on linux.
And now the data file seems to be corrupted. Is there any tool to cleanup this file ? Or is it necessary to restart from a blank new data file ?

Thank you,

yohann
Reply | Threaded
Open this post in threaded view
|

Re: Recovery tool ?

D. Richard Hipp
In reply to this post by zze-ContentLab MARTINEAU Y ext RD-SIRP-REN
"zze-ContentLab MARTINEAU Y ext RD-SIRP-REN" <[hidden email]> wrote:
> Sorry, I meant a power failure, or a power loss if you prefer.

No worries.  I got to learn a new French word!

>
> I have generated a new data file, this is not a problem in a development =
> environment, but what should I do in a production environment ?
>

SQLite is suppose to survive an alimentation interruption.  In
fact, the standard regression test suite does extensive testing
to verify that an alimentation interruption will not harm the
database.

But this feature depends to some extent on your operating system.
If your operating system does not properly flush information
to the disk surface when requested, or if it lies about it,
then bad things can happen.  What OS are you using?  What
kind of mass storage?  (Disk or flash?)
--
D. Richard Hipp   <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

RE: Recovery tool ?

zze-ContentLab MARTINEAU Y ext RD-SIRP-REN
In reply to this post by zze-ContentLab MARTINEAU Y ext RD-SIRP-REN
I have identified the only table which is corrupted.

>  2) See if the "vacuum" command will run, and if all tables remain
afterwards.
>               http://www.sqlite.org/lang_vacuum.html

It does not work, I have the same message:
SQL error: database disk image is malformed

>  3) Try a ".dump" command on the entire database.

I have made a dump of the entire database but when I read the file
generated, I only have two tables created. But I consider this is OK
because I can dump other tables. I don't know if have lost many entries
in my database, but all data is updated (or re-created if unexisting)
permanently, so it's OK for me.

Thanks again for your help.
Reply | Threaded
Open this post in threaded view
|

RE: Recovery tool ?

zze-ContentLab MARTINEAU Y ext RD-SIRP-REN
In reply to this post by zze-ContentLab MARTINEAU Y ext RD-SIRP-REN
> What OS are you using?

Linux 2.6.15-23-server #1 SMP Tue May 23 15:10:35 UTC 2006 i686
GNU/Linux

It's an ubuntu 6.06 server distribution.

> What kind of mass storage?  (Disk or flash?)

It's just the disk of the computer on which I installed sqlite, I don't
use any mass storage device. The potential target is a flash memory on a
set top box... But it's ok with the dump solution for me, don't worry.

Merci ;-)

yohann
Reply | Threaded
Open this post in threaded view
|

Re: Recovery tool ?

RohitPatel9999
In reply to this post by D. Richard Hipp
Once I experienced a problem during testing where multi-threaded Win32 Application (using SQLite 3.3.4) was running (in development environment) and due to power-failure, rollback journal file was OK but disk bad-sector damaged the sqlite db-file.

When I restarted App, db could not be opened (data file was probably corrupted), So I tried to copy db-file to another place and it could not copy (due to disk bad-sector). (I guess, at the time of power-failure, my app may be writing to db-file (after rollback generation) exactly that same moment of power failure, which caused bad sector in disk db-file and db-file got corrupted, so could not be rolled back while opened for the next time).

I needed to get copy of db-file from previous night backup. (As hardware failure (bad-sector), does not left us many choices).

Rohit
Reply | Threaded
Open this post in threaded view
|

Re: Recovery tool ?

LincolnBurrows
This post has NOT been accepted by the mailing list yet.
In reply to this post by zze-ContentLab MARTINEAU Y ext RD-SIRP-REN
I know this is an old question, but I would still like to share my solution. My Problem was, that a sqlite3 Database of kodi(xbmc) was corrupted and unfortunately i don't have backup of my database file. I have gone through manual solutions but can't succeed, at last i had tried Sqlite repair tool and successfully repaired my corrupt database file.