What is the DB-SHM file format?
A .db-shm file is an ephemeral shared-memory index file created automatically by SQLite when a database operates in WAL (Write-Ahead Logging) mode. It exists alongside the main database file and its companion .db-wal file, together forming the three-file set that WAL mode requires.
The file is a fixed 32 KB in size and is memory-mapped by all SQLite connections sharing the same WAL-mode database. It stores WAL index headers and a hash table mapping WAL frame numbers to database page numbers, allowing readers to efficiently locate the latest version of each page without scanning the entire WAL file.
Unlike the main .db file, the .db-shm file stores no user data and is not portable across CPU architectures - its byte order matches the host machine. SQLite creates it automatically when the first connection opens a WAL-mode database and deletes it cleanly when the last connection closes. A leftover .db-shm file after a crash is safe to delete, provided the database is not currently open; SQLite recreates it on the next access.
In exclusive locking mode, SQLite uses heap memory instead, so no .db-shm file is written to disk. The file cannot be opened or interpreted meaningfully by any tool other than SQLite itself.
Security & safety
RISK: LOWThe .db-shm file itself contains no user data and cannot be meaningfully parsed. No executable content. The associated .db database file may contain sensitive personal data (messages, contacts, etc.) depending on the application. Deleting a stale -shm file (when database is closed) is safe; deleting it while the database is open may cause corruption.
Format details
in a nutshellPrograms that open DB-SHM files
Technical details
deep spec| SQLite mode required | WAL (Write-Ahead Logging) mode; not created in journal or exclusive locking mode |
| File size | Fixed 32 KB (one 32 KB block per lock region) |
| Byte order | Host machine native; not portable across CPU architectures |
| Encoding | Binary (memory-mapped OS structures; not a standalone serialized format) |
| Content | WAL index headers and hash table mapping WAL frame numbers to database page numbers |
| User data | Stores no user data; functions as a read-index of the companion .db-wal file |
| Lifecycle | Auto-created when first WAL-mode connection opens; auto-deleted on last clean close |
| Crash recovery | Safe to delete manually if the database is not open; SQLite recreates it automatically |
| Companion files | Always co-located with the .db main database and .db-wal write-ahead log |
| Crash safety mechanism | Dual-copy WAL index header; both copies checked for consistency on open |
| Exclusive locking mode | SQLite uses heap memory instead; no .db-shm file is written to disk |
| MIME type | application/octet-stream (no dedicated MIME type) |
| Introduced with | SQLite WAL mode, version 3.7.0 (July 2010) |
| Platform | Android, iOS, Windows, Linux, macOS |
| Released | 2010 (SQLite 3.7.0, WAL mode) |
| Latest version | SQLite 3.x (current; format tied to WAL implementation) |
| Open standard | Yes · royalty-free |
| Specification | www.sqlite.org |
Community Q&A
asked by usersNo questions yet - be the first to ask about DB-SHM files.