On Mon, Jul 23, 2012 at 12:10 PM, <gsm-gin...@gmx.ie> wrote:

> Hi, everyone
>
> Is it possible to restore deleted rows or dropped tables provided the WAL
> and shm files are still intact and contain the data you want to restore?
>

The WAL file does not contain the old data, it contains the new data.  If
the WAL file has not been checkpointed, you should be able to simply delete
the WAL file and the old data will still be in the original database file.
A "checkpoint" operation is the act of moving the new database from the WAL
file back into the original database file, presumably overwriting the old
data (depending on your settings and other factors).

But, if the WAL file has been partially checkpointed, and that checkpoint
was interrupted by a crash or power failure, deleting the WAL file will
corrupt your database.  So you should probably run the experiment on a
backup.  :-)


>
> Example scenario where vast swathes of content have vanished from
> mmssms.db thanks to an unintentional mass-DELETE FROM through the naughty
> Android SMS app:
>
> ls -al /data/data/com.android.providers.telephony/databases/mm*
> -rw-rw----    1 root     root         60416 Jul 17 20:16 mmssms.db`
> -rw-rw----    1 radio    radio        32768 Jul 17 16:18 mmssms.db-shm
> -rw-rw----    1 radio    radio       628832 Jun 30 19:23 mmssms.db-wal
>
> TIA,
>
> Mandy
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to