195157 - Application log: Deletion of logs

https://community.sap.com/t5/technology-q-a/slg2-baldat/qaq-p/10589717

Symptom

At least one of the database tables of the application log contains too many entries.

The following are database tables of the application log:

- BALHDR

- BALDAT

- BAL_INDX


Other Terms

SLG2


SLGD (SLG1)

Application log

Logs

Delete, deletion

Appl. log

App log

Performance


Reason and Prerequisites

The application log is a tool for writing, saving, and displaying logs. Many different applications write messages containing information for end users in the application log. The application log is for the temporary storage of messages. The logs are written to the database but are not automatically deleted (except Cloud environment, Note 2623826 ).

There is no general procedure for activating or deactivating the application log. Some applications offer this option individually or allow you to reduce the number of generated entries. (See SAP Notes 91519, 183960, and 141244.)


Expiration date of application logs


Normally, a log has an expiration date ALDATE_DEL that is set by the application that calls the application log tool. If the application does not set an expiration date, the application log tool sets the expiration date DEC/31/2098 or DEC/31/9999 depending on the release. This means that the logs remain in the system for as long as is possible. The expiration date cannot be set by the end user. The expiration date does not mean that logs that have reached the expiration date are automatically deleted. It controls the deletion of logs when you call the deletion report SBAL_DELETE (transaction SLG2) and during archiving (archiving object BC_SBAL). The indicator DEL_BEFORE in the table BALHDR determines whether or not a log is allowed to be deleted or archived before the expiration date is reached.


DEL_BEFORE = SPACE means that the log is allowed to be deleted or archived before the expiration date is reached. This is the default value. To delete these logs, choose the option "and logs which can be deleted before the expiry date" in the deletion report.


DEL_BEFORE = X means that the log is only allowed to be deleted or archived once the expiration date has been reached. The applications that created the logs in question are responsible for the deletion or archiving of these logs if this should be necessary (particularly if the expiration date is DEC/31/9999).


Solution

Deletion of application logs


You can make a selection of the logs to be deleted on the selection screen:


The "Object" and "Subobject" fields denote the application area that has written the logs (see the input help).

The "External Identification" field specifies the number assigned to the log by the application.

To delete logs whose expiration date has not been reached, too, you have to select the "and logs which can be deleted before the expiry date" checkbox.

For more information on the deletion procedure, read the application help in transaction SLG2.

SLG2 is a report transaction. The corresponding report is SBAL_DELETE. This report can be scheduled as a background job at regular intervals.


Remarks


We strongly recommend regular execution of SBAL_DELETE in the background job with suitable variant (eg: all logs that have reached their expiration date).

If you delete a lot of logs (for example, the first time you execute the report), we recommend that you distribute the deletion procedure to multiple background jobs to enable parallel processing and improved resource planning. Select the "Only calculate how many" checkbox in the deletion report to obtain a proposal for the distribution. You can use the displayed log number intervals as an additional selection criterion (one interval per background job). You can also define the distribution on the basis of the object, subobject, or creation date, for example.

Client-dependency


Note that the application log tables are client-dependent. The deletion of the data must therefore take place in each client.


Applications that generate entries in the application log


You can use the report SBAL_OBJECT_RECORDS_COUNT (see SAP Note 1774469), SBAL_STATISTICS (Note 2524124 - Application log Statistics ) to determine the number of logs for each client/object/subobject or to get detailed statistics. Alternatively, you can use transaction SE16 or TAANA to investigate the table BALHDR (fields OBJECT and SUBOBJECT).

For the text description for the object, see the table BALOBJT (subobject in BALSUBT) or transaction SLG0. As a rule, the application can be derived from the name and text of the object. You can use transaction SLGD to count, display or SLG1 to display the logs (see SAP Note 1746757). You can restrict the display to certain objects, among other things.


Restriction of log data quantity by application


Refer to the following SAP Notes for various applications to avoid large log volumes:

- 91519

- 183960

- 141244


Archiving logs


The archiving of logs is possible as of Release 6.20.

The logs are archived using the archiving object BC_SBAL.

You start the archiving programs using transaction SARA ("Archive Administration").

The archiving of application logs is made available for Release 4.6C (SAPKB46C27), 4.6D (SAPKB46D17), and 6.10 (SAPKB61011), too, by means of Support Packages.


Software Components

Software Component

From

To

And subsequent

SAP_APPL 30F 31I

SAP_APPL 40A 40B

SAP_APPL 45A 45B

SAP_BASIS 46A 46D

SAP_BASIS 610 640

Correction Instructions

Software Component

Number of Correction Instructions

SAP_APPL 2

References

This document refers to

SAP Note/KBA

Component

Title

91519 PP-PI-PMA Deleting logs of the application log

872388 BC-XI Troubleshooting Archiving and Deletion in PI

856006 PP-SFC-IS Mass processing saves unnecessary logs

737696

706478 HAN-DB Preventing Basis tables from increasing considerably

637683

587896

540019 IS-B-DP-EDT Report RJBTPRLO does not work correctly

440670

400687 BC-SRV-BAL Delete application log: DBIF_RSQL_INVALID_CURSOR

390062 BC-UPG-RDM Additional information about upgrading to 4.6C SR2

370601 SCM-APO Composite SAP note: APO 3.0 and 3.1 performance

365602 IS-M-AM-SL-O M/AM: Sales agent determination log - perf.

327285 BC-UPG-RDM Additions to upgrade to 4.6C SR1

2623826 BC-SRV-BAL Application log: deletion of logs in SAP Cloud systems

2524124 BC-SRV-BAL Application log Statistics

1881405 EHS-SAF-GLM Log entries are not deleted

183960 LO-MD-MM ALE: Deactivating application logs for data transfers

1774469 BC-SRV-BAL Report showing number of logs per application

1716420 PLM-RM-LBL Purge Object RMS_LBL logs render Label sets not maintainable

Comments

Popular Posts