sqlite java delete 时出现database disk image is malformed解决思路
发布时间:2010-05-24 21:21:20 文章来源:www.iduyao.cn 采编人员:星星草
sqlite java delete 时出现database disk image is malformed
环境 :JDK1.6
JAVA APPLICATION 开发
SQLite3
问题: 在用JAVA调用“DELETE FROM 表名 ”时数据库文件就出错,出错信息“database disk image is malformed”。
请高手解答:
1、是何原因造成这个问题?
2、怎么解决 这个问题。
------解决方案--------------------
检查 磁盘空间、确定数据库文件是否损坏(写入数据过程中突然掉电、非正常退出程序)
------解决方案--------------------
试试能否导出数据库:
首先导出数据
sqlite3 tt
sqlite>.output old.sql
sqlite>.dump
sqlite>.quit
再倒入到一个新库中
sqlite3 newtt
sqlite>.read old.sql
sqlite>.quit
------解决方案--------------------
你直接DROP TABLE TT,再建立1个不行?
------解决方案--------------------
sqlite faq:
(21) What is an SQLITE_CORRUPT error? What does it mean for the database to be "malformed"? Why am I getting this error?
An SQLITE_CORRUPT error 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 (see DatabaseCorruption) 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 the atomic commit and locking support in SQLite as well as in the mailing list archives.
Your can use PRAGMA integrity_check to do a thorough but time intensive test of the database integrity.
Your can use PRAGMA quick_check to 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.
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。
其他相似内容:
-
怎么建接口将sqlite数据导入sqlsever数据库中
如题 最好有简单的办法 因为表项比较多 使用datatable巨费时
------解决方案-----...
-
弄过FairCom公司c-tree数据库的 进 高分
第一次接触这个数据库
有经验的 说说 如何浏览到表 及 记录
用开发工具 vb delp...
-
火鸟Firebird数据库 Error Message:
UPDATA语句后 产生的
Error Message:
----------------------------------------
Unsucce...
-
数据库访问路径的问题
web中JSP页面,使用jsp:useBean 访问不到表,但是在useBean的那个类中测试过可以连接。
是不是web中访问,数据...
-
sqlite里的增减删等操作sql语句在哪能得到?
我想从sqlite数据库中得到一些已经删除的数据,光拿到db文件还不够。请问sqlite有没有专...
-
怎么查询一个表中最值和最值对应的时间
在表T1中
tag value date_time
"A" 5 "2011-02-04 11:12:52"
"A" 9 "2011-...
-
sqllite可以处理多大数据量?
有一份数据,数据量大概一千万到一千五百万行之间
要放进一个表里进行分析,听说sqllite很方便,不知道用它...
-
mongo SyntaxError
> SELECT * FROM things WHERE name="mongo";
Tue Dec 20 17:45:42 SyntaxError: missing ; before statement...
-
sqlite读取datetime类型报错
1 2011/1/23 12:32:12 2011/9/8 5:00:00 df 2
添加时间是手动选择的,数据库没报错,但读取却报字符...
-
哪个有PI OLEDB Provider的安装包通向一下啊(顶者有分)
急需PI OLEDB Provider的安装包,在线等
请各位多多帮忙啊,谢谢
------解决...