Step 3. Force Recovery from the Command line of the SystemDB

SAP

Audience
Public
Product
FlashBlade
FlashArray
FlashStack
FlashBlade > Purity//FB
FlashArray > Purity//FA
Technology Integrations
SAP
Source Type
Documentation

In the event of no SAP HANA administration tools being available SAP provides a python script called "recoverSys.py" which can be used to force system recovery. It is triggered using the "HDBSettings.sh" shell script.

Note:

The recoverSys.py and HDBSettings.sh scripts can only be executed by the <sid>adm user.

When logged in as the <sid>adm user execute the following (do this on the master_nameserver for Scale Out landscapes):


/usr/sap/<SID>/HDB<Instance Number>/HDBSettings.sh /usr/sap/<SID>/HDB<Iinstance number>/exe/python_support/recoverSys.py --command="RECOVER DATA USING SNAPSHOT CLEAR LOG"

Scale Up Example and output:


/usr/sap/SH1/HDB00/HDBSettings.sh /usr/sap/SH1/HDB00/exe/python_support/recoverSys.py --command "RECOVER DATA USING SNAPSHOT CLEAR LOG"
[139672890110912, 0.001] >> starting recoverSys (at Tue Jul  7 07:18:52 2020)
[139672890110912, 0.001] args: ()
[139672890110912, 0.001] keys: {'command': 'RECOVER DATA USING SNAPSHOT CLEAR LOG'}
using logfile /usr/sap/SH1/HDB00/hannah/trace/backup.log
recoverSys started: ============2020-07-07 07:18:52 ============
testing master: hannah
hannah is master
shutdown database, timeout is 120
stop system
stop system on: hannah
stopping system: 2020-07-07 07:18:52
stopped system: 2020-07-07 07:18:52
creating file recoverInstance.sql
restart database
restart master nameserver: 2020-07-07 07:18:57
start system: hannah
sapcontrol parameter: ['-function', 'Start']
sapcontrol returned successfully:
2020-07-07T07:19:20-07:00  P0100598      17329a4f28e INFO    RECOVERY RECOVER DATA finished successfully
recoverSys finished successfully: 2020-07-07 07:19:21
[139672890110912, 29.380] 0
[139672890110912, 29.380] << ending recoverSys, rc = 0 (RC_TEST_OK), after 29.379 secs


Scale Out Example and output:


sh1adm@SHN1:/usr/sap/SH1/HDB00> /usr/sap/SH1/HDB00/HDBSettings.sh /usr/sap/SH1/HDB00/exe/python_support/recoverSys.py --command "RECOVER DATA USING SNAPSHOT CLEAR LOG"
[140479352415168, 0.002] >> starting recoverSys (at Tue Jul 7 08:39:36 2020)
[140479352415168, 0.002] args: ()
[140479352415168, 0.002] keys: {'command': 'RECOVER DATA USING SNAPSHOT CLEAR LOG'}
using logfile /usr/sap/SH1/HDB00/shn1/trace/backup.log
recoverSys started: ============2020-07-07 08:39:36 ============
testing master: shn1
shn1 is master
shutdown database, timeout is 120
stop system
stop system on: shn1
stop system on: shn4
stop system on: shn2
stop system on: shn3
stopping system: 2020-07-07 08:39:37
stopped system: 2020-07-07 08:39:41
creating file recoverInstance.sql
restart database
restart master nameserver: 2020-07-07 08:39:46
start system: shn1
sapcontrol parameter: ['-function', 'Start']
sapcontrol returned successfully:
2020-07-07T08:40:55-07:00 P0044462 17329ef9b2d INFO RECOVERY RECOVER DATA finished successfully
starting: 2020-07-07 08:40:55
start system: shn4
start system: shn2
start system: shn3
recoverSys finished successfully: 2020-07-07 08:40:57
[140479352415168, 80.634] 0
[140479352415168, 80.634] << ending recoverSys, rc = 0 (RC_TEST_OK), after 80.632 secs​​​​