Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

db-shm and db-wal in sqlite databases

I am analyzing some databases that I extract from android devices and I have noticed that some databases are not updated but they are accompanied with two files: .db-shm and .db-wal and these files are updated when I do any changes to the database (while the .db file is not). I understand that these are files used by the database to be able to rollback at anytime. But my question is: Can I apply the changes (or transfer the new data) from .db-wal and .db-shm to the main database (with .db extension)? and how?

Any help is appreciated..Thank you

like image 280
user1894963 Avatar asked Jan 21 '14 11:01

user1894963


1 Answers

These databases are using Write-Ahead Logging.

To move the data from the log into the main database file, execute PRAGMA wal_checkpoint or PRAGMA journal_mode = DELETE.

like image 147
CL. Avatar answered Oct 27 '22 14:10

CL.