SAP HANA Database Tips
Everything about SAP HANA Database at one place!
/hana/log is 100% full in Sap Hana
BY HANA BLOGGER
Many of us would have came across this situation of /hana/log is 100% full & your system is not able to come up. If you’re facing this issue on non-production system then you will have some breather but if production then it will be required to resolve immediately and it has risk a ached to it.
1. Go to /hana/log/SID/mnt00001 and take screenshot of sizes ofcurrent directories. You can use du -sk [I will recommend this] or du -sh command for this.
2. Arrange some other location to move files from /hana/log/SID/mnt0001. Consider /hana/data/logs_temporary is the location where you can move directory to make space in /hana/log mount.
3. If database is not stopped already then stop it with commandsapcontrol -nr <instance_number> -function StopSystem HDB or HDB stop
4. Now you need to move directory from /hana/log/SID/mnt0001 to/hana/data/logs_temporary with at least 2 GB in size. Be very cautious here and perform this operation without any interruption & damaging the file being move.
5. Compare the file size at location /hana/data/logs_temporary with sizes captured in step 1. It should be exact match.
6. Create symbolic soft link with command “ln -s /hana/data/<SID>
/logs_temporary/hdb00003 /hana/log/<SID>/mnt00001/hdb00003“
7. Start the database with command sapcontrol -nr <instance_number> -function StartSystem HDB or HDB start
8. After starting the database, make sure that log backups arehappening successfully.
9. Using SQL console or HDBSQL, run the ALTER SYSTEM RECLAIM LOG; which will free up log segments from /hana/log
10. Once backups are finished and /hana/log utilization is normal revertthe above changes. So stop the database again [check step 3 for commands]
11. Take the backup of directory present in /hana/data/<SID> /logs_temporary/. This is to avoid any issues arising during movement of file to /hana/log/<SID>/mnt00001/hdb00003. It is be er to record the size of this file in destination.
12. Remove the symbolic soft links using command rm -f /hana/log
/<SID>/mnt00001/hdb00003
13. Move the directory back in /hana/log/<SID>/mnt00001/ and make sure to validate the size before and after movement. It should be exact match.
14. Start
the database [check step 7 for commands]
2 thoughts on “/hana/log is 100% full in Sap Hana”
1. Saurabh Nice document.
My query is if I move some old log files from hana/log/ to other locations instead of doing all the above steps mentioned in doc. To avoid hana downtime. Is it correct?
JULY 26, 2021 AT 2:11 PM REPLY
Hana Blogger
It is not allowed to move any log segments out of /hana/log separately as your DB will go down and won’t come up until these files are placed again back to /hana/log. There are huge number of files, hence it is preferable to move one folder outside and create softlink. DB downtime will occur once /hana/log is full. There are some ways to avoid it but in those methods also, we didn’t touch anything inside /hana/log.