https://websmp130.sap-ag.de/sap(bD16aCZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3638333326
Symptom
The statistics file is too large.
You want to delete the statistics file manually.
Question about the statistics file: When is it deleted automatically?
Other Terms
Stat file, statistics file, Performance Monitors, workload analysis,
ST03, RSSTAT80, RSSTAT83
COLLECTOR_FOR_PERFORMANCEMONITOR, SAP_COLLECTOR_FOR_PERFMONITOR
Reason and Prerequisites
The statistics file is deleted automatically in the following cases:
- when you start the SAP system (if the first record in the file is at least 7 days old, or if a new year begins between stopping and starting the system), or
-
when the collector reports of the workload analysis are scheduled regularly, when the file has reached the maximum size that was set, *and* when the workload collector has processed all the data of the file. Normally, these collector reports run in a background job ('COLLECTOR_FOR_PERFORMANCEMONITOR' or 'SAP_COLLECTOR_FOR_PERFMONITOR'), which is scheduled hourly in the standard system.
Solution
In active systems, statistics data records are constantly written to the R/3 statistics file if the statistics indicator "stat/level = 1" is set in the SAP startup profile. Therefore, the file constantly grows. The load on your R/3 instances has an effect on how fast the file grows. The statistics parameters in the instance profiles (stat/...rec) represent another influencing factor. However, they also impair the accuracy of the statistics.
If the background job SAP_COLLECTOR_FOR_PERFMONITOR or COLLECTOR_FOR_PERFORMANCEMONITOR (it is best to schedule it hourly = default value) is scheduled in the R/3 system, the statistics file is usually deleted when it reaches a certain size. Currently, the default value is 100 megabyte, which corresponds to about 200,000 to 300,000 (depending on the release) statistics entries (about 200,000 to 300,000 screen changes). In the SAP system (if statistics are activated), about 340 - 500 bytes are written to the statistics file (when you use the standard setting) for each screen change.
You can also set a value that differs from the default value in transaction ST03 (menu: Tools -> Administration -> Monitoring -> Performance, then: Workload -> Analysis). To do this, choose Goto -> Parameters -> Performance database, and then choose 'Modify parameters' and change the parameter 'Delete seq.statfile after cumulation if >'. If you enter the value "0 Megabyte", nothing is deleted.
Normally, there are only two useful settings for the customer:
-
1. The background job COLLECTOR_FOR_PERFORMANCEMONITOR or SAP_COLLECTOR_FOR_PERFMONITOR is scheduled hourly and the statistics are activated in the startup profile using the setting "stat/level = 1". As a result, the file is deleted.
or
-
2. The background job mentioned above is not running: If this is the case, it is not useful to have the statistics permanently activated because a systematic analysis cannot be performed. In this case, you should set "stat/level = 0" in the startup profile. In this case, no EarlyWatch support or GoingLive support is provided.
In very large systems, if statistics have been activated, the statistics file may not be deleted and may continue to grow even though the collectors run without errors.
In this case, the reason for this is that the volume of statistical data within a certain period is larger than the volume of data that can be processed within the same period. As a result, the condition that *all* the data of the file must be processed before the file is deleted is not fulfilled. For example: The collector processes 20,000 entries from the statistics file each hour. However, about 25,000 entries are written to the file within the same period. Therefore, the file continues to grow and is *not* deleted unless the collector is able to process the entire volume of data when the load on the system is lower. Another reason for the collector being unable to process the volume of data may be that the collector frequently terminates and does not finish processing within the given processing time; as a result, the second job runs into the locks of the first job. In addition, problems may occur in the statistics file and you must delete it manually. To determine whether the problem is caused by one of the two reasons mentioned above, see the collector logs (ST03 > Environment > Data collector > Display protocol; if necessary, double-click on the individual lines in the log). In this case (or if timeout problems occur), carry out the tuning measures described in Note 127642.
It is apparent that the workload collector is unable to process the volume of data in data processing if the 'Last record' (that is displayed in the dialog box in transaction ST03 -> Performance database) is older than one hour.
In this case, you must first solve the problems (such as 'timeouts' or a statistics file that is locked or cannot be read) as described above. You can then try to increase the number of records that is processed in each collector run (ST03 -> Goto -> Parameters -> Performance database, then choose 'Modify parameters' and change the parameter 'Max. number of records cumulated per call'), or you can try to schedule the collector more often.
If you want to delete the statistics file manually, proceed as follows:
In transaction ST03, call the delete function on the relevant instance by choosing:
Workload -> Reorganize -> Delete seq.stat.file
The system displays a dialog box asking whether you want to save an extract of the stat. file to the performance database (DB) before deleting the statistics file (Release 2.0x - 2.1x), or asking whether the data from the statistics file should be added to the 'Performance DB' data in the same way as when using COLLECTOR_FOR_PERFORMANCEMONITOR (higher releases). If you choose 'Yes', this starts another ABAP program that reads and extracts the statistics file, or that adds it to the workload monitor data, and then stores it in the database before deleting the file. Normally, you should choose 'Yes' to save the data extract or to ensure that the workload data is consistent. However, if the file cannot be read (error message in the log), you must choose 'No' in the dialog box.
The system then displays a second dialog box in which you must confirm the deletion of the statistics file. The system then deletes the statistics file.
New statistics entries are entered in this file that has been shortened "to a length of zero", which means that the file continues to grow as usual immediately after the delete operation.
Note the following: Changing the statistics parameter "stat/level" to another value in the profile file takes effect only after the relevant R/3 application server has been restarted.
If the system does not delete the file despite a success message, this may be caused by the following:
The hard disk on which the statistics file is stored was full for a short period of time. When the statistics record was to be written, this was not possible. Within the work process, the statistics file is marked as incorrect and is no longer used; therefore, it is no longer deleted either. When you next restart the system, the problem is solved.
You can use the entries in the dev files to find out whether this is the case. Search the files dev_w* for entries of the following type:
PfWrStatFile failed (0028 ) -> no space left on device
As of Release 4.6D (for application statistics, as of Basis Release 6.10), the kernel begins a new statistics file on the hour. This procedure has several advantages.
- The accesses to the relevant file are much faster.
- There is now a defined availability of statistics records. Previously, the collector deleted the file when it exceeded a specified size that was set. However, all records were deleted as a result. Up to Release 6.40 you can specify for how long the statistics files are to be retained (for example, 48 hours). The collector then deletes the files that are older than that (if all the records from this file have already been processed). You must ensure that this value is always smaller than the profile parameter stat/max_files. This parameter determines the maximum number of stat files. As of Release 7.00, the retention time for the statistics records is controlled only using the parameter stat/max_files, and the collector no longer deletes any STAT files. When the limit stat/max_files is reached, the kernel automatically overwrites the oldest file. A useful value for stat/max_files is 72. If you set stat/max_files = 0, the system works only with one single statistics file as before Release 4.6D.
- In this case, when you start the system, the system also automatically deletes all the statistics files in which the first record is older than seven days. In addition, during each collector run, the system deletes all the files that are older than the specified retention period. If you experience problems with the statistics files, you may have to delete these manually. To do this, call transaction ST03N and then choose "Expert mode". In the tree, choose the function "Collector and Performance DB" - "Statistics Records & File" - "Delete File", and delete the files for dialog step statistics (or the files for application statistics if these files cause problems).
Header Data
Released On | 19.03.2008 08:55:26 |
Release Status | Released for Customer |
Component | BC-CCM-MON-TUN Performance Monitors (TCC) |
Priority | Recommendations / Additional Info |
Category | Consulting |
Validity
This document is not restricted to a software component or software component versionReferences
This document refers to:
SAP NotesThis document is referenced by:
SAP Notes (8)