SQLITE3 VACUUM,“数据库或磁盘已满"; [英] SQLITE3 VACUUM, "database or disk is full"
本文介绍了SQLITE3 VACUUM,“数据库或磁盘已满";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试在我的数据库上运行 VACUUM
命令,但似乎空间不足:
I'm trying to run the VACUUM
command on my database, but I seem to run out of space:
> sqlite3 mydatabase.db "VACUUM"
Error: database or disk is full
数据库大约 36 GB,我运行它的驱动器看起来像(通过 df -h
):
The database is about 36 GB and the drive that I'm running it on looks like (via df -h
):
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 406G 171G 215G 45% /home
所以我显然超出了所需的双倍尺寸限制.我该怎么做才能让真空命令运行?
So I am clearly above the double size limited needed. What can I do to allow the vacuum command to run?
推荐答案
要允许 VACUUM 命令运行,请将临时文件的目录更改为具有足够可用空间的目录.
To allow the VACUUM command to run, change the directory for temporary files to one that has enough free space.
SQLite 的 文档 说临时目录是(按顺序):
SQLite's documentation says the temporary directory is (in order):
- 使用 PRAGMA temp_store_directory 命令设置的任何内容;或
- 使用
SQLITE_TMPDIR
环境变量设置的任何内容;或 - 使用
TMPDIR
环境变量设置的任何内容;或 /var/tmp
;或/usr/tmp
;或/tmp
;或.
,当前工作目录
- whatever is set with the PRAGMA temp_store_directory command; or
- whatever is set with the
SQLITE_TMPDIR
environment variable; or - whatever is set with the
TMPDIR
environment variable; or /var/tmp
; or/usr/tmp
; or/tmp
; or.
, the current working directory
这篇关于SQLITE3 VACUUM,“数据库或磁盘已满";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文