Backing up related databases together

Data in multiple repositories is often related, especially when UCM is in use. Related databases should be backed up together.

About this task

Typical database relationships include the following:
  • UCM PVOBs and the component VOBs they reference are connected by hyperlinks.
  • Administrative VOB hierarchies (see VOB datatypes and administrative VOB hierarchies) are connected by hyperlinks.
  • In an environment that uses UCM and Rational® ClearQuest®, PVOBs store references to records in Rational ClearQuest databases, and Rational ClearQuest databases store references to objects in PVOBs.
Database relationships illustrates these relationships in a simple configuration.
Figure 1: Database relationships

Figure 6. shows the database relationships among a PVOB and three component VOBs, and between the PVOB and a database.

UCM operations such as joining a project, making an activity, delivering or rebasing a stream are likely to change the data in multiple related databases and, in some cases, the relationships themselves. Even if UCM is not in use, changes in an administrative VOB hierarchy (for example, creating a global type and a local copy) can affect multiple VOBs with a single operation. The longer the interval between the time that the first member group of related databases is backed up and the time that the last member is backed up, the greater the chance that these relationships will be skewed when any of the backups are restored.

An ideal backup strategy for a configuration such as the one in Database relationships would consist of these steps:
  1. Lock all the VOBs and the Rational ClearQuest database.
  2. Back up all the VOBs and the Rational ClearQuest database.
  3. Unlock all the VOBs and the Rational ClearQuest database.

In all but the simplest configurations (those with a few small VOBs and a small Rational ClearQuest database), it is unlikely that this procedure could be completed in a reasonable length of time. Even if all the related databases could be backed up at the same time, it is unlikely that they would be restored together. It is far more likely that one or two databases from the set would be restored into an environment where the others were intact, which would again result in skew between the restored and intact databases. Many types of skew between databases can be reconciled by using tools and procedures described in Restoring one or more members of a set of related databases.

The following procedure illustrates a more practical backup strategy.

Procedure

  1. Determine database relationships.

    In an environment where UCM is not in use, database relationships are determined primarily by the structure of administrative VOB hierarchies. Use the DevOps Code ClearCase® Administration Console or cleartool describe to display the AdminVOB hyperlinks that point to or from a VOB. (As described in Administrative VOB hierarchies and global types, a VOB can have exactly one AdminVOB hyperlink pointing to its superior in an administrative VOB hierarchy and can have zero or more AdminVOB hyperlinks pointing to it from other VOBs in the hierarchy).

    In a UCM environment, database relationships are determined by the organization of the project. All the modifiable components in a project, as well as its PVOB and any Rational ClearQuest databases it uses are related and must be backed up together. (Nonmodifiable components must be backed up also, but because the references held to these components by the PVOB are likely to be valid for longer intervals, you might not need to back up these components on the same schedule as the others.) You can use the Project Explorer or cleartool lsproject to display the components in a project.

  2. Back up the component VOBs.
    If possible, use the vob_snapshot tool, which minimizes backup time for each VOB.
  3. Back up the Rational ClearQuest database.
  4. Back up the PVOB using vob_snapshot.
    PVOBs that do not also contain components have no data in their pools and can be backed up by vob_snapshot without risk of data loss. If your configuration includes multiple PVOBs that have a common administrative VOB, back up all the PVOBs and the administrative VOB as a unit. (Lock all the PVOBs and their administrative VOB, back them up, then unlock them.)

Results

This strategy maximizes the chances that, on restore, the PVOB is newer than the Rational ClearQuest database and component VOBs, which in turn simplifies the reconciliation of database skew.

Regardless of the backup strategy that you use, include these practices:
  • Back up all members of a related group of databases in the shortest amount of time possible.
  • Back up the entire group frequently. On restore, a backup performed yesterday generates far less skew than a backup performed last week.