SAP Hana Log volume Full –Popular1

By kssaplearning

Updated on:

Follow Us
Hana log volume full

SAP Hana Log volume Full

HANA log Volume Full

Issue:

Hana Database not accepting the any new request. We have observed the SAP Hana Log volume Full or Hana log volume has reached Maximum size. In This Blog, we have explained the temporary work around for SAP Hana Log volume full issue. Once issue is resolved then need to perform the Root cause Analysis for further process. If SAP HANA Log full situation has happed then don’t delete the logs files in operation system level. If log files has been deleted this will be corrupt the database.

Hana log volume full
SAP Hana log volume full situation we can performed the 2 steps.
Steps1:

1.  Increase the /hana/log directory space in OS level.
      1. Using lvextend –L Command we can extend the size in OS level.
       Example:
                 Lvextend –L +10G <FILE SYSTEM partitions>
                 Resize2fs <FILE SYSTEM Partitions>
2.  perform the root cause analysis.

Steps2:
• We can perform the temporary work around in OS level.
• Perform the root cause analysis for resolve the issue permanently

Temporary Workaround for SAP HANA log volume full situation:

1. Login to the Hana database server check the Hana/log volume size.
      Command: du –sh |grep Hana
      We have identified the size of the Hana directories.
         /hana/Log/
         /hana/Data/
         /hana/shared/
2. Stop the sap application.
    Command: sap sidadm
       >su – sidadm
       >/usr/sap/hostctrl/exe/sapcontrol -nr <instance_number> -function StopSystem
3. Login to the Database through db SIDADM or sap SIDADM and stop Hana database.
       HDB STOP:
      * DB sidadm
      * su – sidadm
      * HDB stop
           OR
      * su – sidadm
      * sapcontrol -nr <instance_number> -function StopSystem HDB
4.  Once Application and DB has been stopped then we will follow the below steps.
5.  Check the Hana Log volume directories and size.
            Location:
            * /hana/log/SID/mnt0001/hdb0000*
            *  Need to identify the hdb0000* files size.
 6.  Now need to move Hana Log files temporary to another location.
 7.  Create the temporary log file directory on OS LEVEL and apply the db owner ship.
         Mkdir /hana/data/log_temp
 8.  At least we need to move 3GB data hana log files from old location to temporary location for start the                  database.
        Old hana log location:
            *    /hana/log/SID/mnt0001/hdb0000*
       Temporary hana log location:
              /hana/data/log_temp
  9.  Move the files to temp hana log location.
            *   cd /hana/log/SID/mnt0001/
            *    ls –l
            *    du –sh
             50GB hdb00001
                2GB hdb00002
                1GB hdb00003
           *    At least we need to 3GB files or directory to temp location.
           *   cd /hana/log/SID/mnt0001/
           *   mv hdb00002 /hana/data/<SID>/logs_temp.
           *  du -sh
10.  Create the symbolic link to the temporary folder in old location.
             Goto old location
             cd /hana/log/SID/mnt0001/hdb00002
            *   ln -s /hana/data/<SID>/logs_temp/hdb00002 /hana/log/<SID>/mnt00001/hdb00002
11.  Start the database.
            HDB START:
            *  su – sidadm
            *  HDB stop
                  OR
            *  su – sidadm
            *  sapcontrol -nr <instance_number> -function StopSystem HDB
 12.  Wait some time for log backups are performed or please start the Log Backup.
 13. Using the below sql statement clean the log volume on systemdb and tenant db.
              Command:
             1. ALTER SYSTEM RECLAIM LOG;
 14.  Stop the database for further process.
 15.  Remove the symbolic link in original folder.
         rm -f /hana/log/<SID>/mnt00001/hdb00002
 16.  Move the hana logs files from temporary files to Hana original file system.
          Command:
          *   mv /hana/data/<SID>/logs_temp/hdb00002 /hana/log/<SID>/mnt00001
 17.  Remove the temporary log folder.
          *   rm –rf /hana/data/<SID>/logs_temp
 18.  Start the Hana Database.
            HDB START:
            * su – sidadm
            * HDB stop
                 OR
            * su – sidadm
            sapcontrol -nr <instance_number> -function StopSystem HDB
 19.  Check current space for Hana log volume. we need to perform the Root cause analysis for resolve the sap           hana log volume full situation permanently .
 20.  Start the sap application.
 21.  Perform the Health checks.
Why Hana Log volume full situation has happened:

• Log Backup has failed.
• When hana maximum number of the log segment has reached the log writing is blocked. Default log                  segment is 10240.
• Hana log File system has reached the maximum size.

Hana log segment state:

• When hana log full situation has happened, we need to understand the current log segment state.
• Need to execute the sql statement and check the current hana log segment state.
• Command:
select b.host, b.service_name, a.state, count(*) from “PUBLIC”.”M_LOG_SEGMENTS” a join “PUBLIC”.”M_SERVICES” b on (a.host = b.host AND a.port = b.port) group by b.host, b.service_name, a.state;
• There are many state is there base on situation. Example: writing, truncated , free and others. Please check         more details in Root cause analysis blog for further process.

Root Cause Analysis:

Once temporary work around has been completed for Hana log full situation and Hana DB is working fine. But we need to Analysis the check Log full situation for Root cause Analysis. Because permanent work around is required for avoid the issue again.
• /hana/log log volume growth has increased very fast.                                                                                     

Pleas check below Blog for Hana log full situation.
Analyzing log volume full situations

Hana log volume full

Conclusions:
In this Blog we have explained the hana log situation issue. How to performed the work around tasks in os level and root cause analysis for resolve the issue permanently .

Related Posts:

FAQ for SAP Hana log full situations:

How to check hana log segment state?

When hana log full situation has happened, we need to understand the current log segment state.
Need to execute the sql statement and check the current hana log segment state.
Command:
select b.host, b.service_name, a.state, count(*) from "PUBLIC"."M_LOG_SEGMENTS" a join "PUBLIC"."M_SERVICES" b on (a.host = b.host AND a.port = b.port) group by b.host, b.service_name, a.state;

How to reclaim the Hana log volume?

Using the below sql statement clean the log volume on systemdb and tenant db.
Command: ALTER SYSTEM RECLAIM LOG;
If issue not resolved then we need to perform the temporary workaround in Hana Database.

 

 

 

 

 

 

2 thoughts on “SAP Hana Log volume Full –Popular1”

Leave a Comment