DBRepair development

I do not know HOW to put that in windows!

I have a 911 out to Dan

LOL

1 Like

Thats a -SOS

2 Likes

I don’t see any shingles !

LOL

1 Like

I guess mine was ok:

Ok to begin deflating the databases? (Y/N) ? Y
Removing - block 1
Removed 0 records.
Vacuuming DB to reclaim working space.
Initial Database size = 178 MB
Final Database size   = 177 MB


BTW, not seeing this recorded in the DBRepair.log

2025-05-30 20.33.29 - ============================================================
2025-05-30 20.33.29 - Session start: Host is Ubuntu 24.04.2 LTS
2025-05-30 20.36.23 - Exit    - Retain temp files.

@Tony_T

I didn’t write anything to the log because there are users who have completely full disks. ( Some DBs are 3+ TB and filled the HDDs ) I don’t know how many are out there so I opted for absolute minimum disk space increase.

I could write a log entry after the fact.

Good idea.

2 Likes

That makes sense. Vacuum will always get a little bit.
( This is pure integer math )

In your case, normal auto is now the next step.

1 Like

@Tony_T

If you open DBRepair.sh in the text edit,

scroll down to line 1789

Would you align with this and then copy/paste in these lines and try it?
See if you like how that reports in the DBRepair.log ?

  # Turn journal mode back on
  Result="$("$PLEX_SQLITE" "$CPPL.db" "PRAGMA journal_mode = WAL;")"

  # Now write abbreviated log entries
  WriteLog "Deflate - Report."
  WriteLog "Deflate - Initial Database size = $((InitialSize / 1000000)) MB"
  WriteLog "Deflate - Final Database size   = $((Size / 1000000)) MB"
  WriteLog "Deflate - Records Removed       = $TotalRemoved"
  WriteLog "Deflate - PASS."
}
2025-05-30 22.22.13 - ============================================================
2025-05-30 22.22.13 - Session start: Host is Ubuntu 24.04.2 LTS
2025-05-30 22.22.21 - Deflate - Report.
2025-05-30 22.22.21 - Deflate - Initial Database size = 178 MB
2025-05-30 22.22.21 - Deflate - Final Database size   = 177 MB
2025-05-30 22.22.21 - Deflate - Records Removed       = 0
2025-05-30 22.22.21 - Deflate - PASS.

How’s that look as you look at the whole log ?

Looks fine…

.....
2025-05-30 20.38.52 - Auto    - COMPLETED
2025-05-30 20.39.08 - Exit    - Retain temp files.
2025-05-30 20.39.08 - Session end. Fri May 30 20:39:08 EDT 2025
2025-05-30 20.39.08 - ============================================================
2025-05-30 22.22.13 - ============================================================
2025-05-30 22.22.13 - Session start: Host is Ubuntu 24.04.2 LTS
2025-05-30 22.22.21 - Deflate - Report.
2025-05-30 22.22.21 - Deflate - Initial Database size = 178 MB
2025-05-30 22.22.21 - Deflate - Final Database size   = 177 MB
2025-05-30 22.22.21 - Deflate - Records Removed       = 0
2025-05-30 22.22.21 - Deflate - PASS.
2025-05-30 22.24.59 - Auto    - START
2025-05-30 22.25.00 - Check   - Check com.plexapp.plugins.library.db - PASS
2025-05-30 22.25.00 - Check   - Check com.plexapp.plugins.library.blobs.db - PASS
2025-05-30 22.25.00 - Check   - PASS
2025-05-30 22.25.39 - Repair  - Export databases - PASS
2025-05-30 22.25.47 - Repair  - Import - PASS
2025-05-30 22.25.48 - Repair  - Verify main database - PASS (Size: 169MB/169MB).
2025-05-30 22.25.48 - Repair  - Verify blobs database - PASS (Size: 254MB/254MB).
2025-05-30 22.25.48 - Making repaired databases active
2025-05-30 22.25.48 - Repair  - Move files - PASS
2025-05-30 22.25.48 - Repair  - PASS
2025-05-30 22.25.48 - Repair  - PASS
2025-05-30 22.25.48 - Reindex - MakeBackup com.plexapp.plugins.library.db - PASS
2025-05-30 22.25.49 - Reindex - MakeBackup com.plexapp.plugins.library.blobs.db - PASS
2025-05-30 22.25.49 - Reindex - MakeBackup - PASS
2025-05-30 22.25.50 - Reindex - Reindex: com.plexapp.plugins.library.db - PASS
2025-05-30 22.25.50 - Reindex - Reindex: com.plexapp.plugins.library.blobs.db - PASS
2025-05-30 22.25.50 - Reindex - PASS
2025-05-30 22.25.50 - Reindex - PASS
2025-05-30 22.25.50 - Auto    - COMPLETED
2025-05-30 22.26.17 - Exit    - Retain temp files.

Thanks.

I’ll update tomorrow and reissue.

DBRepair - v1.11.03 - Summary log information after Deflate.

2 Likes

Error returned. 1.11.02 works fine

I’m sorry?

You are invoking DBRepair.sh stop auto start exit

and it reports Tar ?

Isn’t the command tar (lower case) ?

what’s happening to that screenshot ?

-rw-rw-r-- 1 chuck chuck  66212 May 31 00:35 DBRepair-1.11.03.tar.gz

You should also be able to use the 88|update command too

1 Like

@SE56

tar xvzf

The file is compressed. You may need the z flag.

1 Like

All good now

Need to update The Menu for the 911 Option in the Readme GitHub - ChuckPa/DBRepair: Database repair utility for Plex Media Server databases

@Tony_T

This is temporary. (documented in the release notes)

1 Like

Hi Chuck, reddit redirected me here when I noticed my database files went from 200mb to 57gb

Tried running the powershell tool in Windows over night and 11hrs later it was still showing the ‘running’ prompt but I couldnt tell it to Exit and eventually had to restart my computer. Now my C: is missing a lot of space (from the temp files used?)

What’s my best path here? Run Optimize in PMS or do I run the DBRepair again? And how do I clean up the space used over night? (is it com.plexapp.plugins.library.db-wal? will auto continue it or is it 40GB of junk now?)

@mat_b

The current Windows version is the ‘slow’ method. It does take a long time.

The guy who does the Windows version of DBRepair (powershell) will be home tonight. He will look at taking the improvements I’ve made in Linux and transplanting to Windows.

With luck, it will be equally improved.

Last night, on Linux, I helped a user with his 70 GB DB reduce it back to 680 MB.

He was running the original slow version of my script.

  • We interrupted it.
  • We then deleted the WAL & SHM files
  • We then did the database deflate with the new version (DEFLATE command)
  • Lastly we let DBRepair AUTO fix the minor error interrupting it caused (no data loss)
  • He did confirm everything was intact.
  • On his machine it took some 2.5 hours from start to finish

I will ask to be patient a little longer
We have the better method.
PMS itself should be fixed too.

Between the two, the DB should return to normal quickly and stop bloating.