Recovering a Database

If a system failure (such as a power failure) occurs, your database will not be closed down correctly. The next time you run DP4, you will be prompted to use the DP4 Database Recovery utility by a message like this:

DP4 secures changes to the database after several updates. The recovery mechanism rolls the database back to the last intact version of the database. The transaction log is then applied to roll-forward the database to the last update secured before the system failure.

  1. On the Database Backup/Recovery & Check menu, select the Recover option. The Roll-back Recovery utility screen is displayed

  2. Select the database name

  3. DP4 displays the message that it is recovering the database and applying the transaction log. Once the process is complete, you are returned to the Database Backup/Recovery & Check menu

After running the database recovery utility, run the database checking utility. If you are using a version of DP4 prior to 4.520 you may find a checksum error is reported, but if this is the only error it is safe to reset the checksum and carry on. However if you are using 4.520/4.616 or later and get any error at all, or if any other error is reported, the database was either corrupt before the crash or the roll-back recovery has not worked.

The database recovery utility is designed for recovering databases after a crash, not for removing corruption from genuinely corrupt databases. These include databases that have reported DP4 System error 87. Origin: Database Corruption

Recovering the System Database

The system database should not normally require recovery, because it is usually opened in read-only mode. However, certain tasks, such as adding or changing device support, or updating the user list, do update the system database, and if a system failure occurs the system database will need to be recovered. In this case you will not be able to log on to DP4 at all, and in the worst case scenario, your DP4 configuration may not start at all.

To recover the system database proceed as follows:

  1. If your normal DP4 configuration will not start, then start DP4 in standalone mode (just the DP4 database manager running). On Windows platforms, if you have modified the congiration file so as to leave no explicit means of starting up DP4 like this you can do this by specifying dummy section names for preload and startup, for example:

    srvw32 -start -startup=invalidsection -preload=invalidsection

    On other platforms, just load SRVn, for example on Unix/Linux srv3, or allow DP4 to auto-load,

  2. To perform the actual recovery, run DBRECOV from a command prompt like this:

    dbrecov -db system -silent

    If you have renamed the system database, then supply the appropriate name.

  3. If the recovery succeeds you will be able to run DP4 as normal once again. In case of difficulty you will need to restore a backed up copy of your modified system database, or if this is not available, you can try renaming the current system database files, and reinstalling the issued DP4 system database, and then retry the DBRECOV operation as though the renamed system database was an ordinary application database.