[sqlite] Detecting database corruption

2009-08-27 Thread Chang Im (chim)
Hi,

I posted a similar question under "integrity check", but did not get
much attention.

I am a newcomer to SQLite and we uses SQLite 2 database in our embedded
product line.

As database corruption could happen due to various reasons, how do folks
detect it, especially in embedded environment.  For example, our box
crashed and rebooted.  How do we check if the database is intact?

Here are some of options that I can think of for detecting the
corruption:

1. pragma integrity_check

 It seems for a certain corruption, this command never returns.  I have
one database where the cmd ran 14 hours of CPU time, but it never came
back.  How do you tell when to stop in a case like this?

2. pragma quick_check

 I have one corrupted database (disk image is malformed) where this cmd
did not detect the corruption.  So it is not reliable.

3. Execute sample SQL statements (like UPDATE) to the database to see if
running into severe error.

 In one corrupted database, this worked just fine. So not a reliable
way.

Appreciate any suggestions.

Thanks.
-chang

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] PRAGMA integrity_check(integer)

2009-08-24 Thread Chang Im (chim)
Hi Simon,

> > I have SQLite 2.x database and sometimes it takes a long time to run
> > "integrity_check" on the database.
> 
> How long ?  Minutes ?  Hours ?
> 
> Simon.

I have one database file which "pragma integrity_check" never comes back
from.
I am using "sqlitebrowser 1.1".

-chang
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] PRAGMA integrity_check(integer)

2009-08-21 Thread Chang Im (chim)
Hi,

I have SQLite 2.x database and sometimes it takes a long time to run
"integrity_check" on the database.
Looking at the integrity_check option "(integer), we could control how
many errors to return from the check.

I tried the option, but it generated a syntax error.

Is the option supported?  If so, does it stop the cmd after specified
number of errors?

Thanks.
-chang
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users