The DSA won't start and the alarm log says "Database is inconsistent"

Document ID : KB000055837
Last Modified Date : 14/02/2018
Show Technical Document Details

The alarm log reports something like this:

20040305.084328 DIB001: Unable to connect to database 'democorp' as ' '
SQL error (-39100): E_US0026 Database is inconsistent. Please contact the
system manager.

A database "goes inconsistent" when Ingres does not know what state the database is in. This can be caused by a hardware failure or a hard shutdown such as a power failure. The recommended method of recovery is to restore from backup.

The Ingres error log ($II_SYSTEM/ingres/files/errlog.log) may explain why the database is inconsistent. Things to look for include an absence of shutdown messages, references to hardware problems (could not write to disk, etc), or anything OS related.

The 'infodb' command gives the Reason for Inconsistency; the main two reasons encountered are:

  • OPEN_COUNT: the open count was non-zero when the database was first opened. Benign.
  • REDO_FAIL: Ingres was unable to complete a REDO of a committed transaction. Nasty.

For non-critical databases, the following ingres command can be used:

verifydb -mrun -sdbname "<database>" -oforce_consistent

This will give you several warnings designed to scare you. As per the Ingres documentation (cmdref.pdf):

  • force_consistent - used to permit entry into a database that is inconsistent. This does not fix the problem with the database; it merely allows you to force the database to act as if it were in a consistent state. This can be very dangerous if used against a production database. Hidden data damage may render one or more tables in the database unrecoverable at some time in the future.