SQLite as we all know, not much to say.
Sometimes the data is large, or there is an exception in the stored procedure, and the database can be problematic.
This is the previous company product problems, resulting in software are not open, I took a lot of time to solve, while now available to contribute.
Download a sqlite3 command-line tool to download the command-line shell for the system version
When the download is complete, unzip it to a directory, and drop the database to be repaired in that directory.
Open Terminal (CMD) to enter the directory.
execute the following command: Sqlite3 the name of the database to be repaired . Output "_temp.tmp". dump. quit the command is to extract the contents of the old database and save it to a temporary file .
Use the editor to open the temporary file _temp just generated. tmp look at the last line of the file is not ROLLBACK; --Due to errors delete it and add COMMIT; if the last line is COMMIT; This step is ignored.
to the terminal, enter the command: sqlite3 the new database name . read "_temp.tmp". quit this command is to write the old data into the new database.
- This completes the database repair. There may be a slight flaw, the data will be lost a small fraction, but at least most of the data is still there, and the database can continue to be used.
"Tutorial" SQLite database Repair