HDBSQL Example: Performing SAP HANA Point-in-Time Restores

Use a point-in-time restore to revert the database to a state before an undesired transaction or before a point of failure.

Before You Begin

  1. Create the hbduserstore key.

  2. Log on to the database with the key.

  3. Perform a SAP HANA complete data backup.

Procedure

  • On the command line, type the following command substituting the time to restore to.

    HDBSettings.sh recoverSys.py --command="RECOVER DATABASE UNTIL TIMESTAMP '2019-06-27 11:08:00' CLEAR LOG CHECK ACCESS USING BACKINT " --wait  --timeout=600
    

Example

Restore the backup to '2014-9-17 12:13:0'
hana02:/usr/sap/TRD> HDBSettings.sh recoverSys.py --command="RECOVER DATABASE UNTIL TIMESTAMP '2014-9-17 12:13:0' CLEAR LOG CHECK ACCESS USING BACKINT " –wait --timeout=600
 [139929618892544, 0.002] >> starting recoverSys (at Wed Sep 17 12:14:55 2014)
 [139929618892544, 0.002] args: ('\xe2\x80\x93wait',)
 [139929618892544, 0.002] keys: {'command': "RECOVER DATABASE UNTIL TIMESTAMP '2014-9-17 12:13:0' CLEAR LOG CHECK ACCESS USING BACKINT ", 'timeout': '600'}
 own pid: 536
 recoverSys started: 2014-09-17 12:14:55
 testing master: hana02
 hana02 is master
 shutdown database, timeout is 600
 stop system
 stop system: hana02
 stopping system: 2014-09-17 12:14:55
 stopped system: 2014-09-17 12:16:45
 creating file recoverInstance.sql
 restart database
 restart master nameserver: 2014-09-17 12:17:00
 start system: hana02
 2014-09-17T12:18:41+00:00 P001948 148838b6473 INFO RECOVERY state of service: nameserver, hana02:30201, volume: 1, RecoveryExecuteTopologyAndSSFSRecoveryFinished
 recoverSys finished successfully: 2014-09-17 12:18:43
 [139929618892544, 228.467] 0
 [139929618892544, 228.467] << ending recoverSys, rc = 0 (RC_TEST_OK), after 228.465 secs
×

Loading...