-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 02/03/12 15:32, Steffen Mangold wrote: > how to "replace" this?
Change the abort to commit as others pointed out. The dump code does the following: print BEGIN foreach table in the database: foreach row in the table: print the row print COMMIT However if there is an error returned (SQLITE_CORRUPT) while iterating over each row then it may start from the end and iterate backwards. Instead of commit, it prints ABORT on failing to completely iterate over the table. > But sometime my DB corrupted and .dump repairs it for me without data > loose. (was only some index errors). How do you know there is no data loss? You could only know that if you had a good clean copy of the entire database, in which case you can just use that. The "index errors" are not the only errors. They are only the ones reported. There can be silent errors, undetected corruption, stale pages and who knows what else. While doing a dump SQLite does not look at the contents of indices. If corruption was only inside an index then it would not be detected during .dump and you could repair by dropping and recreating the index. > But this time a part of the database goes really corrupt, so i now this > data is lost. The errors reported are not all the errors that exist, only a subset of them, > The damage has come with a server blackout because USV failure. I now > from docu that this can heavily damage a SQLite DB. A UPS failure will not corrupt a SQLite database, nor will other forms of power failure. You can get corruption if the drive or controller lie about content being synced during a power failure, but you should fix the drive/controller. Roger -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk9RXQYACgkQmOOfHg372QQOFQCgighDzftxJVxe0RGNANZMzoln Jw4AoLz+Q237aPK6aoQ8/nwKRjnxbnyt =WohS -----END PGP SIGNATURE----- _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users