Wiki Navigation
- Loading...
Overview
How to check and repair corrupted SQLite database.
Symptoms
If you find database errors in your log files, or repeated "closing database" entries, your SQLite database may be corrupted.
Resolution
The following instructions apply to the MediaPortal video database, but could be applied to any MediaPortal SQLite database.
Download
sqlite3.exe
from http://www.sqlite.org/2017/sqlite-dll-win32-x86-3200100.zipExtract the
sqlite3.exe
into a working folder, e.g.C:\SQLRepair
Make a copy of the corrupted Database into the working folder "
C:\SQLRepair"
and name it, e.g. tobad.db
open cmd (Command prompt) and go to
cd /d C:\SQLRepair
type following in command prompt to check DB integrity (copy-paste these commands into cmd):
echo pragma integrity_check; | sqlite3.exe bad.db
If you see any error message(s), then type following in command prompt to extract data into an SQL File and recreate a new Database with the extracted Data (copy-paste these commands into cmd) :
echo .dump | sqlite3.exe bad.db > good.sql sqlite3.exe VideoDatabaseV5.db3 -init good.sql
Backup your corrupted video database to somewhere. Copy the repaired one from C:\SQLRepair
and overwrite your corrupted db.
You can also check this forum post for similar type of solution, but more appropriate for automating.
Related
Changelog
Change | Date | Release |
---|---|---|
2014/09/02 | 1.10.0 | |
This page has no comments.