Platform SDK: Removable Storage Manager

Restoring the RSM Database in the Absence of a Backup

This section describes a strategy for an application to recover the RSM database when the database has been lost and there is no backup copy, but the application has not lost the database that refers to the lost RSM database. For this example it is assumed that the application has kept both the RSM LMID and its own OMID information in its database. An application can take the following steps to in essence create a usable new RSM database:

  1. When RSM starts without a database it does a full inventory and all the media in the library appear in the import pool.
  2. The application must create its media pool(s).

    The application must have a mechanism that scans the Import media pool for its media. This can be accomplished by reading the OMID information of the sides of the physical media and finding all media with the szOmidLabelType parameter that is the application's type. As an additional check the application can verify that the szOmidLabelInfo parameter is correct for the media.

  3. For all sides found, the application must call the AllocateNtmsMedia function, specifying the side and media pool.
  4. The application database must be updated with the new LMID that is assigned to the media. The application should search through its database for all cases of the OMID it has found and replace the corresponding LMID with the new one.
  5. Media that were offline and not in the library at the time of the full inventory must be injected into the library so they can be identified and placed in the import pool. Steps 3, 4 and 5 repeated.