How does Data Aging in SAP S/4HANA function technically?

Thursday, July 12th, 2018

The data aging mechanism for ABAP applications is based on a new data aging framework provided by SAP NetWeaver ABAP. ABAP developers use this framework to specify the data aging objects that are aged as one unit, to identify the involved tables, and to implement the logic for determining the data temperature. The data temperature is set via an additional data temperature column ‘_DATAAGING’ (type DATA_TEMPERATURE with ABAP date format “YYYYMMDD”), which is added to all participating tables.

The data temperature can be used to horizontally partition the application data with time selection partitioning (a.k.a. “aging”) on the column ‘_DATAAGING’ for optimizing resource consumption and performance. Only one partition contains the hot data (represented by the value “00000000”) and the other partition(s) contain cold data with different data temperature ranges.

By default, only hot data is accessed. As the hot data is located in a separate partition, SAP HANA should only load that partition into memory during normal operation. If required, ABAP developers can set the data temperature context to switch between accessing only hot data, all data, and all data above a specified data temperature.

The SAP HANA-specific database shared library (DBSL) in the ABAP server adds a corresponding clause to the SQL statements that are sent to SAP HANA. By adding the clause WITH RANGE RESTRICTION (‘CURRENT’) to a SQL statement, SAP HANA restricts the operation to the hot data partition only.

Instead of ‘CURRENT’ also a concrete value can be specified. This restricts the operation to all partitions with data temperatures above the specified value. The clause WITH RANGE RESTRICTION (‘20100101’), for example, tells SAP HANA to search the hot partition and all cold partitions that contain values greater or equal than ‘20100101’. Range restriction can be applied to SELECT, UPDATE, UPSERT, DELETE statements and to procedure calls.

All other clients that want to access these Data Aging tables with proper filtering, the same generic syntax extension may be used.

The application knows which business objects are closed and may hence be moved to cold partitions. Therefore the application actively sets values in this column to a date to indicate that the object is closed and the row shall be moved to the Cold partition(s) during an Aging Run. Since the table is partitioned by the temperature column, the rows are automatically moved then to a cold partition. The move influences the visibility of the data and its accessibility. Several configuration steps/prerequisites need to be administered to be able to execute a Data Aging Run (-> “How and when will the data be moved from the hot partition to the cold partition(s)?”).