Introduction


Admin tables archiving is a process to archive the data from admin and log tables to improve the system performance.
We should not delete the data from certain admin and log tables as it could lead to irreversible issues, dumps and lead to unstable system. So to free up the disk space it is only possible to archive the data which is still accessible by the system and then delete the data from the system. The archived files should never be deleted and should always remain in the system.
Performing this activity manually by process chain or tcode SARA periodically (yearly or half yearly) allows up to save space on the database and also improves the system performance. It can't be automatically because we need to:

  1. Change variants
  2. Make sure that there is no job running to update admin tables during archive data

The below mentioned tables are part of the admin archiving process. This information can be found in transaction 'AOBJ' for the archiving object 'BWREQARCH'


Table 

Description

RSBMLOGPAR 

Hierarchical Log: Field/Value Pair

RSBMLOGPAR_DTP 

DTP Log: Field/Value Pairs

RSBMNODES 

Hierarchical Log: Nodes

RSBMONMESS 

Hierarchical Log: Table with Messages

RSBMONMESS_DTP

DTP Log: Table With Messages

RSBMREQ_DTP 

DTP Log: Status of Header Table

RSCRTDONE 

CRT Packages Enhancements for Apollo

RSDELDONE 

BW: Selection Table for Deletion with Full Update Scheduler

RSHIEDONE 

Selection table for Fields Scheduler

RSLDTDONE 

Texts on the requested InfoPackages and groups

RSMONFACT 

Fact table monitor

RSMONICTAB 

Monitor IC table

RSMONIPTAB 

InfoPackage for the monitor

RSMONMESS 

Messages for the monitor

RSMONRQTAB 

Monitor table for request IDocs

RSREQDONE 

Monitor: Saving of the QM entries

RSRULEDONE 

ABAP Code for Scheduler Selections

RSSELDONE 

Monitor: Selections for executed request

RSTCPDONE 

Selection table for 3rd party; Scheduler

RSUICDONE 

BIW: Selection table for user-selection update ICs


The size of the following SAP Tables cannot be reduced as they contain important information for the smooth operation of the BW System

Table

Description

RSBKREQUEST

(SAP Table - DTP Request)

RSPCCHAIN

(SAP Table - Table for Process Chain details)

RSREQDONE

(SAP Table - Monitor: Saving of the QM entries)

RSMONICDP

(SAP Table – Monitor Request Data Packet Table)

RSPMREQUEST (SAP Table – RSPM Request Status)

Prerequisites

Logical file names

In SARA t-code as shown in the below screen shot.
Provide the archiving object name as 'BWREQARCH', Click on 'Customizing' and then double click on the 'Technical Settings'.

Check if the logical file name is maintained or not.


We can check the physical file path in 'FILE' transaction or using the FM 'FILE_GET_NAME'
Execute the FM and provide the file path to get the physical file paths.

File name = [Folder]/"archive__"[MMDD]"_."[HHMMSS].[UserID]

[Folder] = /saparchive/technical  in WBP

Background Jobs

Ensure the background jobs stopped (including process chains) before the archiving process gets started 

Others!?

Is the Central Repository for storage maintained using the SAP Content Management Infrastructure? Need to check on this aspect.

Are the deletion program variants maintained?

Is the maximum archive file size correctly set?
Is the deletion program to run automatically?
Have authorization to archive data?
Are enough locks exists in the system?

Capture before image of the admin tables

Execute the program ZTECH_TABLES_REC_CNT to get the before image of the admin tables i.e. get the record count of the admin tables.


Capture before image of DB02

Step by step process

There are two steps involved while performing the archiving.

  1. Write data to archive files
  2. Delete the archived data from the respective tables

1. Write data to archived files

Go to T-code 'SARA' and provide the archiving object name as 'BWREQARCH'
Click on 'Write' button

We need to create a variant for the data archival process i.e. selection parameters which specifies what data to be written on files.
Click on the 'Maintain' button then provide the new variant name and click on 'Create' button

As shown below check the option and click 'Continue' button

Provide the date range if a specific period of data to archive else just provide the value in the filed 'Request Older than (months)'
Choose the radio button 'Only Archive New Requests' if we want to archive the new data (which was not archived before); Choose 'Only Reloaded Requests' if we want to archive the reloaded requests(i.e.Archived data which was reloaded); Choose 'Archive All Requests' if we want to archive both the new and reloaded data.
Let the Min. Number Requests remain '1000' i.e. If the no requests to be archived be more than 1000 else the archiving won't start.
Check the button 'With DTP Requests' as we also archive the DTP requests.
For a simulation run then select the radio button 'Test Run' and select 'Production Mode' for the archiving the data

