SQLite Forum

Can -wal -shm files be deleted if -wal file is empty?
Login
You can, if you are quite sure there are no libsqlite3 users at all accessing the databases. If there are processes with the db open and you delete these files, the db might become corrupted later on.

Safer is to use the command-line tool to open, query and then close the database. If there really are no other processes running, this should delete the *-wal and *-shm files. Something like the command:

  sqlite3 databasefile.db "SELECT count(*) FROM sqlite_master;"

is enough.