Skip to Content
Technical Articles
Author's profile photo Rajarajeswari Kaliyaperuumal

HANA log segments and its states

LOG SEGMENT AND ITS STATES

If you are trying to understand the states of log segments in HANA, the below series will help you out. Before going deeper below are the basics to understand what a log segment in HANA is actually is.

1.What is a log segment ? To put in my own simple words, It has the record of the transactions that have been committed in memory and has reached the log volume file system  as  log segments and is yet to reach the data volumes which only happens after a save point .

If the log segments inside log volumes encounters a savepoint

  • Data from log segments gets transferred to data volumes after a log segment backup in case of log_mode=normal and enable_auto_log_backup=yes.
  • Data from log segment gets transferred to data volumes and will be overwritten in cyclic fashion without a log backup when log_mode=overwrite

After either one of the above ,The log segments turns to Free state and is available for re-use now.

Note: Log segments are different from log backups. To put in a different words, When the log segments encounters a savepoint the data it has gets transferred to data volumes .Whether the log segment should be backed up before overwriting or directly overwritten purely depends on the parameter log_mode =(normal / Overwrite)

2.What are the states of log segments in HANA ? We have 5 different states for log segment :Writing,Closed,Truncated,BackedUp,Free

You can find the same in 3 ways .

1.Via SQL:

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

2.Via Studio:

3.From OS level:

 

State Description
Writing Currently writing to this segment.
Closed Segment is closed by the writer.
Truncated Truncated, but not yet backed up. Backup will remove it.
BackedUp Segment is already backed up, but a savepoint has not yet been written. Therefore it needs to be kept for instance recovery.
Free

Segment is free for reuse.

 

Thanks for reading!
Like and leave a comment if it was useful!
Follow for more such posts! 🙂

Assigned tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Nice Blog !!

      A query indeed for the below point mentioned.

      "Data from log segments gets transferred to data volumes after a log segment backup"

      In general, the savepoint is triggered every 300 seconds and the automatic log backup are scheduled to run every 15 minutes in Production environment.

      So, if the data from the log segments are transferred to log volumes in a savepoint operation, your point above mentions that it is transferred post log segment backup. Can you please clarify?

      So ingenerally the data would move to data volumes every five minutes and what happens post-backup is my query.

      Regards,

      HANA Associate.