Skip to main content

SAP BASIS tips how to deal with SAP HANA log full situation DiskFullEvent on Log Volume

You observe that the log volume has reached its capacity, causing the database to reject any new incoming requests.And the SAP ERP system or S/4 HANA system is hanging.

To determine whether the operating system path is full, you can use commands such as df -h or bdf to check the disk space usage.👀

Reason:

Due to an architectural limitation, SAP HANA cannot perform a log backup when the log area is completely full, leading to potential system unresponsiveness or failure to start.

Affected Releases:

  • SAP HANA 1: All revisions.

  • SAP HANA 2: Revisions from SPS00 to SPS05.

Prerequisites:

  • The log volume is full, causing the database to become unresponsive or fail to start.

Solution:

Upgrade to one of the following SAP HANA revisions:

  • SAP HANA 2: Revisions >= 060.00 (SPS06) or higher.

Workaround:

If upgrading is not immediately possible, follow these steps to resolve the issue:

  1. Log in as <SID>adm User:
    Ensure you are logged in as the <SID>adm user on the host experiencing the log volume full issue.

  2. Stop the Database:
    Execute the following command to stop the database:

    bash
    /usr/sap/hostctrl/exe/sapcontrol -nr <instance_number> -function StopSystem HDB

    Wait until the database on all hosts is completely stopped.

  3. Navigate to the Log Volume Directory:
    Change to the mnt00001 directory of the log volume (default path: /hana/log/<SID>/):

    bash

    cd /hana/log/<SID>/mnt00001
  4. Free Up Space in the Log Volume:

    • Identify a log volume consuming at least 2 GB of space using:

      bash

      du -sh *
    • Move the identified log volume (e.g., hdb00003) to a location with sufficient space, such as the data volume (default: /hana/data/<SID>):

      bash

      mkdir /hana/data/<SID>/logs_temporary
      mv hdb00003 /hana/data/<SID>/logs_temporary
  5. Create a Symbolic Link:
    Create a symbolic link to the moved log volume in its original location:

    bash

    ln -s /hana/data/<SID>/logs_temporary/hdb00003 /hana/log/<SID>/mnt00001/hdb00003
  6. Start the Database:
    Start the database using:

    bash

    /usr/sap/hostctrl/exe/sapcontrol -nr <instance_number> -function StartSystem HDB

    Wait for log backups to complete.

  7. Reclaim Log Space:
    Execute the following SQL statement on both the SYSTEMDB and tenant level to clean up the log volume:

    sql

    ALTER SYSTEM RECLAIM LOG;
  8. Stop the Database Again:
    Stop the database once more:

    bash

    /usr/sap/hostctrl/exe/sapcontrol -nr <instance_number> -function StopSystem HDB

    Ensure the database is fully stopped on all hosts.

  9. Remove the Symbolic Link and Restore the Log Volume:

    • Remove the symbolic link:

      bash

      rm -f /hana/log/<SID>/mnt00001/hdb00003
    • Move the log volume back to its original location:

      bash

      mv /hana/data/<SID>/logs_temporary/hdb00003 /hana/log/<SID>/mnt00001
    • Delete the temporary log folder:

      bash

      rmdir /hana/data/<SID>/logs_temporary
  10. Restart the Database:
    Start the database again:

    bash

    /usr/sap/hostctrl/exe/sapcontrol -nr <instance_number> -function StartSystem HDB

Summary:

This workaround temporarily frees up space in the log volume by relocating a portion of it, allowing the database to start and perform log backups. After reclaiming log space, the log volume is restored to its original state. However, upgrading to SAP HANA 2 SPS06 or higher is the recommended long-term solution to avoid this issue.

Comments