如何清理sqlite数据库? [英] How to vacuum sqlite database?

查看:676
本文介绍了如何清理sqlite数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何清理sqlite数据库. 我从命令提示符处尝试了整个数据库的语法MANUAL VACUUM命令:

I want to know how to vacuum sqlite database. I tried a syntax MANUAL VACUUM command for the whole database from command prompt:

 $sqlite3 database_name "VACUUM;";

但是它给出了如下错误:

But it's giving error as:

near "database_name": syntax error.

以及自动真空吸尘器

PRAGMA auto_vacuum = INCREMENTAL;

并针对以下特定表进行了尝试:

And tried it for a particular table as:

VACUUM table_name;

但没有结果.

推荐答案

您无需在语法中指定表名.仅VACUUM有效.

You don't to specify the table name in the syntax. Only VACUUM works.

此外,它将仅清除主数据库,而不清除任何附加的数据库文件.

Also, it will clean the main database only and not any attached database files.

有关更多信息,请参考SQLite 文档.

For more info, refer to the SQLite documentation.

这篇关于如何清理sqlite数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