SAP HANA – cleaning log volume on secondary site system replication

Sometimes HANA log volume can be full due to various reasons… Below, You’ll find short instruction on checking and cleaning volume on secondary site system replication.

Solution

  1. Verify on OS volume with logs, for example /hana/log
server> df -h |grep -i log
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vgHANA-lv--log 1.5T 429G 1.1T 28% /hana/log

2. Check log segment status. We are most interested in those with FREE status:

server>/usr/sap/SID/HDBXX> hdblogdiag seglist /hana/log/SID/mnt00001/hdb00003 | grep -i '\bFree\b' | wc -l
403
server>

We have 403 logs with this status...

-- If You need check other statues use this commands:
hdblogdiag seglist /hana/log/SID/mnt00001/hdb00003 | grep -i Truncated | wc -l
hdblogdiag seglist /hana/log/SID/mnt00001/hdb00003 | grep -i Writing | wc -l
hdblogdiag seglist /hana/log/SID/mnt00001/hdb00003 | grep -i RetainedFree | wc -l

3. To release logs with status FREE use the command hdbcons ‘log release’ but:

1. Find the PID of the service hdbnameserver
server>ps -ef |grep hdbnameserver

2. Connect to this service
server>/usr/sap/SID/HDBXX> hdbcons -p 28738

3. Release the log segments
Executable: hdbnameserver (PID: 28738)
Service: nameserver@server:3XX01 (DB#1: SYSTEMDB)
[OK]--
> log release
# Start command at: 2024-07-14 17:28:37.009
Released 403 segments
[OK]## Finish command at: 2024-07-14 17:28:37.025 command took: 15.576 msec
--
> exit
[EXIT]--
[BYE]server>

3.1 Directly calling server>/usr/sap/SID/HDBXX> hdbcons 'log release' command should also work.

4. Verify log segment and volume:
server>/usr/sap/SID/HDBXX> hdblogdiag seglist /hana/log/SID/mnt00001/hdb00003 | grep -i '\bFree\b' | wc -l
0
server>/usr/sap/SID/HDBXX> df -h |grep /hana/log
/dev/mapper/vgHANA-lv--log 1.5T 30G 1.5T 2% /hana/log

 

Copyright © 2024. SAPBasisWorld.com Privacy Policy