Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 

How to reclaim or shrink the log volume size of HANA DB in /hana/log storage.



Introduction -


Whenever we notice, that the HANA database does not accept any of the new requests to perform it is confirm that the log volume is full for that database. In such cases we need to truncate or shrink or reclaim the unused space on log volume for HANA db. This procedure is explained thoroughly in this blog.

 

Main Part -


Process of reclaiming the HANA log file system

  • We have observed that the /hana/log volume size is full in our linux server as shown in the image below.




Here, in this screen it is clear that the volume size for /hana/log is 100% full, due to which we are not allowed to perform any tasks on this particular database.

  •  Now login to OS level and try stopping the application's running in this database.




use command "sapcontrol -nr $$ -function StopSystem" for stopping the application where $$ indicates the unique instance number on which the application is installed.



After stopping all the instances running on the multi-tenant database.

  • Connect to the Database through HANA Studio and run following command.


"ALTER SYSTEM RECLAIM LOG;"



  • After successful execution of this command check for the volume size for /hana/log




Now it is clear from the screen that the volume size for /hana/log is good - used 21% only.

Conclusion -


By this way we can reclaim the unused amount of log volume in HANA DB. It is better to perform this kind of activity at-least once in every month or depends on the usage and growth of log size.

 

Reference -


2083715 - Analyzing log volume full situations
1679938 – Disk Full Event on Log Volume
15 Comments
former_member548204
Participant
i have one question here, after stopping the HANA, how will you connect Sql console in HANA DB?
0 Kudos
I have the same question
saipp
Explorer
I belive Sai Kumar had only stopped sap application servers but not the HANA DB. HANA DB has to up and running inorder to shrink Disk volumes.
hummel_christian
Explorer
0 Kudos
And how to start HANA when it does not start because of log full?
former_member382183
Discoverer
when log volume is 100% full, it is a hung situation. DB will not allow any connections. So alter system reclaim log will not work.

To fix the log volume full situation

  1. stop the database

  2. move few of the log segments to new location and create the soft link

  3. start the database

  4. check the status of the log segments.

  5. select status from m_log_segments.

  6. if the status of the log segments is 'free'  then execute 'alter system reclaim log'  to clear the space. i.e alter system reclaim log works only if the status of the log segment is ' free'

  7. if the status is not free, then check the log backups if they are working fine.


 
0 Kudos

Sorry for delayed response, thank you for your response. Here we are turning off SAP Application but not HANA DB.

0 Kudos
Thank you Sai for your comments, yes you are correct.
0 Kudos
Hi Ravi,

Is that possible to move to log segments to different location?
srinivaas
Participant
0 Kudos
Yes, its possible buddy, you have to create the soft link.

Srinu Thutta
0 Kudos
Hello

 

thanks for detailed explanation.

 

Incase of HA/DR  when replication is active.. How to run reclaim ccommand?

Do we need to break the replication and run the command ?

 

kindly advise

 

thanks

Madhur
sankar_27
Active Participant
0 Kudos
1679938 - DiskFullEvent on Log Volume
former_member331573
Discoverer
0 Kudos
thak you  very mucho from Argentina and Venezuela.
autotexindia
Discoverer
0 Kudos
Hi All,

Its clear to do in hana studio, But I have do in OS by linux command,

Can anyone help me to do...

Thanks & regards

M Ragul
sai-ram
Explorer
0 Kudos
Hello,

Connect the system DB in OS using command

su - sidadm

hdbsql -i <instance no> -d SystemDB -u SYSTEM -p <password>

and then

ALTER SYSTEM RECLAIM LOG;

go

 
0 Kudos
Is there a way to check from application side that my application can result in max utilization of the log volume ? If I can know beforehand, then my application can avoid such situation
Labels in this area