Recovering corrupted SMAT database data

The SMAT databases could get corrupted because of a Sqlite database locking control issue.

For example, when the engine and GUI simultaneously query the SMAT database, the IDE queries the SMAT database when the engine is cycling the SMAT database. In these cases, data loss could happen due to SMAT database corruption.

If this happens, then you can recover the SMAT database:

  1. Dump the corrupted SMAT database into a text file.
  2. Remove all error blocks from the text.
  3. Add statements to create and populate the smat_info table if it was not created in the previous raw SQL statements.
  4. Add commit statements (or END TRANSACTION) to the end of the dump text.
  5. Change the raw dump text file to the .sql format.
  6. Use the sqlite3 command to read the .sql file to recreate the SQLite database and rename it to the .smatdb format.