(lightbulb)Restriction (Note 950612)

Selection Date of Request: The program for choosing the requests in ascending order, it selects from the most recent request to all requests in the field "Selection date of requests" that have not yet been archived (if this selection remains empty, all requests are selected). It is better to identify each year to identify the log file later when we want to reload.

Requests Older than: This filed must contain at least a "1" for a month. Months are always calculated with 31 days.

If the button "Only Archive New Requests" is set, requests that were archived once before but were then reloaded from the archive are not archived again.
If the button "Only Archive Reloaded Requests" is set, ONLY those requests that have already been archived once and reloaded again are archived.
The button set to "Archive All Requests" archives all the requests that are not currently archived, regardless of whether these were already archived once and were reloaded again or not.
We recommend that you set the button "Only Archive New Requests" for initial archiving because after several months you can check whether archived requests had to be reloaded again.

Min. Number Requests: An archive is only created if the report finds at least this number of requests that it can archive.
The report collects the first 10,000 requests that meet the criteria and archives them. The report then stops.
This guarantees that an archive does not have too many requests. We do NOT recommend that you set the parameter "Min. Number Requests" to a value lower than 1,000. If you have too many requests, you should set the parameter to 9,999.

(warning)Caution: You must save all requests that you want to archive in transaction SM12. This means that an enqueue lock is set for each request before it can be written to the archive.
Therefore, you must set the BW so that at least 12000 enqueues can be set or created at the same time.
If there is not enough memory for the enqueues (not enough can be allocated), then the process hangs.

Delete with Test Variant

If this indicator is set, the delete program of the archiving object will be started with the test mode variant that was specified in the archiving-object-specific customizing. You can set the customizing of the variant so that the delete program will be run in in the test mode. No data will be deleted from the database, because deletion is only simulated. The program will generate statistics about the table entries that would be deleted from the database in the production mode.

If the indicator is not set, the delete program will be started with the production mode variant that was specified in the archiving-object-specific customizing. You can set the customizing of the variant so that the delete program will be run in the production mode and the program will delete the archived data from the database. It will also generate statistics about the table entries that were deleted.


Maintain the start date and spool parameters and then click execute button.

During the archiving, the tables will be locked (SM12), That's why it can't be executed during loading. 


Click on the Job Icon to view the request in the background.

The spool output will give the detail how many records and size to be written and deleted.

2. Delete the archived data from the respective tables

Go to t-code 'SARA' and click on 'Delete' button  (Do not do if uncheck on option "Delete with Test Variant"), The deletion job will start after write job complete)

Maintain the Archive Selections, Start Date & Spool Parameters.




Maintain start date and spool parameters and then click execute.

Check logs

Click on management & Statistics to check the load status & overall statistics.


Check the files on AL11.

3. Reload archive file

  1. Run program RSREQARCH_RELOAD (or manage files by tcode RSREQARCH)
  2. Select Test or Production mode
  3. Select the archive files that want to reload (only the file available to be reloaded)


(warning)It is important to archive files with variants to be clear of the period of archive since the file can't identify the data inside.  We must record the session ID + archive date in order to identify the date of the log by file name. 

For example, archive session file 26-18 is the 2008 log  and 1782-1785 is 2013 log

How to archive by process chain

Process chain PC_AAT_01 (Admin Tables Archiving) includes 2 programs that are the same as tcode SARA. 

  1. To archive data, which use program RSREQARCH_WRITE with variant ZV_2014_ALL (it must be changed the date before run the PC)
  2. To delete data, which use program RSREQARCH_DELETE with variant SAP&PROD (no need to change - only mark production mode)However, we need change variant manually. 

Reference SAP Notes

 SAP NOTE

 SHORT TEXT – remark

1812238

Archive File Not Accessible" in SARA (no backup available)

 950612

 P9; request archiving: Archiving multiple requests as initial

 2177801

provides report RSREQARCH_DTP_CONDENSE_LOGS in order to delete after the 'normal' archiving, more records of table RSBMONMESS_DTP, RSBMREQ_DTP, and RSBMLOGPAR_DTP, correction of SAP Note  2239379 should be available

 2346654

 report RSREQARCH_CHECK_DEL_OBS_MESS


Reference Links

https://help.sap.com/saphelp_erp60_sp/helpdata/en/42/ea99e6b2161bc9e10000000a11466f/content.htm?no_cache=true
https://help.sap.com/saphelp_erp60_sp/helpdata/en/4d/8c8487910b154ee10000000a42189e/frameset.htm
https://wiki.scn.sap.com/wiki/display/BI/Reduce+BW+Request+Administration+Tables https://wiki.scn.sap.com/wiki/display/BI/Archiving+Request+Information+in+BW