<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Yes I have investigated and 'mended' it. The big problem with
this sort of thing is that you can never be sure if you have lost
anything. I found some info on this link</p>
<p><a class="moz-txt-link-freetext" href="http://stackoverflow.com/questions/13675615/svn-cleanup-sqlite-database-disk-image-is-malformed">http://stackoverflow.com/questions/13675615/svn-cleanup-sqlite-database-disk-image-is-malformed</a><br>
</p>
<p>In case anyone else has a similar problem here is what I did -</p>
<p>run sqlite3 to check integrity, best copy digikam4.db to a temp
directory, go to that directory and run -<br>
sqlite3 digikam4.db "pragma integrity_check"<br>
if this returns 'ok' then there is no problem.<br>
If it returns errors</p>
sqlite3 digikam4.db<br>
sqlite> .mode insert<br>
sqlite> .output dump_all.sql<br>
sqlite> .dump<br>
sqlite> .exit<br>
then restart on a new database<br>
sqlite3 new.db<br>
sqlite> .read dump_all.sql<br>
sqlite> .exit<br>
This has now created a new database file that should have everything
that was recoverable from the original. Rename the existing and use
this new one to replace it.
<p>I had previously tried just deleting (renaming to backup) the
database and restart re-created it. Comparing the 3 databases,
original, auto created and rebuilt as above, I saw these results
for a couple of tables</p>
<p>ImageInformation orig = malformed error, auto = 22028, rebuilt
= 47195</p>
<p>ImageMetadata orig = 46949, auto 21310, rebuilt = 46948</p>
<p>So my conclusion is that the rebuilt database has recovered more
of my data and that is the one I have used. It is of course
possible that the additional records in rebuilt over auto are all
rubbish and there was no advantage, but I have no way to know that
so used the bigger one.</p>
<p>Hope that helps someone.<br>
</p>
<p>Mick<br>
</p>
<br>
<div class="moz-cite-prefix">On 21/11/16 19:16, Boudewijn wrote:<br>
</div>
<blockquote
cite="mid:4202126D-96BD-48B2-BB3F-F36C3BDEE336@yahoo.com"
type="cite">Can you access the old database with a sqlite-tool?
Maybe there's an option to dump tables to text and import it to
the new one. Of course, work on a copy of the original database.<br>
<br>
Best regards,<br>
<br>
Boudewijn<br>
<br>
<br>
<div class="gmail_quote">On November 19, 2016 12:34:35 PM
GMT+01:00, Mick Sulley <a class="moz-txt-link-rfc2396E" href="mailto:mick@sulley.info"><mick@sulley.info></a> wrote:
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<pre class="k9mail">I have run self check on the disk and it seems fine.
On 17/11/16 21:26, Maik Qualmann wrote:
<blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> I think you should first check their hard drive. It is well possible that it
has defective sectors. It would be a possible explanation for the broken
digiKam DB.
Maik
On Donnerstag, 17. November 2016 21:20:30 CET Mick Sulley wrote:
<blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"> I seem to have some corruption of my database (sqlite), some pictures do
not display in Digikam.
I just renamed my database and restarted Digikam (4.14) and it recreated
the database, but the old file was 72.7 MB and the new one is 14.4 MB.
The missing pictures do now display.
I have checked through some of the tables and there are big differences
in numbers, e.g. ImageMetadata 46,949 records in the old table, 21,310
in the new table.
I feel that to be safe and not loose data I need to restore the old
database. Any comments, advise? I have loads of tags and I really
don't want to loose them and see no easy way to confirm that they are
all there.
Thanks
Mick
</blockquote>
</blockquote>
</pre>
</blockquote>
</div>
<br>
-- <br>
Sent without keyboard or normal screen, hence lacking spelling,
grammar and layout in greater doses than usually
</blockquote>
<br>
</body>
</html>