In this article we will explain how to clean /hana/log in secondary site. Remember that we can’t delete any files manually under /hana/log/ folder.
If this issue happen on the primary database, you should clean /hana/log/ using query “ALTER SYSTEM RECLAIM LOG“, but as you might be aware, you can’t connect to HDBSQL or run SQL command in secondary database.
The first thing that we are going to check is the number of free log segments with status FREE under /hana/log/SID/mnt*
sidadm@host:/hana/log/SID/mnt00001> hdblogdiag seglist /hana/log/SID/mnt00001/hdb00001 | grep -i Free | wc -l
437
sidadm@host:/hana/log/SID/mnt00001> hdblogdiag seglist /hana/log/SID/mnt00001/hdb00002.00003 | grep -i Free | wc -l
438
Let’s check which log volume has consumed higher disk space
sidadm@host:/hana/log/SID/mnt00001/hdb00001> du -sh /hana/log/SID/mnt00001/*
28G /hana/log/SID/mnt00001/hdb00001
441G /hana/log/SID/mnt00001/hdb00002.00003
As you can see, /hana/log/SID/mnt00001/hdb00002.00003 has consumed 441Gb. So let’s focus on this volume.
To identify which is the service used by this volume I am going to use the below command:
sidadm@host:/hana/log/SID/mnt00001/hdb00001> ps -ef | grep hdb
...
--port 30040 --volume 2 --volumesuffix mnt00001/hdb00002.00003 --identifier 1661300477
...
I can see it’s using port 30040 for mnt00001/hdb00002.00003.
30040 is the port used by the hdbindexserver (you can check with “HDB info” command or in HANA Studio).
If you see higher count in hdbindexserver volume, run the corresponding log release command: hdbcons ‘log release’

After executing the command, I checked again and we can see we only have 1 log segments with status FREE.
sidadm@host:/usr/sap/sid/HDB00> hdblogdiag seglist /hana/log/SID/mnt00001/hdb00002.00003 | grep -i Free | wc -l
1
Also, if you validate using command df -h, you will see the memory under /hana/log/ was free up.
Reference:
- 2821539 – Volume /hana/log is full with log segments in status RetainedFree
- 2409471 – SAP HANA Log Volume Full on Secondary or Tertiary Site with System Replication
- 2083715 – Analyzing log volume full situations
- https://blogs.sap.com/2020/09/13/hana-log-segments-and-its-states/
- https://help.sap.com/docs/SAP_HANA_PLATFORM/bed8c14f9f024763b0777aa72b5436f6/d04835a010d3485c87992619dce89e2d.html?version=1.0.12