On 27 Dec 2017, at 6:10pm, Nikhil Deshpande <ndeshpa...@vmware.com> wrote:
>> Can you include a "pragma integrity_check" at startup ? >> Can you include a "pragma integrity_check" executed at regular intervals ? > The writer process does "pragma quick_check" on every startup at init, > bails out on failure and spawns a separate thread to do same > "pragma quick_check" every 5 minutes (opens it's own separate DB handle > and closes it). Would changing quick_check to integrity_check be > helpful? (Would integrity_check catch such corruption earlier than > quick_check? Would it hold longer exclusive locks on the DB file > that could prevent reads?) Thanks Nikhil. Had I noticed your email address I wouldn’t have asked picky questions about abnormal termination and VM management. Your responses indicate that you are doing everything properly. I don’t see anything there that makes me think that you’re missing a cause of corruption. However people who know more than I do about SQLite might spot something. Changing "quick_check" to "integrity_check" may help in this case may be useful in investigating your problem. "integrity_check" is far more thorough and checks every aspect of data integrity from both directions. However, the type of corruption you’re experiencing may be one which is spotted just as well by "quick_check". There’s no way to know without checking it. But it does suffer from the problem you noted (a 65 Meg database would be locked for longer) and this might be unacceptable in your environment. Or you might be able to do it just once an hour instead of every 5 minutes. An alternative might be to run "integrity_check" on backup copies which don’t show up anything on "quick_check". This could be done without blocking the production system. If you never find anything then you know "quick_check" is all you need. But it might spot corruption in some databases you don’t think have been corrupted yet. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users