On 16/05/2009 3:08 AM, Jim Wilcoxson wrote: > I think you have answered your own question. If you use > synchronous=off, you are saying "I don't care much about this > database." When you "save" documents, you are merely putting them in > a computer's cache (memory) and then confirming to the user that they > are on the hard drive, when they aren't necessarily there. > > So, user clicks Save, program says it saved it, user turns off > computer, database is corrupt. Don't know why this would happen all > of a sudden, unless maybe they upgraded their OS and it has decided to > cache volatile data longer to increase performance at the expense of > data integrity. > > I hope you're able to rescue your data. Someone else mentioned on > this list a while back that they could recover their data by doing > retrieval based on rowid: do a select * where rowid=1, then 2, then 3, > etc. until you get a failure. Once you get a failure, the rest is > lost.
Not necessarily. I have been looking at a corrupt cookies.sqlite database from a FireFox incident a few months ago. It has similar output from pragma integrity_check to what Kevin posted, with an added bonus: one case where an overflow page chain points to a data page instead of an overflow page. Doing a less tedious equivalent of the above (follow the B-tree until the first appearance of corruption) yielded 74 rows. Note that stopping at the first select failure is equivalent to stopping at the first "error code 11" error message. Not much of the file has been traversed. Skipping bad rows and bad pages yielded 853 rows with 833 unique rowids -- I haven't yet checked whether same rowid means same contents always/sometimes/never. There were 3 "never used" pages; should possibly be described as "orphan" rather than "never used", because one was all zeroes but the other 2 look like data pages -- not yet explored. Cheers, John _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users