Hi Simon,

Thank you for the suggestions. Yes, we already found the reason why the
database would corrupt and fixed it. However, we still need to check users'
database in our newer version of software in order to write new logs. We
don't check this very often.

The choice between deleting and renaming is not really that important. We
keep the corrupt database only for the developers to debug, not for anyone
else to use.

Best,
John Lin

Simon Slavin <slav...@bigfraud.org> 於 2017年11月23日 週四 下午12:03寫道:

>
>
> On 23 Nov 2017, at 3:11am, 林自均 <johnl...@gmail.com> wrote:
>
> > It's for logs. If it corrupts, we rename it with a suffix ".corrupt" and
> > write new logs into a new sqlite file. Does that affect the way I check
> it?
>
> I was interested why you were checking for corruption, so your answer just
> inspires more questions.
>
> Why are your sqlite database files being corrupted so frequently that it’s
> worth checking for corruption ?  SQLite is a very good database system.  It
> does not corrupt its files.  You might spend your time better finding out
> why you keep getting corrupt log files.  Maybe there is a fault in your
> programming, or in your hardware.
>
> Why are you not just deleting the corrupt database files ?  They’re
> corrupt.  You cannot trust the contents at all.  You do not know if they
> have one row missing or hundreds.  They do not tell you anything useful
>
> ALso, why not just create a new log each time ?  It can take a very long
> time to execute "PRAGMA integrity_check".  The longer your file goes
> uncorrupted, the longer the check will take.  Eventually you will get a
> pause of many minutes every time you start up your program.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to