Professional Documents
Culture Documents
SAP Data Archiving: by Gayatri Narendra Patil, Infosys
SAP Data Archiving: by Gayatri Narendra Patil, Infosys
Introduction
Data Archiving, in general means deleting the huge volumes of the data that is no longer required in the database to some
file system or any third party storage system. It is also a service provided by SAP for the consistent removal of data
objects from database tables of the SAP database, where all table entries that characterize a data object are written to an
archive file outside the database.
Creating the archive file and running the delete programs are the mandatory steps to follow for data archiving whereas
storing the archive files is optional.
In this step, a new archive file is been created and data to be archived is sequentially written in it.
In this step, the delete programs are executed which deletes the data from the SAP R/3 database, once the archived
data is read successfully from the archive files.
Here, the archive file with the archived data is moved to the third party storage system or copied to disk, etc. This can also
be triggered manually or automatically.
A list of transaction codes along-with the short description required for SAP Archiving can be found in the dynamic menu.
Go to transaction SDMO and enter search for the text as Archive.
Click on execute button. The screen will be displayed as below.
Archiving Object is the central component of Sap Data Archiving. Archiving Object specifies which data is to be archived
and how. Archiving Objects directs the SAP Archiving system to get the correct tables associate with the specific
Business Object. The archiving object name can be ten characters long in length.
Transaction DB02 is used to identify tables with high growth in data volumes and to compare the table size after
archiving and thus to monitor growth of the database tables.
Transaction TAANA which is used to identify the appropriate archiving object when a table has more than one archiving
object
Transaction DB15 is used to identify the Archive Objects, if you know the Database tables or if you know the Archiving
Object it displays the list of associated database tables for that particular Archiving Object as Shown in Fig.a.
Fig.a. Transaction DB15
1. Structure Definition.
As shown in the Fig.2. , the Structure definition contains the list of the database tables from which the data will be
archived. This is pre-configured for the Standard SAP Archive Objects.
Fig.2. Structure Definition.
4. Customizing Settings.
This should be configured as per the business requirements. As shown in the Fig.5. , this contains details about
Archive File Size, Setting for Delete programs like Test Mode Variants and Live Mode Variant(i.e. Production Mode
variant), content Repositories and the sequence of deletion. If the radio button Start Automatically for Delete Jobs is
selected, automatically the delete program is executed after the write program. If not selected, execute the delete
program manually for the particular archiving object.
Fig.5. Customizing Settings.
6. Read Programs.
This contains the details about the read programs which is used by both the archiving objects and Archiving Class to
read the data from the Archive files.
Fig.7. Read Programs.
7. Customizing Transactions.
This contains the transaction code for the application-specific customizing for the relevant archiving object. Once this
code is entered, you can go directly from transaction SARA to the application-specific Customizing transaction, which
is often used for entering residence times for an archiving object.
Fig.8. Customizing transactions.
Archive Programs
The below mentioned Program in the SAP System should be assigned to the Archiving Objects.
1. Preprocessing(Optional)
This program prepares the data for archiving marking the data by setting the deletion indicator to X, but it does not
delete any data from the database. Preprocessing Programs operates on the database and no Archive files are
required. Preprocessing Programs are scheduled manually and run in Archive Administration (tCode: SARA).
2. Write
This program creates a new archive file and writes the data in them. At this point, No data is been deleted from the
database. The Write programs can be executed in two processing modes.
a. Test Mode.
b. Production Mode.
In the Test Mode, No archive files will be created whereas in Production Mode, Archive files will be
created.
3. Delete
This program reads the data from the archived files and deletes the data from the database. The delete programs can
be executed in two processing modes.
a. Test Mode.
b. Production Mode.
In the Test Mode, the log after the execution shows the entries of the data going to be deleted from the database whereas
in the production Mode it shows the statistics of the deleted data from the database.
4. Postprocessing(Optional)
This program also operates on the Database and does not require any Archive files. This is final program and can be
executed asynchronously with the delete program.
If the data from the database id not deleted by the delete programs, it can be deleted by the Post processing
Programs. It is also used for different functions like updating the statistical data, deleting the log data log that is no
longer required, etc.
5. Reload Programs(Optional)
This program is used to reload the archived data from the external storage system back into respective SAP
Database tables. It is not available for all the archiving objects.
6. Index Programs(Optional)
This program builds or deletes an index that allows individual access.
Check Archivability
Checking the Archivabilty of the business objects precedes the actual archiving process. This should ensure that the data
is not archived, if some other application still needs it. The business objects are considered to be archivable if it:
1. Is Completed.
It is also recommend not be archive Master Data but the Transaction Data.
Residence Time: is the minimum length of time that data must spend in the database before it meets the archivability
criteria.
Retention Time: is the entire time that data spends in the database before it is archived.
Setting up the connection between the SAP R/3 database and the External Storage system
The content repository is maintained for every archiving object. Below is the content Repository Maintained for
MM_EKKO.
To retrieve the content repository details, double click on content repository. Details are as below.
Maintain the Document Type (TCode OAC2)
The document type is maintained by transaction OAC2. Every Archiving object is associated with the document type
which is in turn linked to document class. The document class identifies archive format for document in Content server.
Logical filename should be assigned to every Archiving object. Archive files are stored in the file system under a physical
path and file name that is derived from a user-definable logical path or file name. Steps to Configure the Logical Filename
is as below.
1. Choose ARCHIVE_GLOBAL_PATH and double click on sub-folder Assignment of Physical path to Logical Path on the
Left Side.
4. In the definition of variables, you can see the value FILENAME in the physical file path represents filename
5. Double Click on Logical File Name Definition, Cross Client. Logical Filename should be maintained here.
<PARAM_1><DATE><TIME><PARAM_2><PARAM_3>.ARV
PARAM_1: Two-character application abbreviation (for example, HR, CO, MM) for the classification of the archive files in
the system. The value of the definition is determined from the relevant archiving object at runtime.
PARAM_2: Single-character alphanumerical code (0-9, A-Z). If, when creating a new archive file, an existing file with an
identical physical name would result in a conflict, the ADK increases this value by 1. This value must, therefore, always be
a part of the physical name.
PARAM_3: This parameter is filled at runtime with the name of the archiving object. In archive management, this enables
you to check the file contents or to store the archive files by archiving objects.
1. Call Transaction SARA and enter the Archive Object Name. Example: MM_EKKO.
Click on Preproc button. This step is Optional.
2. Give the variant and click on maintain button. Next Screen is displayed.
5. Give the meaning for the variant here and click on save.
6. Go back to initial screen. Click on Start Date Button.
11. Repeat the same procedure from 2 to 10 for write program by maintaining the variant as TEST_WRITE along-with
same selection criteria as given for preprocessing program and click on Execute button.
12. Click on the Job Overview button to see the archived session.
13. Select the Job and Click on the Spool to view the output.
Accessing the Archived Data
User can access the archived data by the Archive Information System. User can check the Archive Information System by
clicking on the Information System button in the Archive Administration i.e. tCode SARA.
The screen will be displayed as below.
Creating an Infostructure
Every Archive file accessed using Archive Information System is through infostructure. Every infostructure belongs to a
unique Archiving objects and also refers to the Field Catalog. A Field Catalog is the collection of fields suitable for
indexing the archive files of Archiving object concerned. All the data related to infostructure is maintained in database
tables.
For creating an infostructure call transaction SARJ or Click on the Customizing button in the Archive Information
System: Central Management as shown below.
It will open an Archive Retrieval Configurator which is used to create an infostructure. User can create own
infostructure or use the available standard infostructure. Before creating the own infostructure, one should check if there is
any standard infostructure available. User can copy this infostructure and modify it according to the requirements.
While creating an Infostructure one can determine the fields from the field catalogue and transfer them to the
Infostructure.
Some fields are already transferred to the infostructure. This cannot be removed as they are key fields.
Activating an Infostructure
To use an infostructure, user must activate the infostructure. All the standard infostructures will be already activated. Only
after activating the infostructure it can be filled with data from archive file and evaluated. Once the infostructure is
activated, it cannot be modified.
Evaluating an Infostructure
The data from the archive files can be retrieved using Archive Explorer by calling transaction SARE or by clicking on
Archive Explorer button in the Archive Information System: Central Management as shown below.
Archive Explorer screen is displayed as below. Enter the archiving Object name and Archive Infostructure name as given
below and click on Execute button.
References
http://help.sap.com/erp2005_ehp_03/helpdata/EN/bd/6b9b3c874da309e10000000a114027/frameset.htm
Data Archiving
This IT Scenario variant is an important part of an effective data management strategy. Data archiving is used by
companies with two main goals in mind: reducing data volumes in the system and complying with legal data retention
requirements. Both goals are obtained using the same processes, which together make up this variant: Monitoring,
Analyzing and Categorizing, Archiving and Post Processing.
Data Archiving is a secure and reliable process through which data from closed business processes, meaning data that is
no longer needed in online business, is written from the database to an archive, and then deleted from the database.
Optionally the archived data can then be moved to an external storage system (ADK-based archiving). An important
aspect of this entire process is that the archived data must be accessible at any time, in case it needs to be viewed again,
for example as part of an audit or for business reasons. Data archiving provides several functions for the reading of
archived data.
In terms of legal compliance some data can or even must be deleted, as soon as the required data retention period has
been reached. This scenario variant offers different functions that allow you to store archived data separately based on
specific criteria. This facilitates the deletion of the archived data later.
Benefits
As an important part of every data management strategy, data archiving helps companies curb data growth within their
systems and supports them in their legal compliance strategy.
More specifically, data archiving provides companies with the following benefits:
Support in complying with legal data retention requirements through more automatization and more
complete data archiving and storage processes.
The technological basis for data archiving is part of the SAP NetWeaver Application Server and is available in two
variations:
ADK-based Archiving
ADK-based archiving is used only by ABAP applications that employ ABAP archiving objects in their data archiving
projects.
XML-based Archiving
XML-based archiving is employed for XML archiving objects that are used by ABAP applications with XML interfaces, and
for archiving sets used by JAVA applications.
Required or Optional Installable Units
To use this scenario variant, you require the following installable units: