vacuum
The vacuum command rebuilds the database file, repacking it into a minimal amount of disk space.
A vacuum will fail if there is an open transaction on the database connection that is attempting to run the vacuum. Unfinalized SQL statements typically hold a read transaction open, so the vacuum might fail if there are unfinalized SQL statements on the same connection. Vacuum is a write operation and so if another database connection is holding a lock that prevents writes, then the vacuum will fail.