私はこのような症状を示す破損したsqliteファイルを持っていました。私は
select * from corruptTable;
でレコードをロードしようとするとき
select count(*) from corruptTable;
return:38000;
しかし、それだけで7つのレコードを返します。
私はいくつかのことを試みましたが、これらの手順が最も成功しました。
Macでは、ターミナルを開き、破損したデータベースでこれらのコマンドを実行します。 (これらはsqlite3コマンドなので、ほかのシステムでは他のsqlite3エディタや同様のコマンドを使用できるはずです)。
1 sqlite3 dbWithCorruptTable.sqlite (Obviously replace "dbWithCorruptTable" to your sqlite3 file that has the corrupt table)
2 .mode insert
3 .output dump_all.sql
4 .dump
5 .exit
6 Manually edit the dump_all.sql file in a text editor and remove the transaction statements. Usually there is a "BEGIN TRANSACTION" statement on the 2nd line of the file and a "ROLLBACK" statement on the last line. Remove these and save the file
これらの手順は、このウェブサイトから取られた: http://www.dosomethinghere.com/2013/02/20/fixing-the-sqlite-error-the-database-disk-image-is-不正な形式/
もし彼がバックアップしていれば、彼は回復する必要はありませんでした。... – peterh
@PeterHorvath「インターネット上で、誰もあなたが微妙であると聞くことはできません。 -Linus Torvalds –
これは実際に私のために働いた。 ".dump"は、妥当なSQLを、壊れたファイルから生成しました。これは、integrity_checkが失敗していました。 – BrandonLWhite