On 2 Mar 2012, at 2:36pm, Steffen Mangold <steffen.mang...@balticsd.de> wrote:

> I read in some forums that .dumb is the best way to repair "malformed" DBs. 
> Do you have an other way?

It doesn't repair anything.  And the .dump command may, or may not, work on a 
malformed database file.  It depends on what'sw wrong with the database file.  
Might help if you understood what .dump does.

http://www.sqlite.org/sqlite.html

It reads a SQLite database and produces the SQL instructions it would take to 
reproduce that database.  So you start off with a database file in SQLite 
format and end up with a huge file of text containing SQL instructions.  Since 
a human can understand that file you can then read that text file yourself, or 
use a text editor to make changes to it before using the .read command to 
execute the instructions and make another database from them.

There's no magic tool for repairing damaged database files.  But by using the 
.dump command (if necessary on each individual table and view) then creating a 
new database file and using the .read command you can often rescue some or all 
of the data in the original database.

One thing you might like to try is "PRAGMA integrity_check;"

<http://www.sqlite.org/pragma.html#pragma_integrity_check>

which will give you a good idea about what's wrong with the original database 
file.  It might tell you which table is defective, or whether the problem is 
with data (which may lead to problems reconstructing the file) or an index 
(which will probably be ignored when reconstructing the file).

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to