android sqlite 损坏,sqlite数据库文件损坏的问题解决

AnSQLITE_CORRUPTerror is returned when sqlite detects an error in the structure,format,or other control elements of the database file.

sqlite does not corrupt database files,except in the case of very rare bugs (seeDatabaseCorruption) and even then the bugs are normally difficult to reproduce. Even if your application crashes in the middle of an update,your database is safe. The database is safe even if your OS crashes or takes a power loss. The crash-resistance of sqlite has been extensively studied and tested and is attested by years of real-world experience by millions of users."

That said,there are a number of things that external programs or bugs in your hardware or OS can do to corrupt a database file. Details can be found in the discussions on theatomic commitandlockingsupport in sqlite as well as in the mailing list archives.

Your can usePRAGMA integrity_checkto do a thorough but time intensive test of the database integrity.

Your can usePRAGMA quick_checkto do a faster but less thorough test of the database integrity.

Depending how badly your database is corrupted,you may be able to recover some of the data by using the CLI to dump the schema and contents to a file and then recreate. Unfortunately,once humpty-dumpty falls off the wall,it is generally not possible to put him back together again.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值