# SQLITE database db-wal files

**URL:** <https://forums.plex.tv/t/sqlite-database-db-wal-files/38191>\
**Category:** Dev/API Corner\
**Tags:** other-dev\
**Created:** [July 10, 2013, 8:34pm UTC](https://forums.plex.tv/t/sqlite-database-db-wal-files/38191 "2013-07-10T20:34:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Capt.Mifune](https://avatars.discourse-cdn.com/v4/letter/c/c77e96/32.png) [@Capt.Mifune](https://forums.plex.tv/u/Capt.Mifune)\
**Post date:** [July 10, 2013, 8:34pm UTC](https://forums.plex.tv/t/sqlite-database-db-wal-files/38191/1 "2013-07-10T20:34:53Z")

</div>

Hi, I use the SQLLite database to create external reports on stored media data. Today I see .db-wal (write-ahead logs) file with the plex.db file.

&nbsp;

I'm not sure that 1) I have seen this before, and 2) it is preventing me from opening the .db for ad-hoc query. (I normally copy the .db file and work on that, not the "live" database)

&nbsp;

Can anyone tell me whether write-ahead logs are normal in Plex and the best strategy for unlocking the db for ad-hoc queries? As an additional piece of info, Plex media server is working OK..

&nbsp;

Many thanks,

&nbsp;

James

---

<div class="post-metadata">

**Author:** ![DreamStatic](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/dreamstatic/32/46_2.png) [@DreamStatic](https://forums.plex.tv/u/DreamStatic)\
**Post date:** [January 11, 2014, 11:53pm UTC](https://forums.plex.tv/t/sqlite-database-db-wal-files/38191/2 "2014-01-11T23:53:46Z")

</div>

Did you ever have any luck getting the DB to open? Thanks for the info.

Update:

Looks like if I copy over the -shm and the -wal files at the same time, then it will open fine.&nbsp;

---

<div class="post-metadata">

**Author:** ![sa2000](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/sa2000/32/6922_2.png) [@sa2000](https://forums.plex.tv/u/sa2000)\
**Post date:** [January 12, 2014, 12:09am UTC](https://forums.plex.tv/t/sqlite-database-db-wal-files/38191/3 "2014-01-12T00:09:20Z")

</div>

> Hi, I use the SQLLite database to create external reports on stored media data. Today I see .db-wal (write-ahead logs) file with the plex.db file.
> 
> I'm not sure that 1) I have seen this before, and 2) it is preventing me from opening the .db for ad-hoc query. (I normally copy the .db file and work on that, not the "live" database)
> 
> Can anyone tell me whether write-ahead logs are normal in Plex and the best strategy for unlocking the db for ad-hoc queries? As an additional piece of info, Plex media server is working OK..
> 
> Many thanks,
> 
> James

That is what I do as well but always shut down Plex Media Server before copying the .db file out&nbsp;

I do not worry about the wal file as I presume it just means that my query will not get the latest info with a few updates may still be in the wal file. Not been an issue for me

I use the free sqlite studio.&nbsp;

---

<div class="post-metadata">

**Author:** ![Phil\_MTL](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/phil_mtl/32/6406_2.png) [@Phil\_MTL](https://forums.plex.tv/u/Phil_MTL)\
**Post date:** [January 12, 2014, 2:35am UTC](https://forums.plex.tv/t/sqlite-database-db-wal-files/38191/4 "2014-01-12T02:35:52Z")

</div>

It seems that with the last few PMS releases the write-ahead files are not committed back to the db when PMS is closing (at least on a mac).

This is not a problem as long as you let SQLite Studio work on **a copy of the 3 files** : **db** , **db-shm** and **db-wal**.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 20, 2019, 11:41pm UTC](https://forums.plex.tv/t/sqlite-database-db-wal-files/38191/5 "2019-12-20T23:41:55Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
