sqlite3 のデータベースの復旧

http://taichino.com/engineer-life/database/4123
を参考に
insert 形式がで出力して、
その後、それを新しいデータベースにインポートする。
(0)異常をチェック

sqlite> PRAGMA integrity_check

OKとかでるとOKで.
page xxxx とかでるとエラー

(1)insert形式で出力

sqlite> .mode insert
sqlite> .output tmp.sqlite3.sql
sqlite> .dump

(2)新しい方向に
sqlite3 new.sqlite3

.read dump_all.sql

(3)チェック

sqlite> PRAGMA integrity_check;
ok