Tiny Core Linux

General TC => Programming & Scripting - Unofficial => Topic started by: tinypoodle on May 16, 2013, 08:12:00 PM

Title: sqlite database optimization
Post by: tinypoodle on May 16, 2013, 08:12:00 PM
Dependencies:

sqlite3-bin.tcz
file.tcz

Sample output:
(Note: Output from a system where sqlite databases had already been optimized earlier, hence no difference in numbers. General expectation would be sizes after processing potentially to be much smaller than before)

Code: [Select]
tc@box:~$ sqltidy01.sh     

sqltidy.sh - script to vacuum and reindex sqlite databases 

(C) 2013 tinypoodle, distributed under the GPLv2, NO WARRANTY

version 0.1 BETA

Searching for existing sqlite databases in rootfs...

128.0K  /home/tc/.config/hv3
4.0K    /home/tc/.mozilla/seamonkey/1ha2ntq3.default/formhistory.sqlite
12.0K   /home/tc/.mozilla/seamonkey/1ha2ntq3.default/signons.sqlite
4.0K    /home/tc/.mozilla/seamonkey/1ha2ntq3.default/cookies.sqlite
140.0K  /home/tc/.mozilla/seamonkey/1ha2ntq3.default/places.sqlite
4.0K    /home/tc/.mozilla/seamonkey/1ha2ntq3.default/permissions.sqlite
4.0K    /home/tc/.mozilla/firefox/7tmsczzw.default/search.sqlite

Vacuuming and reindexing...

New size:

128.0K  /home/tc/.config/hv3
4.0K    /home/tc/.mozilla/seamonkey/1ha2ntq3.default/formhistory.sqlite
12.0K   /home/tc/.mozilla/seamonkey/1ha2ntq3.default/signons.sqlite
4.0K    /home/tc/.mozilla/seamonkey/1ha2ntq3.default/cookies.sqlite
140.0K  /home/tc/.mozilla/seamonkey/1ha2ntq3.default/places.sqlite
4.0K    /home/tc/.mozilla/seamonkey/1ha2ntq3.default/permissions.sqlite
4.0K    /home/tc/.mozilla/firefox/7tmsczzw.default/search.sqlite

All done!

tc@box:~$
Title: Re: sqlite database optimization
Post by: coreplayer2 on May 16, 2013, 11:50:35 PM
nice, thankyou

 8)
Title: Re: sqlite database optimization
Post by: gwalther on May 20, 2013, 10:31:00 AM
Tried this......found you also need.... sqlite3-bin.tcz ...installed.
Title: Re: sqlite database optimization
Post by: tinypoodle on May 20, 2013, 11:09:53 AM
Correct, thank you very much for reporting!  :)

OP adapted accordingly.