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.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 -
Once 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, '43201_SNAP') |
|
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 '43201_SNAP' -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_template.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'
Revert Restore
To perform a revert, set the hanaOpt/useHardwareRevert parameter to 'true' and 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, '129992_SNAP') |
|
hanaOpt/initializeLogArea |
'false' |
|
hanaOpt/useHardwareRevert |
'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 '129992_SNAP' -hanaOpt/initializeLogArea true -hanaOpt/useHardwareRevert true
Restore from a Backup Copy to the Same Destination
To restore from a copy you must set the browseOption/mediaOption/copyPrecedence/copyPrecedence parameter to the copy precedence number of the backup copy that you want to restore.
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, '43201_SNAP') |
|
hanaOpt/initializeLogArea |
'true' |
|
browseOption/mediaOption/copyPrecedence/copyPrecedence |
The copy precedence. In this example, '2'. |
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 '43201_SNAP' -hanaOpt/initializeLogArea true -browseOption/mediaOption/copyPrecedence/copyPrecedence 2