On Fri, May 6, 2011 at 10:05 AM, Jaco Breitenbach
<[email protected]>wrote:

>
> Would a simple copy of the database, -shm and -wal files result in a
> corrupted database if these files are used to restore the system, or would
> it simply appear as if SQLite is recovering from a power failure?


SQLite goes to great lengths to make sure that information is written in the
correct order so that it can be recovered after a power failures.  If you
"copy" uses a different order, you could easily end up with corruption.

So, yes, your blind copy will corrupt database files.  Though it is likely
to work *most* of the time.  So you'll only get corruption occasionally -
usually in the field and with an important client, and always
unreproducible.



>  Sure,
> there may be a small amount of data loss in doing the copy without a lock,
> but that may be acceptable so long as the data that is in the database is
> not corrupted.
>
> Jaco
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
[email protected]
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to