Online Tutorials & Training Materials | STechies.com
Register Login

Application log: Deletion of logs

|| 0

Application log: Deletion of logs
Stechies

The application log is a tool to collect, save and display logs. The following database tables belong to the application log:
- BALHDR, BALHDRP, BALM, BALMP, BALC, BALDAT, BAL_INDX .

One or several database tables of the application log contain too many entries. Many different applications collect messages in the application log which contain information or messages for the end user. The application automatically log serves as a temporary storage for messages. The logs are written on the database but they are not automatically deleted.

There is no general procedure for switching the application log on or off. Some applications provide this option or they offer the option of reducing the number of entries created.

The expiration date of application logs
---------------------------------------------------------------------
A log usually has an expiration date, which is set by the application, that calls the 'Application log' tool. If the application log does not set an expiration date, the 'Application log' tool sets the expiration date as 12/31/2098 or 12/31/9999,depending on the release, which allows the logs to stay in the system for as long as possible. The end user cannot set the expiration date. The expiration date does not mean that logs which have reached that date will automatically be deleted. It is used to control the deletion of logs when you call the Deletion report. The DEL_BEFORE flag in the BALHDR table determines whether or not the log can be deleted even before the expiration date is reached.
DEL_BEFORE= SPACE means that the log can be deleted before the expiration date is reached. (Default value)
DEL_BEFORE='X' means that the log can only be deleted after the expiration date.

Deleting the logs of the application log.

Releases >= 4.6A:
=====================================================================
In Releases >= 4.6A, use Transaction SLG2.
On the selection screen you can restrict the amount of logs to be deleted:

  • The 'Object' and 'Subobject' fields specify the application area in which the logs were written (see F4 Help).
     
  • The 'External Identification' field specifies the number which was          provided for this log by the application.
     
  • o  If you also want to delete logs which have not reached the expiration date you must set the option "Also logs which can be deleted before the expiration date".

Select 'Help with application' in Transaction SLG2 for further explanation of the procedure for deleting.
SLG2 is a report transaction. The corresponding report is SBAL_DELETE. At regular intervals, this can be scheduled as a background job.

Releases < 4.6A:
=====================================================================
For Releases < 4.6A, note the following instructions:
In general, the deletion of application logs can be carried out in two steps:

1. Report RSSLG200: Deletion of all logs which expired:
----------------------------------------------------------------------
Use report RSSLG200 to delete all logs whose expiration date is reached or exceeded. (This report is not yet available in the standard in Release 3.0F. In this case, the report can be installed in advance; see corrections attached to this note).
As of Release 3.1H, Report RSSLG210 is also available. This report allows the definition of a job that runs regularly and deletes such logs.

2. Report RSSLGK90: Deleting all logs for which a deletion is allowed before expiration:
----------------------------------------------------------------------
Sometimes, step 1 does not delete enough logs. The reason for this might be that the expiration date of the logs is too far in the future or that no expiration date has been defined at all (in this case, depending
on the release, the assumed expiration date is 12/31/2098 or 12/31/9999)
Use report RSSLGK90 for these logs.
When you execute this report, you can restrict the logs to be deleted in a selection screen:

  • The fields 'Object' and 'Subobject' specify the application area which wrote the logs (see F4 help).
     
  • The field 'External number' indicates the number which was assigned by the application for this log.
     
  • Field 'Log class' indicates the importance of the log.
     
  • NOTE: By default, this field contains the value '4', this means only logs with additional information. If you want to delete all logs, enter the value '1' in this field. All logs with log class '1' or higher will then be deleted.
     
  • The fields 'To date' and 'Until time' refer to the creation date of a log.
    If you enter 12/31/1998 and 23:59:59, you get all logs created in and before 1998


NOTES:
----------------------------------------------------------------------
Client-dependency:
--------------------------------------------------------------------
Note that the application log tables are client-dependent. Therefore, you must delete data in each client.

Which applications create entires in the application log:
-------------------------------------------------------------------
To determine which applications create the logs, look in Table BALHDR to see which objects the logs were created for ( Transaction SE16, Table BALHDR, Field OBJECT). You can find the text description for the object in Table BALOBJT. The application is usually derived from the name and text of the object. The log is displayed in Transaction SL61. The display is restricted to certain objects, among other things.

Database error:
-------------------------------------------------------------------

  • If very many data exists on the DB, Report RSSLGK90 might cause problems. In this case, implement Note 138715.
     
  • In very rare cases a dump is created even after Note 138715 was implemented:
            ABAP/4 runtime error  DBIF_RSQL_SQL_ERROR
            SQL error 1555 occurred accessing table "BALHDR "
            Database error text...: "ORA-01555: snapshot too old
        If you cannot correct the error by means of database utilities, Note 368700 provides a way to bypass this error.
     
  • Report RSSLG200 can also run into problems. In this case, use the correction for Report RSSLG200 attached to this Note.

Expiration date in Report RSSLGK90:
-------------------------------------------------------------------

  • There are logs on the database which may only be deleted explicitly after the expiration date (flag DEL_BEFORE = 'X' in table BALHDR). These logs are not deleted in advance by report RSSLGK90. Since, however, this flag is used very rarely, you can ignore this data.

Restriction of the quantity of log data by the application:
------------------------------------------------------------------

  • To avoid large quantities of logs from different applications, also refer to the following notes:
    - 91519
    - 183960
    - 141244

Archiving logs:
-------------------------------------------------------------------

  • As of Release 6.20, it has been possible to archive logs.
    The logs are archived via archiving object BC_SBAL.
    The archiving programs are started via Transaction SARA (archive administration).
    Via Support Packages, the archiving of application logs has been made available for Releases 4.6C (SAPKB46C27), 4.6D (SAPKB46D17), and 6.10 (SAPKB61011) as well.