Welcome to Radarspotting. Please login or sign up.

August 24, 2026, 10:24:08 AM

Login with username, password and session length

New Members

New Members

You should get an activation email when you join.  If not, please use the Contact option.

Basestation.SQB and Reporter Error

Started by Truetrack, August 06, 2019, 06:06:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Truetrack

Basestation.SQB and Reporter Error
after my recent Disk I/O error at startup BS
in Reporter I scrolled through the last day accumulation and found a few faulty entries,
then in my DB Browser for SQLite I tried out of Aircraft Table to delete these ModeS Rows.
Red Warning and no Success.
Then tried to delete this last day's Session altogether.
No success either.
Instead each Warning report : - Foreign Key constraint failed -
So had to discard that entire backup and looked for a previous one.
Later found out there is extra a Foreign key constraint Check under browser tools.
One may try repair there are many Pragma commands, but this is beyond my knowledge.
MY Fazit: backing up more often, since Virtual Store used I can just copy the bunch
of daily rewritten files like
Basestation.SQB
Basestation.INI
BasstationReporter.INI
and Reference.SQB
That Check at least helps to know whether DB in so far is clean or corrupt.
Klaus

Anmer

This is a very old post on the Kinetic Forum, courtesy of SabreJV.  I remember it worked for some repairs but no guarantee:

Use this possible sqb file repair at your own risk, and only work with copies of your Basestation.sqb file.

Create a new folder on your PC that you have full read-write access to I've called mine c:\SQBRepair

From the SQLite3 website download the command-line shell program for accessing and modifying SQLite databases.

http://www.sqlite.org/download.html

look for the file sqlite-shell-win32-x86-3070701.zip and download.

from the downloaded zip extract Sqlite3.exe and place it in c:\SQBRepair or whatever you have named your folder

==
Open Windows Notepad and copy the following lines into notepad and then save the file as SQBfix.bat into the same folder c:\SQBRepair or whatever you have named it.

rename basestation.sqb basestation.old
sqlite3 basestation.old < repair1.txt
sqlite3 basestation.sqb < repair2.txt

===
Again using Notepad copy these lines and then save the file as repair1.txt and save again in the same folder. The leading full stops/periods are necessary.

.echo on
.output repairdb.txt
.dump
.exit

===
Once more for the following lines saved this time as repair2.txt note the Pragma line does NOT have a leading full stop.

.echo on
.read repairdb.txt
PRAGMA integrity_check;
.exit

===

You should now have in your folder these 4 files

SQLite3.exe
SQBfix.bat
repair1.txt
repair2.txt

Now copy your Basestation.sqb file into the folder, make sure that you have plenty of free diskspace on the drive I suggest at least 2 times the size of the sqb is a minimum.

Double click on SQBfix.bat and the repair process should start to run in a CMD window.

The Basestation.sqb file is renamed Basestation.old and is then dumped as text into a file named repairdb.txt this can take a while depending on sqb file size.
This text file is then read into a new Basestation.sqb file and the process will take even longer as the text is read back in to create the rebuilt sqb file.

As the process runs the CMD window should scroll as statements are executed. If successful then a integrity check is run on the new sqb and this should return OK. You can then close the CMD window.

If things stop and stall for a long time (say 5 minutes of no activity) then Ctrl+C should abandon things when the focus is on the CMD prompt window or try to close the CMD prompt window with the 'X' button at the top right.

This repair uses SQLite3's ability to dump a database and read it back in as SQL statements - it probably will only fix simple errors and does not guarantee a fix. Copy and keep your original sqb safe before trying anything.

As I noted in my opening, trying this is at your own risk - it worked here but that was using an undamaged sqb 100mb in size.

Finally I can't remember where I first came across this method on the web and it also has appeared on this forum and elsewhere, so apologies for not crediting those individuals.

==
Sabrejv
Here to Help.

Truetrack

Hi Mike
Thank You for finding and reposting SabreIV comprehensive step by step instruction.
Shall peer into it more closely when time given.
I am afraid though that is beyond my capability and patience.
Klaus