zoukankan      html  css  js  c++  java
  • sqlite or svn 错误 The database disk image is malformed 可解决

    在网上找了很多资料,很多网友都提到这个问题是不可解决的,面对这个问题,只能作罢。

    但我不甘心这么丢失数据,最最后找到了一个解决方法。经测试,原来数据,全部保住。

    以下为原文。

    http://www.sunnyu.com/?p=201

    SQLite有一个很严重的缺点就是不提供Repair命令。 导致死亡提示database disk image is malformed 它的产生有很多种可能,比如,磁盘空间不足,还有就是写入数据过程中突然掉电等。 官方对产生原因的一些说明: http://www.sqlite.org/lockingv3.html#how_to_corrupt

    sqlite  my.sqlite3
    sqlite>PRAGMA integrity_check;
    

    获得提示

    *** in database main ***
    Page 1518: btreeInitPage() returns error code 11
    On tree page 1566 cell 2: Child page depth differs
    On tree page 1566 cell 3: Child page depth differs
    SQL error: database disk image is malformed
    

    可以尝试通过简单的导出导入方式对损坏的库文件作回复。 首先导出数据

    sqlite3 my.sqlite3
    sqlite>.output tmp.sql
    sqlite>.dump
    sqlite>.quit
    

    再倒入到一个新库中

    sqlite3 mynew.sqlite3
    sqlite>.read tmp.sql
    sqlite>.quit
    

    这时新建的mynew.sqlite3一般可用。

    http://www.cnblogs.com/yelaiju/archive/2011/03/27/1996863.html

  • 相关阅读:
    poj 1850/poj 1496
    poj 1035
    poj 3252
    hdoj 1013
    poj 2965
    poj 1844
    poj 2309
    蓝桥杯比赛回来后计划。。。
    山大实训第二周感想
    hadoop——Map/Reduce中combiner的使用
  • 原文地址:https://www.cnblogs.com/chen110xi/p/4789334.html
Copyright © 2011-2022 走看看