1

I was trying to VACUUM my database and got the following error:

"org.sqlite.SQLiteException: [SQLITE_FULL] Insertion failed because database is full (database or disk is full)"

According to http://sqlite.1065341.n5.nabble.com/quot-Vacuum-quot-command-is-failing-with-quot-SQL-Error-Database-or-disk-is-full-quot-td48238.html , we can change the sqlite3_temp_directory(Name Of The Folder Holding Temporary Files).

Can someone help me on how to change this in a LINUX environment?

kyabhft
  • 31
  • 7
  • you can use pragma but should use [pragma_temp_store](https://www.sqlite.org/pragma.html#pragma_temp_store) instead of [pragma_temp_store_directory](https://www.sqlite.org/pragma.html#pragma_temp_store_directory) as latter one is deprecated. – David Nov 26 '19 at 11:30
  • Also see https://www.sqlite.org/tempfiles.html#temporary_file_storage_locations – Shawn Nov 26 '19 at 12:28
  • And in case you're getting this error despite **not** being low on disk space, see [this recent question](https://stackoverflow.com/questions/58739973/database-or-disk-is-full-on-vacuum-with-plenty-of-free-space), as that's a sign of a corrupted database. – Shawn Nov 26 '19 at 12:33
  • I do not want to change the PRAGMA_SETTINGS. I have to do this by changing the sqlite3_temp_directory – kyabhft Nov 26 '19 at 13:25
  • According to the first page Shawn linked, in the absence of using `PRAGMA temp_store_directory` or setting `sqlite3_temp_directory`, under Linux it should look for environment variables `SQLITE_TMPDIR` or `TMPDIR`. – TripeHound Nov 26 '19 at 14:46
  • Probably you are refering to https://stackoverflow.com/questions/10394517/setting-sqlite-temp-store-directory. I still do not understand the solution. – kyabhft Nov 26 '19 at 17:09
  • How can we change the SQLITE_TMPDIR or TMPDIR? – kyabhft Nov 27 '19 at 04:39
  • I added SQLITE_TMPDIR as an environment variable. Thanks all for the help! – kyabhft Dec 05 '19 at 09:41

0 Answers0