On 2016/06/29 2:48 PM, Joe Pasquariello wrote:

starting from the original, corrupted DB...

integrity_check
row 18029 missing from index sqlite_autoindex_EventLog_1
row 18030 missing from index sqlite_autoindex_EventLog_1
row 18031 missing from index sqlite_autoindex_EventLog_1
row 18032 missing from index sqlite_autoindex_EventLog_1
row 18033 missing from index sqlite_autoindex_EventLog_1
row 18034 missing from index sqlite_autoindex_EventLog_1
row 18035 missing from index sqlite_autoindex_EventLog_1
wrong # of entries in index sqlite_autoindex_EventLog_1

delete from eventlog where rowid >=18029 and rowid <= 18035
(checked integrity again here, and got same result as above)

reindex
integrity_check
ok

vacuum
integrity_check
ok

Query for duplicates returns no records.

Thanks very much, Ryan and Simon. My application monitors wind turbines, and there are somewhat frequent power issues at the sites. At one particular site, I had frequent corruption on server crashes, but none since changing SYNCHRONOUS from OFF to NORMAL. This particular site still had SYNCHRONOUS OFF, but will now have NORMAL.

Very happy this is sorted for you. Note that Synchronous=OFF should only ever be used on a read-only DB (or at least one where writing only happens when you the user/DB Admin actively makes changes via queries. For anything that should run autonomously, Synchronous should preferably be FULL and at least be ON.

There is a time-penalty to be paid for Synchronous=FULL, but if it isn't part of a user interface and no user to notice that specific thread is lagging a second or two when writing, then it rarely matters.

Best,
Ryan

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

Reply via email to