In this article
Start with the app, not the filename
You may encounter notes.db, notes.db-wal, and notes.db-shm together in an app’s data folder. Their shared name is a reason to investigate them as a set. It is not permission to keep the largest file and remove the smaller ones.
First identify the app that owns the folder and decide what you want to accomplish: reclaim space, make a backup, fix a malfunction, or remove the app completely. These are different jobs. A database export is useful for retaining information; removing selected pieces of the database is not an export.
If the location is unfamiliar, start with our guide to Application Support folders and deletion. Leave the files in place while you establish ownership. Do not open a private app database in an arbitrary editor just to see whether it is expendable.
What WAL and SHM actually do
WAL means write-ahead log. In WAL mode, SQLite can commit changes into this companion file before a checkpoint transfers them into the main database. Committed does not mean already copied into the main .db file. SQLite’s WAL documentation treats the log as part of the database’s persistent state and warns that separating it from the database can lose committed transactions or cause corruption.
The -shm file supports the shared-memory index used to coordinate access and locate WAL content. SQLite’s temporary-file documentation explains its role. It can be reconstructed under appropriate conditions, but that does not make deleting it while a database is in use a sound cleanup technique.
| File in our example | What it represents | What its name does not prove |
|---|---|---|
demo.db | Main database file | That it contains the latest committed state by itself |
demo.db-wal | Write-ahead log | That its contents are unsaved or disposable |
demo.db-shm | Shared-memory coordination/index file | That no running process still depends on it |
The file extensions describe roles, not a safe deletion list.
Our test: two saved rows, but only one in a raw copy
We created a new synthetic database on macOS 15.7.5 using Python 3.14.4 and SQLite 3.53.0 on December 3, 2026. No personal data or installed app database was opened.
The experiment deliberately kept one connection open and disabled automatic checkpointing. That makes the distinction visible; it is not a claim that every app uses those settings.
- Enable WAL mode and create a table containing one note.
- Commit that note and run a truncating checkpoint.
- Insert a second note and commit it while keeping the connection open.
- Copy only
demo.dbto a separate file, without further writes during the copy. - Make another copy using SQLite’s backup API, then count rows in both copies.
| Observation | Actual result |
|---|---|
| Live database after the second commit | 2 rows |
| Copy of the main file alone | 1 row |
| Copy made through SQLite’s backup API | 2 rows |
| Main file / WAL / SHM sizes while open | 8,192 / 4,152 / 32,768 bytes |
| Files remaining after the original connection closed cleanly | demo.db only |
The raw copy opened successfully. That is the important failure mode: “it opens” did not establish that it held the latest saved data. The missing second row was already committed.
This controlled test demonstrates stale data, not every possible copying failure. We avoided concurrent writes during the raw copy. It does not show that copying a live app database is generally safe, nor does it test any named Mac app’s storage implementation.
SQLite’s online backup API exists to produce a consistent database snapshot. For a consumer app, prefer its supported export or backup workflow; the developer may also need to preserve attachments, encryption information, or other application state outside a single database.
Why quitting does not settle every case
A clean final connection close normally lets SQLite checkpoint and remove its sidecars. But a crash, an unclean shutdown, or a configuration that retains the WAL can leave it behind. A remaining file therefore is not proof that cleanup failed or that the log is obsolete. The WAL documentation explicitly covers these exceptions.
Also, “no process named sqlite3” is the wrong test. An app can use SQLite as a library inside its own process. SQLite developer Dan Kennedy makes this distinction in the official forum discussion about orphaned WAL and SHM files.
A closed window likewise is not your record of a clean database close. Follow the owning app’s quit procedure and its troubleshooting instructions. If you are investigating lingering access, our guide to deleted files still held open explains why filesystem names and open handles are separate facts.
SQLite also warns about unlinking or renaming files while they are open. Do not use manual sidecar deletion as a way to force an app to repair itself.
A cleanup decision you can actually verify
Before removing anything, write down the owning app, the folder, the goal, and the backup or export you would use to recover. Then choose the app-level action that matches the goal:
- Need space: inspect the app’s storage controls and supported cache cleanup first. A large WAL is a diagnostic clue, not an instruction to erase it.
- Need a backup: use the app’s documented backup or export, and check that the result contains a recent item you can recognize.
- App is broken: preserve its current data and follow vendor recovery instructions. A database that opens without an error can still be stale, as our test shows.
- Removing the app: review its data as a whole after deciding what to retain. Separate your documents from associated application files before following its uninstaller.
If you cannot identify the owner or verify recovery, leave the set intact. The useful question is not whether a suffix sounds temporary. It is whether the supported app workflow has finished with the data and whether you can recover what matters.


