SAP Program RSDB4UPD - Update SAP Database Performance Tables (iSeries: Memory-Resid DBMon)

Description
This report is used for to merge the current output of the memory-basedSQL database monitor into the SAP Database performance tables SQ*_DB4(parameter del_data = 'N', default) and for deleting old data from theSAP database performance tables SQ*_DB4 (parameter del_data = 'Y' andparameter date specifying what 'old' means). It also contains FORMroutines used for getting a history overview of database activity. TheseFORM routines are used by ABAP report program RSDB4DBH
for collecting the history data.
The memory-based SQL database monitor gathers statistics about databaseusage using SQL. These statistics are kept in memory until the databasemonitor is told to write the statistics to outfiles (the so-called"database monitor dump") . When this happens, the database monitorchecks if outfiles already exist in which case the data existent in theoutfiles will be deleted before the current statistics are inserted.Otherwise new files will be created. The names of the outfiles arelisted under &PRECONDITION&.
As the database monitor does not keep the old statistics, the merging ofthe newest statistics with older ones is done via RSDB4UPD. Allstatistics are kept in SAP tables SQHVAR_DB4, SQTEXT_DB4, SQ1000_DB4,SQ3000_DB4, SQ3001_DB4, SQ3002_DB4, SQ3003_DB4, SQ3004_DB4, SQ3006_DB4,SQ3007_DB4, SQ3008_DB4.
Merging is a database-intensive activity and can have an impact onoverall performance.
RSDB4UPD for merging is automatically executed in defined timeintervals. You can set this time interval by making an entry in tableDB40X. If no entry is found, a time interval of 10 hours is taken asdefault. For moe information, see &TECHNICAL-INFO&.

Precondition
The outfiles of the memory-based SQL database monitor are in libraryR3QTEMP: QRYI, QHVAL, QTEXT, <(>
<<)>SID>Q3000, Q3001, Q3002, Q3003, <(>
<<)>SID>Q3004, Q3006, Q3007, Q3008.
If one of these outfiles does not exist, no merging is done to preventinconsistent data being inserted into the SAP DB2/400 databaseperformance tables.
Because the merge is so database-intensive, you have to run it in thebackground.
You can delete old data online using transaction ST04, if you haveauthorization. Alternatively, you can do this in the background bysubmitting RSDB4UPD using variant SAP&_RSDB4UPD1 (deletes all dataolder than a week).

Output
When RSDB4UPD is executed in the background, the corresponding job login SM37 details which steps were performed and, in case of errors, whatthese were.
If the old data is deleted online, a list output details the number ofdeleted records per table. If the data is deleted in the background, youwill find this list as a spool list for this background job, which youcan display using transaction SM37.

Technical-info
Only a set amount of information will be kept in the database monitor'smemory, if more statements are executed than can fit in the memoryavailable a superceding operation is performed. When and how often thishappens depends on the system's workload and the available memory.
If you have a heavy workload on the system and want to minimize the theamount of statistics lost as a result of the superceding operation, youcan define an entry in table DB40X smaller than the default 10 hours forthe time interval of dumping/merging the newest statistics. Bear in mindthat merging is a database-intensive activity and have an impact onperformance.
Conversely, if you are not so worried about losing some statistics, youcan define a longer time interval for the dumping/merging and, by doingso, eliminate some of the above mentioned performance impact.

727078iSeries: Cleanup of the database monitor data