Use XML to restore databases.
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' -clientName 'client_name' -instanceName 'instance_name' -backupsetName 'backup_set' -targetDb 'target_db_name'
Notes:
The restore.xml file has the default option to restore from the latest backup image.
For information on additional parameters, see XML Parameters for DB2 Backups and Restores.
-
To log off the CommServe computer, run the qlogout command.
Examples
The following command restores the PROD backup set. In this example, the parameters are listed on the command line.
The latestBrowseFromBackupset.xml file comes from the Save as Script option.
qoperation execute -af latestBrowseFromBackupset.xml -appName 'DB2 on Unix' -clientName 'db2suse12sp1' -instanceName 'db2inst1' -backupsetName 'TEST' –targetDb 'testdb1'