On 7 Dec 2009, at 2:27pm, Nick Shaw wrote:

> When the file exceeds a certain size, I DELETE a specific number of
> records, then VACUUM the file to get the size back below required
> limits.  This works fine, however what happens to the VACUUM command if
> there is insufficient disk space for SqLite to write out the cleaned up
> copy of the database?  I assume it will fail, but the documentation
> doesn't specifically say how much disk space is required during a VACUUM
> operation.  The newly vacuumed file's size should end up being equal to
> or less than the existing file's size, so I assume I'll need at least
> the current database's size of disk space free, but will it ever require
> more space than that to perform the VACUUM (e.g. from other temporary
> files)?

Because there is no documentation about how these things work, even if we 
answered your question, the answer might change in a future version.  For 
example, VACUUM might go from rewrite-in-place to writing a fresh copy of the 
entire file.  It should definitely do this if it notices database corruption 
while VACUUMing.

In similar situations to yours I have instead created a huge pointless file to 
take up disk space pointlessly.  The routine that recovers data deletes this 
huge file (giving it guaranteed free space to work) then does the recovery, 
then creates a huge dummy file again.  This technique means that not only will 
your automated system have a chance to work but you will also be able to free 
up enough space to do emergency recovery stuff manually.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to