cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between backup_history_list and dbm.knl?

thomasschulz2
Participant
0 Kudos

Hello list,

is there a difference between the data, that I get via "dbmcli ... backup_history_list/backup_history_listnext" and the content of the file "dbm.knl"?

Sometimes it is easier to scan a simple text file with a shell or perl script than to execute the corresponding dbmcli commands with backup_history_list and backup_history_listnext.

Our version: 7.6.00.37 (linux)

Regards,

Thomas

Accepted Solutions (1)

Accepted Solutions (1)

lbreddemann
Active Contributor
0 Kudos

Hi Thomas,

nope, no difference. "backup_history_list" takes the information from the dbm.knl-file.

As the other log files the backup history is well documented too:

Displaying Configuration and Log Files

If your backup history grows too large, you can easily shorten it.

I've written a note about that:

1089402 - Kürzen der Backup-Historie für MaxDB/liveCache Ins

Just put in the note number into the search field in the upper right corner of the SDN and look for notes.

Basically the most convinient way to look at the backup history will be the usage of tools like DBMGUI or DB Studio

KR Lars

thomasschulz2
Participant
0 Kudos

Hi Lars,

thanks for your answer! I have read the documentation, but I want to get sure, that the information is synchronous.

Unfortunately I didn't get a result with the SDN search via note number. Is there a trick to find it?

Regards,

Thomas

thomasschulz2
Participant
0 Kudos

Hi Lars,

thanks for your answer! I have read the documentation, but I want to get sure, that the information is synchronous.

Unfortunately I didn't get a result with the SDN search via note number. Is there a trick to find it?

Regards,

Thomas

lbreddemann
Active Contributor
0 Kudos

Hi Thomas,

hmmm... I've no problem to get the note displayed via the SDB search.

Perhabs you need to have a S-User for it... sorry not sure about that.

But as it's no secret, I just post the note content:



Shortening backup history for MaxDB/liveCache instances
SAP Note Number: 1089402  
Symptom
When you use transactions DB50, LC10, DB14, the DBA Studio or DBMCLI to display the backup history in DBMGUI, the system requires a long time for this process.
The following or similar errors may occur:
(6: overflow) in DBMGUI


Other terms
Backup history, DBMGUI, DBMCLI, backup_history_list, /sapdb/data/wrk/<DBSID>


Reason and Prerequisites
The backup history of a database instance that is based on MaxDB (for example, liveCache, content server, SAP DB, oneDB and so on) is stored in the files dbm.knl and dbm.mdf in the im run directory (usually, /sapdb/data/wrk/<DBSID>).
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.


Solution

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 Windows):

1. Use the command line to navigate to the directory /sapdb/data/wrk/<DBSID>.

2. Make sure that currently NO backup or restore is running.
    To do this, you can use, for example, the command backup_state in DBMCLI:

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.

Caution: On Windows, the tail command is not included in the standard delivery.   However, there are several OpenSource implementations for 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. Then check whether you can use the backup history and whether all required backups are included in the history.
We recommend that you use DBMGUI/DBA Studio or the DBMCLI 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

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.

Best regards,

Lars

thomasschulz2
Participant
0 Kudos

Hi Lars,

thanks. A very interesting solution.

Regards,

Thomas

Answers (0)