Use XML to restore databases.
Best Practice: You can choose the restore type by browsing and restoring from the backup set, or from the backup job history. Generate the restore.xml file by using the Save as Script option. For more information, see Save as Script Overview.
Procedure
-
If you are not logged on to the CommServe computer, run the qlogin command.
-
Download the restore.xml file to the computer where you will run the command.
-
Navigate to the location where the .xml file is saved and execute the saved .xml script using the qoperation execute command.
qoperation execute -af restore.xml -appName 'DB2 MultiNode' -clientName 'client_name' -backupsetName 'backup_set'Notes:
For information on additional parameters, see XML Parameters for DB2 MultiNode Backups and Restores.
-
To log off the CommServe computer, run the qlogout command.
Examples
Restoring from the Backup Job History Level
The following command restores the PROD backup set from the job history level. In this example, the parameters are listed on the command line.
The RestoreFromJobLevel.xml file comes from the Save as Script option.
qoperation execute -af RestoreFromJobLevel.xml -appName 'DB2 MultiNode' -clientName sfpgsqlvm65_dpf_prod -backupsetName PROD -timeStamps '20170412162819,1,1,0,0,NODE 0' -timeStamps '20170412162818,1,1,0,0,NODE 1' -rollForwardTime/timeValue '2017-04-12 16:31:11'
Restoring from the Backup Set Level
The following command restores the PROD backup set. In this example, the parameters are listed on the command line.
The RestoreFromBackupsetLevel.xml file comes from the Save as Script option.
qoperation execute -af RestoreFromBackupsetLevel.xml -appName 'DB2 MultiNode' -clientName sfpgsqlvm65_dpf_prod -backupsetName PROD