Technical Articles
Playing around with Log segment states of log volumes in HANA
LOG SEGMENT LIFECYCLE IN HANA LOG VOLUMES:
Changes in HANA memory before reaching from memory to data volumes via savepoint, gets flushed to log volumes as log segments. As soon as a savepoint is reached, and if the log segments are already backed up , the log segments state change to FREE state and available for reuse.
Below is a simple depiction of log segment state lifecycle.
For more information on finding the states of log segments refer below link:
https://blogs.sap.com/2020/09/13/hana-log-segments-and-its-states/
1.How to free up log segments with state “Free” .
Here there are 8 Free segments which are ready to be released to OS for reuse.
SQL:
Now lets recheck the count of Free segment.
The Count has reduced from 8 to 1 now. & log segments got released to OS.
2.Now Lets change status BackedUp to Free by manually triggering SAVEPOINT via SQL
After the savepoint the log segments gets transferred to Data volume in file system persistence. Hence
No log segment in BackedUp state now as their state now got changed to Free
3.Log segments which are yet to be BackedUp will be in Truncated if the backup medium is not fast enough to backup the log segment.
4.When log segments is actually getting written by the data from memory its state will be “Writing”
5.After the log segment reaches the below specified value for log_segment_size_mb or when ever a commit is done in any transaction , that particular log segments gets closed and will be waiting to be BackedUp after a savepoint
Thanks for reading!
Like and leave a comment if it was useful!
Follow for more such posts! 🙂
Hi Rajarajeswari,
Very well explained !
Good information, thanks for sharing.
Regards
Sushil
This is wrong truncated should come after Bakcup
No you are wrong.Truncated is log segment state and you can see many log segments in truncated state if log backups are not working properly and it turns to free once backed up.
Extract from sap " Truncated, but not yet backed up. Backup will remove it." .