修复SQLite-database disk image is malformed
2017-04-25 14:39
288 查看
运行某些SQL语句出错database disk image is malformed说明SQLite的内部数据格式,已经损坏sqlite> PRAGMA integrity_check;*** in database main ***Main freelist: 3 of 3 pages missing from overflow list starting at 0排除磁盘空间不够的原因修复步骤$ sqlite3 backup.sqlitesqlite> .output “_temp.tmp”sqlite> .dumpsqlite> .quit$ sqlite3 new.sqlitesqlite> .read “_temp.tmp”sqlite> .quit就将错误的backup.sqlite修复为new.sqlite了另一种更快的修复方法$echo “.dump” | sqlite3 old.db | sqlite3 new.db直接将 old.db 修复为 new.db或者sqlite3 newsfeed.db .dump > newsfeed.sqlsqlite3 newsfeed.db < newsfeed.sql请参考 http://www.sqlite.org/faq.html#q21http://www.sqlite.org/sqlite.htmlPHP使用popen调用sqlite shell来实现修复$handle = popen(“mv ../backup.sqlite bad.sqlite && sqlite3 bad.sqlite .dump | sqlite3 good.sqlite && mv good.sqlite ../backup.sqlite”, ‘r’);$read = fread($handle, 4096);echo $read;pclose($handle); 压缩
sqlite3 my.sqlite 'VACUUM;'
原文:http://www.cnblogs.com/adinet/archive/2011/11/03/2233858.html
相关文章推荐
- 修复SQLite-database disk image is malformed
- sqlite 修复 database disk image is malformed 问题
- Sqlite修复方法(database disk image is malformed)
- SVN 报错 sqlite[S11]: database disk image is malformed
- Android.database.sqlite.SQLiteDatabaseCorruptException: database disk image is malformed
- sqlite错误 The database disk image is malformed database disk image is malformed 可解决
- svn sqlite[S11]: database disk image is malformed 终极解决方案
- sqlite错误 The database disk image is malformed database disk image is malformed 可解决
- sqlite关于The database disk image is malformed问题的解决
- SVN 报错 sqlite[S11]: database disk image is malformed
- svn: E200030: sqlite[S11]: database disk image is malformed
- SQLite 损坏 database disk image is malformed
- sqlite关于The database disk image is malformed问题的解决
- sqlite错误 The database disk image is malformed database disk image is malformed 可解决
- SQLite出现database disk image is malformed(11)的处理
- SVN 报错 sqlite[S11]: database disk image is malformed 原创 2017年06月26日 16:14:10 2978 蛋碎的开机一会儿,想着把第一件事儿就
- svn cleanup: sqlite: database disk image is malformed 解决方法
- SQLite打开提示database disk image is malformed
- sqlite错误 The database disk image is malformed database disk image is malformed 可解决
- svn更新的时候断电,下次在更新出现svn: sqlite: database disk image is malformed