Directory server instance is restored to latest consistent state

When you run the restore operation on a directory server instance, the directory server instance might get restored to latest consistent state. It is restored to this state instead of getting restored to the point when the backup was done. Follow the steps to resolve this issue.

Observed
  1. Create and configure a directory server instance for online backup.
  2. Stop the directory server instance and run the initial offline backup either with the Web Administration Tool or the idsdbback -u -k command.
  3. Add the suffix, o=sample, and start the directory server instance.
  4. Add the entry o=sample.
  5. Verify that the database parameter LOGARCHMETH1 is correctly set.
  6. Perform a restore operation either with the Web Administration Tool or the idsdbrestore -k command.
  7. Verify that the suffix, o=sample, is not present (since backup was done before the suffix was added).
  8. Add the suffix, o=sample, and start the directory server.
  9. Run ldapsearch for the entry o=sample and you can observe that the entry is present.
Expected result
The entry, o=sample, must not be present because only the suffix, o=sample, is added after restore on a clean database (no data).
Reason

During roll-forward, DB2® scans the current logs in the newlogpathlocation. Because of the options that are specified in the roll-forward, DB2 scans the logs until the end, and restores a database to the latest consistent state.

For example, at the time of backup, suppose that you have 100 entries in the directory server. After the backup operation, if you delete five entries and then run the restore operation. You might still find the 95 entries in the directory rather than the 100 entries that you backed up. This reason is because, the latest consistent state of the database was after the deletion on five entries.

However, you can modify the options in the rollforward recovery operation such that the database is restored to the point where it had 100 entries. You must specify the timestamp of the last committed change. This timestamp is the one at which the 100th entry was added and to obtain this value of timestamp is difficult.