I have some sqlite version3 db3 files I copied off a live running production system (I know bad sysadmin bad sysadmin) for various reasons. Is there some sqlite command I can run that will verify that all the data can be read out of these files (I don't mind if it takes a while).

I was considering hacking up some perl which dumps out all data and then re-imports it into new files. I think sqlite will throw an exception if it encounters corrupt data. Is there a better way?

I'm CentOS 5.3 and sqlite-3.3.6-2

link|improve this question

62% accept rate
feedback

1 Answer

up vote 7 down vote accepted

I think you want to try:

pragma integrity_check;

I believe that will scan the DB and check it for errors and whatnot.

More info(and more commands) can be found here:

http://www.sqlite.org/pragma.html

link|improve this answer
See also sqlite.org/faq.html#q21 – Teddy Jul 9 '09 at 10:36
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.