{"id":40,"date":"2021-10-13T08:20:31","date_gmt":"2021-10-13T06:20:31","guid":{"rendered":"https:\/\/the-bug.de\/?p=40"},"modified":"2021-10-13T08:20:33","modified_gmt":"2021-10-13T06:20:33","slug":"how-to-get-rid-of-wal-and-shm-files-in-sqlite3","status":"publish","type":"post","link":"https:\/\/the-bug.de\/?p=40","title":{"rendered":"How to get rid of &#8218;wal-&#8218; and &#8217;shm-&#8218; files&#8216; in sqlite3"},"content":{"rendered":"\n<p>sqlite3 supports some temporary files like wal and shm. See https:\/\/www.sqlite.org\/tempfiles.html for more information.<\/p>\n\n\n\n<p>If some application does not close its corresponding connections properly these files will exists further and make backup routines harder and in my case even impossible. <\/p>\n\n\n\n<p>There is a little hack to process the wal and shm files and get a proper sqlite database file:<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>user@d16ffbdcfd53:~$ ls\ntemp.db  temp.db-shm  temp.db-wal\nuser@d16ffbdcfd53:~$ sqlite3 \nSQLite version 3.27.2 2019-02-25 16:06:06\nEnter &quot;.help&quot; for usage hints.\nConnected to a transient in-memory database.\nUse &quot;.open FILENAME&quot; to reopen on a persistent database.\nsqlite&gt; .open temp.db\nsqlite&gt; .schema\nsqlite&gt; .quit\nuser@d16ffbdcfd53:~$ ls\ntemp.db <\/code><\/pre><\/div>\n\n\n\n<p>Then <em>.open<\/em> and <em>.schema<\/em> where doing some magic here. <\/p>\n\n\n\n<p>I do not know whats happening here exactly. My used version is: <br>3.27.2 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0alt1<\/p>\n","protected":false},"excerpt":{"rendered":"<p>sqlite3 supports some temporary files like wal and shm. See https:\/\/www.sqlite.org\/tempfiles.html for more information. If some application does not close its corresponding connections properly these files will exists further and make backup routines harder and in my case even impossible. There is a little hack to process the wal and shm files and get a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-40","post","type-post","status-publish","format-standard","hentry","category-sqlite-informatics","post-preview"],"_links":{"self":[{"href":"https:\/\/the-bug.de\/index.php?rest_route=\/wp\/v2\/posts\/40","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/the-bug.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/the-bug.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/the-bug.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/the-bug.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=40"}],"version-history":[{"count":1,"href":"https:\/\/the-bug.de\/index.php?rest_route=\/wp\/v2\/posts\/40\/revisions"}],"predecessor-version":[{"id":41,"href":"https:\/\/the-bug.de\/index.php?rest_route=\/wp\/v2\/posts\/40\/revisions\/41"}],"wp:attachment":[{"href":"https:\/\/the-bug.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=40"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/the-bug.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=40"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/the-bug.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=40"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}