EFT Link Database Corruption

There have been instances where we have seen where the Monetra service has not successfully started after certain events on the EFT Link server computer.  These events include power surges, or power failures.  There are certain steps that must be taken in order for the database to be restored back to health. 

The database health check is performed during startup of the service.  This health check is called the "Database Integrity Check".  During the startup of a healthy system you will see the following lines in the Monetra.log

[INFO]: Starting SQLite Integrity Check...

[INFO]: Database integrity check completed successfully

If the Integrity Check fails you will see the following entries.

[INFO]: Starting SQLite Integrity Check...

[INFO]: Database integrity check Failed

Unable to connect to SQLite database

In the event the Monetra service will not start because it reports the database integrity check has failed, you are going to need to perform a manual dump and reload of the SQLite database. Unfortunately, this is not a guaranteed fix, but will work in all but the most severe instances of database corruption.

Due to the atomic commit nature of SQLite, you should never experience database corruption; if you are it could be due to enabling features such as Write Caching within your OS or in the hard drive itself, or could possibly even be caused by hardware failure.

SQLite maintains a journal file to rollback commits and returns the database to a consistent state in the event of a power failure or other abrupt shutdown. If corruption occurs, it means that the OS responded to SQLite stating a write operation had completed when in actuality, it wasn't physically committed to the media yet. Please ensure Write Caching is disabled on all drives (On windows, it is enabled by default, disable it), and if utilizing a RAID controller that Write Caching is only enabled if a BBU is present. For more information, please see the SQLite Atomic Commit reference.

To begin the recovery process, please ensure you have installed the sqlite3 command line utility. This utility can be found here http://www.sqlite.org/download.html.

It is recommended to simply extract the obtained SQLite windows binary zip file into your Monetra data folder, which is by default:
C:\Program Files\Main Street Softworks\Monetra\data\
There should only be one file extracted, called sqlite3.exe

General Note: Please ensure your SQLite3 executable is at least version 3.7 or this procedure will not work.

The first thing you need to do after ensuring you have the sqlite3 command line utility is locate your Monetra data folder. Assuming you used the default installation paths.
That should be:
C:\Program Files\Main Street Softworks\Monetra\data\

In the event that you have installed into a different path, you will be responsible for determining the correct database directory and adjusting appropriately in the procedure to follow.

Once you have located your Monetra data folder, you should only see a single file Monetra. SQLite, but in certain error conditions, you may see additional files with a similar naming convention such as:

Monetra. SQLite

Note: If the .journal, -wal, or -shm files exist, STOP NOW. Most likely you did not receive an integrity check failure from Monetra as these files would not exist if you did. You should attempt to start Monetra again and see if these files disappear prior to continuing.

The default database name is Monetra. SQLite but it could be different. If so, please replace all references in the below procedure as appropriate.

Go to Start->Run, type 'cmd' (without the quotes) and press the ENTER key, then when the DOS Command Prompt window opens, type the commands below into the Window. Please remember to adjust these commands if you installed to a different path or your database name is different. If a failure of any one of these commands occurs, stop and re-evaluate.

C: cd "C:\Program Files\Main Street Softworks\Monetra\data\"
move Monetra. SQLite monetra.sqlite.backup
sqlite3 monetra.sqlite.backup .dump | sqlite3 monetra.sqlite

Once those steps have been followed successfully, you should then be able to successfully start the Monetra service and process EFT Link transactions. It is recommended to pull some reports to ensure data appears to be consistent with what you expect.

If not, make sure you do not remove the
monetra.sqlite.backup file you created during this process.

If these steps have been performed in their entirety and the Monetra service cannot be started and the Monetra.log contains the same Database Integrity Check errors please contact Retail Pro Support.

Published on Mar 18, 2014 in EFT & Payments


Find Another Article