HANA stopped unexpectedly due to the accidental deletion of shared memory lock
Symptom
One of my friend faces a strange problem regarding to the unpacked stop of HANA server after cleaning some files under /tmp directory.
After manual starting the system, HANA will run normal again (version: SPS 09 Rev.95).
In nameserver_hosta….trc, the following error is shown:
[79877]{-1}[-1/-1] 2016-02-24 01:15:07.912168 f NameServer
TREXNameServer.cpp(03342) : shared memory lock
‘/tmp/.hdb_ABC_30_lock’was deleted -> stopping instance ...
[79877]{-1}[-1/-1] 2016-02-24 01:15:10.655484 i Service_Shutdown
transmgmt.cc(06027) : Preparing for TransactionManager shutdown
Analysis
File /tmp/.hdb_<SID>_<instance number>_lock is used by HANA as a shared memory lock. If the file is deleted by chance, the database cannot manage the access of shared memory segment anymore and therefore has to stop accordingly.
For more detailed information, please refer to 1984700 – HANA stopped unexpectedly
If you are using RedHat Enterprise Linux, please take care of tmpwatch which delete files order than sometime.
For HANA <= 09, the shared memory lock file is /tmp/.hdb_<sid>_<inst_id>_lock
For HANA >= 10, the shared memory lock file is /var/lib/hdb/<sid>/.hdb_<sid>_<inst_id>_lock
(1999998 – FAQ: SAP HANA Lock Analysis)
Solution
DO NOT delete shared memory lock file.
If you are running RedHat, please remove tmpwatch from the system’s cron job。
Hope the blog can help you fix the same kind of problem you face. Thanks to Chiwo Lee for experience sharing.
Regards,
Ning
Hi,
if your friend was properly reading RHEL configuration guide for HANA, especially section with important notes, he would not faced this issue 😉
Br, Jan
Is there any parameter that can be used to change the location of lock file in SLES ?
Sorry, currently, I do not find the related document to change this location.