AirNav Systems Forum

AirNav RadarBox and => AirNav RadarBox and Discussion => Topic started by: neroon79 on December 04, 2015, 01:00:26 PM

Title: How to rescue a corrupted MyLog.db3
Post by: neroon79 on December 04, 2015, 01:00:26 PM
I tried to delete the old flight data by using the MyLog window of ANRB software.
Result: ANRB software freezed and funally crashed.

I copied the MyLog.db3 and tried to open it by using sqlite browser, which actually worked.
After that I tried to browse the content of each sub-section of the MyLog.db3. Result program crashed during the attempt to open the FlightsOld sub-section. I re-opened MyLog.db3 and tried to empty the tables of FlightsOld directly and got "database disk image is malformed" message. So seems that this part got corrupted somehow during some of the software crashes.

The following procedure cured my MyLog.db3:

1. download and install Database Browser for SQLite

2. download Command Line Shell For SQLite (precompiled binarys for windows)

3. create a play ground folder and copy in the MyLog.db3 and sqlite3.exe

4. open sqlite.exe

5. type in the following:
.open MyLog.db3 <ENTER>
.mode insert <ENTER>
.output dump_all.sql <ENTER>
.dump <ENTER>

after the last ENTER the whole content of MyLog.db3 is exported to another file.
Wait until the command shell states:

6. type in the following:
.open MyLog2.db3 <ENTER>
.read dump_all.sql <ENTER>

A new database named MyLog2.db3 with all content of the original MyLog.db3 is created.
Wait until the command shell states:

Close down Command shell by using CRTL+C or CTRL+Z or...

Rename MyLog.db3 to MyLog_old.db3 and then rename MyLog2.db3 to MyLog.db3.

Open MyLog.db3 with the SQLite browser and check if all sub-sections are readable now.

If you want to clean the old flight data:

go to Execute SQL and type in the following:

delete from FlightsOld <the content-table to be cleaned is case sensitive! So: flightsold won't work.
Click on the run arrow well known from cassette recorders, DVD and BD players.

Final step: go to "File" menu and select "Compact Database" the whole db is re-written with all empty/now unused cells removed.

My 500MB MyLog shirnk back to 15MB, without cleaning it shrunk back to 400MB. After 2 year of 24/7 operation I have had more than 2 million flights in my FlightsOld section.

Any questions or need assistance: Post or PM me.

Title: Re: How to rescue a corrupted MyLog.db3
Post by: FACTflights on December 06, 2015, 07:01:36 AM
Thanks Ingo,     

Wish I had read this a few hours earlier, would have made life a lot easier.

 Just went through the process myself.

Got it sorted out eventually.
Title: Re: How to rescue a corrupted MyLog.db3
Post by: Aerotower on July 24, 2019, 12:52:19 AM

thanks for this post!

Now my reports its working again and I have passed from 340MB to 86MB on MyLog.db3.

Your support was more helpful that the AirNav support.

Best regards,
Manuel S.