Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

This section should help you to shorten the backup history of SAP MaxDB/liveCache databases manually as there is not yet a automatic feature for this.
This article has been created based on SAP note 1089402 Shortening Backup History for SAP MaxDB.


When you use transactions DBACOCKPIT, DB50, LC10, DB14, the Database Studio or Database Manager CLI (DBMCLI) to display the backup history, the system requires a long time for this process or the following or similar errors may occur:  (6: overflow)

Reason and Prerequisites

The backup history of a database that is based on SAP MaxDB (for example, SAP liveCache, SAP Content Server, OneDB and so on) is stored in the files dbm.knl and dbm.mdf in the im run directory (usually, /sapdb/data/wrk/<SID>).
These files are always enhanced at the file end so that the files get larger as the number of backup operations or restore operations increases.
Since the files include the information even of backups that are no longer significant (for example, because the backup medium has been overwritten in the backup cycle in the meantime), the backup history contains an increasing amount of insignificant data.


The data of the backup history is stored line by line in the files dbm.knl and dbm.mdf. The oldest entries are displayed at the beginning of the file; the newest entries are displayed at the end of the file.
Therefore, to reduce the backup history size, you can delete the first lines without losing important data for the database recovery.

To do this, proceed as follows (this example uses the Unix notation. However, the method described here also applies to systems that are based on Microsoft Windows):

1. Use the command line to navigate to the directory /sapdb/data/wrk/<SID>.
2. Make sure that currently NO backup or restore is running.

To do this, you can use, for example, the DBM command backup_state.

3. Create backup copies of the current backup history files:

cp dbm.knl dbm.knl_orig
cp dbm.mdf dbm.mdf_orig

4. Create a shortened version of the backup history files:

tail -n 100 dbm.knl > dbm.knl_short
tail -n 100 dbm.mdf > dbm.mdf_short

Due to this command, the system writes only the last 100 backup history entries that you have saved to the target file.

(warning)  Caution: On Microsoft Windows, the tail command is not included in the standard delivery. 
However, there are several OpenSource implementations for Microsoft Windows that work in the same way.
Do not edit the files in an editor because this may result in file corruption. 

5. Rename the original files:

mv dbm.knl dbm.knl_large
mv dbm.mdf dbm.mdf_large

Then the original files can no longer be accessed from the database. 

6. Rename the shortened file versions:

mv dbm.knl_short dbm.knl
mv dbm.mdf_short dbm.mdf

Subsequently, the shortened versions are used.

7. Now check whether you can use the backup history and whether all required backups are included in the history.

We recommend that you use Database Studio or the DBM commands backup_history_open and backup_history_list to do this.  

8. If no problems occur when accessing the shortened file versions, you can delete the two copy records of the original files from the run directory.

rm dbm.knl_orig
rm dbm.mdf_orig
rm dbm.knl_large
rm dbm.mdf_large

(warning)  Caution: You are responsible for checking whether the shortened files cause any problems and still contain all the required backup information.  Delete the copies of the original file only after you make sure that no problems occur.

back to top

Relevant SAP Notes

1089402 Shortening Backup History for SAP MaxDB 

  • No labels