On Jul 31, 2009, at 12:00 AM, rupert.thurner wrote:

> is there another possibility but exporting and importing the data to
> get rid of:
>   SQL error: database disk image is malformed
> ?
>
> here the details of the error and the commands we used. but we are not
> sure why exporting works and vacuum should not work.

Vacuuming a database constructs the indexes in the compacted
database by copying the contents of the existing indexes. But
doing an export/import using the shell tool constructs the
indexes in the new db from scratch based on the data extracted
from the tables in the old db. So if the corruption problem is
confined to an index or indexes, an export/import will fix
problem but a vacuum will not.

Dan.



> we used sqlite
> 3.6.10, solaris.
>
> # sqlite3 trac.db
> sqlite> PRAGMA integrity_check;
> *** in database main ***
> Page 39762: sqlite3BtreeInitPage() returns error code 11
> On tree page 39768 cell 0: 2nd reference to page 39762
> Page 39763 is never used
> Page 39764 is never used
> Page 39765 is never used
> Page 39766 is never used
> Page 39767 is never used
> SQL error: database disk image is malformed
> sqlite> vacuum;
> SQL error: database disk image is malformed
>
>
> # sqlite3 trac.db .dump .quit >> trac.db.dump
> # mv trac.db trac.db.orig
> # sqlite3 trac.db < trac.db.dump
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

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

Reply via email to