Skip to Content
Using SQLite
book

Using SQLite

by Jay A. Kreibich
August 2010
Intermediate to advanced content levelIntermediate to advanced
526 pages
23h 39m
English
O'Reilly Media, Inc.
Content preview from Using SQLite

Name

integrity_check — Initiate a database file integrity verification

Common Usage

PRAGMA [database.]integrity_check;
PRAGMA [database.]integrity_chcek( max_errors );

Description

The integrity_check pragma runs a self-check on the database structure. The check runs through a battery of tests that verify the integrity of the database file, its structure, and its contents. Errors are returned as text descriptions in a single-column table. At most, max_errors are reported before the integrity check aborts. By default, max_errors is 100.

If no errors are found, a single row consisting of the text value ok will be returned.

Unfortunately, if an error is found, there is typically very little that can be done to fix it. Although you may be able to extract some of the data, it is best to have regular dumps or backups.

See Also

quick_check

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Creating a Database with SQLite

Creating a Database with SQLite

Allen Taylor
Practical SQL

Practical SQL

Anthony DeBarros

Publisher Resources

ISBN: 9781449394592Errata PageSupplemental Content