Invoking a backup or a restore operation using vendor products

You can invoke a backup or a restore operation using vendor products by using the control center, the command-line and API function calls. You can also use the history file as an aid in database recovery operations.

The history file is associated with each database, and is automatically updated with each backup or restore operation. Information in the file can be viewed, updated, or pruned through the following facilities:
  • Control Center
  • Command line processor (CLP)
    • LIST HISTORY command
    • UPDATE HISTORY FILE command
    • PRUNE HISTORY command
  • APIs
    • db2HistoryOpenScan
    • db2HistoryGetEntry
    • db2HistoryCloseScan
    • db2HistoryUpdate
    • db2Prune
For information about the layout of the file, see db2HistData.
When a backup operation completes, one or more records is written to the file. If the output of the backup operation was directed to vendor devices and the LOAD keyword was used, the DEVICE field in the history record contains an O. If the backup operation was directed to TSM, the DEVICE field contains an A. The LOCATION field contains either:
  • The vendor file name specified when the backup operation was invoked.
  • The name of the shared library, if no vendor file name was specified.
For more information about specifying this option, see BACKUP DATABASE command.

The LOCATION field can be updated using the Control Center, the CLP, or an API. The location of backup information can be updated if limited capacity devices (for example, removable media) have been used to hold the backup image, and the media is physically moved to a different (perhaps off-site) storage location. If this is the case, the history file can be used to help locate a backup image if a recovery operation becomes necessary.

Vendor products can be specified when invoking the Db2® backup or the Db2 restore utility from:
  • The Control Center
  • The command line processor (CLP)
  • An application programming interface (API).

The Control Center

The Control Center is the graphical user interface for database administration that is shipped with Db2.

Table 1. Control Center input variable for backup or restore operations
To specify The Control Center input variable for backup or restore operations
Use of vendor device and library name Is Use Library. Specify the library name (on UNIX based systems) or the DLL name (on the Windows operating system).
Number of sessions Is Sessions.
Vendor options Is not supported.
Vendor file name Is not supported.
Transfer buffer size Is (for backup) Size of each Buffer, and (for restore) not applicable.

The command line processor (CLP)

The command line processor (CLP) can be used to invoke the Db2 BACKUP DATABASE or the RESTORE DATABASE command.

Table 2. Command line processor parameter for backup and restore
To specify The command line processor parameter for backup is The command line processor parameter for restore is
 
Use of vendor device and library name library-name shared-library
Number of sessions num-sessions num-sessions
Vendor options options-string options-string
Vendor file name file-name file-name
Transfer buffer size buffer-size buffer-size

Backup and restore API function calls

Two API function calls support backup and restore operations: db2Backup for backup and db2Restore for restore.

Table 3. API parameter for both db2Backup and db2Restore
To specify The API parameter (for both db2Backup and db2Restore) is
Use of vendor device and library name as follows: In structure sqlu_media_list, specify a media type of SQLU_OTHER_MEDIA, and then in structure sqlu_vendor, specify a shared library or DLL in shr_lib.
Number of sessions as follows: In structure sqlu_media_list, specify sessions.
Vendor options PVendorOptions
Vendor file name as follows: In structure sqlu_media_list, specify a media type of SQLU_OTHER_MEDIA, and then in structure sqlu_vendor, specify a file name in filename.
Transfer buffer size BufferSize