Use XML to restore databases.
You can include the XML parameters in the xml file, or you can specify them on the command line when they frequently change. For more information on command line parameters and XML elements, see Command Line - Syntax.
Procedure
-
Download the restore.xml file to the computer where you will run the command.
-
Open the restore_template.xml file, add your specific parameters, and save the file.
For information on supported instance XML parameters, see Available XML Parameters for SAP HANA Restores.
-
On the command line, go to Software_Installation_Directory/Base and type the command.
qoperation execute -af restore.xml -associations/appName 'SAP HANA' -associations/clientName ‘PseuDoClientName' -associations/instanceName 'SID' -destClient/clientName 'ClientName' -hanaOpt/destDbName 'SID' -hanaOpt/destPseudoClientName ' PseuDoClientName' -hanaOpt/destClientName ClientName' -hanaOpt/backupPrefix 'backup_prefix' -hanaOpt/initializeLogArea true_false -
Verify the status of the job. On the command line type the command:
qlist job –j job_id -
After the job completes, run the qlogout command to log off the CommServe computer.
Examples
Data Only Restore
To perform a data only restore, set the hanaOpt/initializeLogArea parameter to 'true'. Set the following elements:
|
Parameter |
Value |
|---|---|
|
associations/clientName |
The SAP HANA pseudo-client name (in this example, 'SS5_HANA'') |
|
associations/instanceName |
The SAP HANA instance name (in this example, 'SS5') |
|
destClient/clientName |
The SAP HANA client name (in this example, 'hana_02') |
|
hanaOpt/destDbName |
The destination database name (in this, example, 'SS5') |
|
hanaOpt/destPseudoClientName |
The destination pseudo-client (in this, example, 'SS5_HANA') |
|
hanaOpt/destClientName |
The destination client name (in this example, 'hana_02') |
|
hanaOpt/backupPrefix |
The prefix of the backup job that you want to restore (in this example, 'PreFix_COMPLETE_DATA_BACKUP') |
|
hanaOpt/initializeLogArea |
'true' |
qoperation execute -af restore.xml -associations/appName 'SAP HANA' -associations/clientName 'SS5_HANA' -associations/instanceName 'SS5' -destClient/clientName 'hana02' -hanaOpt/destDbName 'SS5' -hanaOpt/destPseudoClientName 'SS5_HANA' -hanaOpt/destClientName 'hana02' -hanaOpt/backupPrefix 'PreFix_COMPLETE_DATA_BACKUP' -hanaOpt/initializeLogArea true
Restore to a Point-in-Time
To restore to a point-in-time, set the hanaOpt/pointInTime/timeValue parameter to the time that you want to restore to and specify a backup that ran prior to the specified time. Set the following elements:
|
Parameter |
Value |
|---|---|
|
associations/clientName |
The SAP HANA pseudo-client name (in this example, 'SS5_HANA'') |
|
associations/instanceName |
The SAP HANA instance name (in this example, 'SS5') |
|
destClient/clientName |
The SAP HANA client name (in this example, 'hana_02') |
|
hanaOpt/destDbName |
The destination database name (in this, example, 'SS5') |
|
hanaOpt/destPseudoClientName |
The destination pseudo-client (in this, example, 'SS5_HANA') |
|
hanaOpt/destClientName |
The destination client name (in this example, 'hana_02') |
|
hanaOpt/initializeLogArea |
'false' |
|
hanaOpt/pointInTime/timeValue |
The time that you want to restore to. In this example, '2015-12-09 14:20:00' . |
To a point-in-time
qoperation execute -af restore.xml associations/appName 'SAP HANA' -associations/clientName 'SS5_HANA' -associations/instanceName 'SS5' -destClient/clientName 'hana02' -hanaOpt/destDbName 'SS5' -hanaOpt/destPseudoClientName 'SS5_HANA' -hanaOpt/destClientName 'hana02' -hanaOpt/initializeLogArea false -hanaOpt/pointInTime/timeValue '2015-12-09 14:20:00'
Restore to the Most Recent State
To restore to the most recent backup, set the hanaOpt/pointInTime/timeValue parameter to the current time and specify a backup that ran prior to the current time. Set the following elements:
|
Parameter |
Value |
|---|---|
|
associations/clientName |
The SAP HANA pseudo-client name (in this example, 'SS5_HANA'') |
|
associations/instanceName |
The SAP HANA instance name (in this example, 'SS5') |
|
-destClient/clientName |
The SAP HANA client name (in this example, 'hana_02') |
|
hanaOpt/destDbName |
The destination database name (in this, example, 'SS5') |
|
hanaOpt/destPseudoClientName |
The destination pseudo-client (in this, example, 'SS5_HANA') |
|
hanaOpt/destClientName |
The destination client name (in this example, 'hana_02') |
|
hanaOpt/initializeLogArea |
'false' |
|
hanaOpt/pointInTime/timeValue |
Set the value to the current time. In this example, '2016-01-16 16:20:00'. |
qoperation execute -af restore.xml -associations/appName 'SAP HANA'-associations/clientName 'SS5_HANA' -associations/instanceName 'SS5' -destClient/clientName 'hana02' -hanaOpt/destDbName 'SS5' -hanaOpt/destPseudoClientName 'SS5_HANA' -hanaOpt/destClientName 'hana02' -hanaOpt/initializeLogArea false -hanaOpt/pointInTime/timeValue '2016-01-16 16:20:00'
Restore to New Destination
To restore to a new destination, set the hanaOpt/destClientName parameter, the hanaOpt/destPseudoClientName parameter and the hanaOpt/destClientName parameter to the new client.
Set the following elements:
|
Parameter |
Value |
|---|---|
|
associations/clientName |
The SAP HANA pseudo-client name (in this example, 'SRC_HANA'') |
|
associations/instanceName |
The SAP HANA instance name (in this example, 'SRC') |
|
destClient/clientName |
The SAP HANA client name (in this example, 'hana_09') |
|
hanaOpt/destDbName |
The destination database name (in this, example, 'DES') |
|
hanaOpt/destPseudoClientName |
The destination pseudo-client (in this, example, 'DES_HANA') |
|
hanaOpt/destClientName |
The destination client name (in this example, 'hana_09') |
|
associations/clientName |
The SAP HANA pseudo-client name (in this example, 'SS5_HANA'') |
|
hanaOpt/backupPrefix |
The prefix of the backup job that you want to restore (in this example, 'PreFix_COMPLETE_DATA_BACKUP') |
|
hanaOpt/initializeLogArea |
'true' |
qoperation execute -af restore.xml -associations/appName 'SAP HANA' -associations/clientName 'SRC_HANA' -associations/instanceName 'SRC' -destClient/clientName 'hana09' -hanaOpt/destDbName 'DES' -hanaOpt/destPseudoClientName 'DES_HANA' -hanaOpt/destClientName 'hana09' -hanaOpt/backupPrefix 'PreFix_COMPLETE_DATA_BACKUP' -hanaOpt/initializeLogArea true