Skip to Content
Author's profile photo Naveen Kumar

Size of log backup, complete data backup in HANA

I have browsed this information and could not find answers, Hence thought to share.

Basic information:

Backup performed for

Data

The data volume contains the data from the last completed Savepoint.

Log

The log volume contains all changes on the data volume since the last completed savepoint.

Each log volume contains the file logsegment_<partition_ID>_directory.dat and one or more log segment files (logsegment_<partition_ID>_<segment_number>.dat).

Currently only one log partition is supported for each Service, so the default file names are:

  • logsegment_000_directory.dat
  • and logsegment_000_00000000.dat, logsegment_000_00000001.dat, logsegment_000_00000002.dat
  • and so on.

Log segment files are cyclically overwritten depending on the log mode. The log mode determines how logs are backed up. Log volumes only grow if there are no more segment files available for overwriting.

 

Log Backup happens every hour every day to make some space available for more logs to generate so that Database continues to work. Current size of logs can be found in

Problem Description: Find out the log size that has taken place in 1 day or week or 1 month.

Idea: There is no direct table, query or report available , up to my knowledge, to find out this information. All we know was the that M_BACKUP_CATALOG table contains the information of logs.

Also M_BACKUP_CATALOG_FILES table can give you Backup_size details.

Solution: 

Combine the properties of both tables M_BACKUP_CATALOG_FILES and M_BACKUP_CATALOG and perform a join and then sum on BACKUP_SIZE to find out the log size let’s say for a day:

Change the dates, etc as per your need.

SELECT SUM(B.BACKUP_SIZE) FROM M_BACKUP_CATALOG A JOIN M_BACKUP_CATALOG_FILES B ON A.BACKUP_ID=B.BACKUP_ID WHERE A.ENTRY_TYPE_NAME=’log backup’ AND UTC_END_TIME BETWEEN ‘31.08.2017 00:00:00’ and ‘31.08.2017 23:00:00’

Similarly you can find ‘complete data backup’

 

Hope this information helps to find out the logsize and complete data backup for a day or month or week.

 

 

 

Assigned Tags

      3 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Nicholas Chang
      Nicholas Chang

      Hi Naveen,

      Just fyi, this data and log backup size can easily captured using script HANA_Backups_BackupRuns attached on note 1969700.

      Cheers,
      Nicholas Chang

      Author's profile photo Naveen Kumar
      Naveen Kumar
      Blog Post Author

      Hello Nicholas,

       

      Thanks for the information. I did not find the script attached to mentioned #note.

      Author's profile photo Pavan Kumar
      Pavan Kumar

      Hi Naveen,

      Can you Please let me know in which table the DB logs are stored in S4Hana ?

      How can we schedule job to extract data from table for monthly audit ?

      Regards,

      Pavan kumar.