secure_delete
Overwrite deleted content with zeros.
- Predeterminado
0 (off)- Range
- 0 off, 1 on, 2 FAST
- Restart needed
- No
- Default checked on
- SQLite 3.5x
Lo que hace
With 0, deleted rows can remain readable in free pages and in the journal or WAL. FAST (2) zeros content only when it costs no extra I/O.
Valor predeterminado
0 (off). 0 (a stock SQLite 3.5x build). The sqlite3 shipped with macOS reports 2 (FAST).
Check the current value
PRAGMA secure_delete; SELECT * FROM pragma_secure_delete; -- table-valued form, usable in queries
Change it
PRAGMA secure_delete = ON; -- this connection only
No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.
When to change it
When the file may be copied or handed over and deleted data must not be recoverable from it.
What can go wrong
More write I/O; ON also makes deletes slower.
Questions about secure_delete
What is the default value of secure_delete in SQLite?
0 (off). 0 (a stock SQLite 3.5x build). The sqlite3 shipped with macOS reports 2 (FAST).
Does changing secure_delete require a restart?
No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.
When should I change secure_delete?
When the file may be copied or handed over and deleted data must not be recoverable from it.
Back to all SQLite settings, or check the SQLite manual for every option.
Check secure_delete on your own server
SQLly runs the query above against SQLite and the other engines in this reference, from one desktop app on macOS, Windows and Linux.