DB image malformed. How to fix it?

Little update;
After another corrupt db and bad overall performance (i have a LOT of sensors) i just went with mysql which was allready installed and used on the host system. Much faster at rendering history now!