SAP HANA Persistent Memory

HANA www.basisguru.com

What is Persistent Memory In SAP HANA

SAP HANA is in-memory database which uses and processes bulk of data in memory i.e. on DRAM/volatile memory.
Additionally SAP HANA provides protection against data loss by mechanism called persistent memory.

Data synchronization is achieved with the persistence level using SAVEPOINTS.

In short, persistent memory is a non-volatile or NVRAM which is durable and can be accessed quickly for restoration in case of events like database crash/restart.

It is an emerging memory technology which has qualities of both DRAM and Flash storage.

SAP HANA persistence layer stores data in persistent disk volumes.
It is divided in:

  • Data Area
  • Log Area

They are organized as a PAGES in these persistent disks

Persistent Memory in SAP HANA

Let us discuss each in detail:

LOG Area:

It contains information like ‘REDO LOGS’ and they are directly saved to persistent storage when transaction is committed i.e.
Data changes like delete, update & insert are immediately saved to log volume.
(SYNCHRONOUSLY data is stored).
In case of database crash or restart, these transaction logs can be used to REPLAY.

DATA Area:

In the data volume copy of in-memory/DRAM data is persists by writing changed data in the data volume.
DATA like undo log information, modelling data, SQL data are stored ASYNCHRONOUSLY i.e. after every ‘SAVEPOINT’.

These Savepoints are created in a customizable interval. By default, this interval is =5 minutes.

Pre-requisites:

As per SNOTE: 2618154, In SAP HANA, persistent memory is supported since HANA 2.0 SPS 03 (2.00.035 and higher to be more specific).

This note provides information on prerequisites like supported operating systems.

Monitoring Views for Persistent Memory:

Below views are used to monitor the persistent memory:

VIEW DETAILS
M_PERSISTENT_MEMORY_VOLUMESPer NUMA node, it Reports the capacity, usage and metadata of persistent memory volumes.
M_PERSISTENT_MEMORY_VOLUME_STATISTICSStatistics of physical lifecycle events of blocks managed by SAP HANA services on persistent memory volumes
 M_PERSISTENT_MEMORY_VOLUME_DATA_FILESReports metadata statistics about files created by SAP HANA services for data storage on the persistent memory volumes.

MCOS systems also known as Multiple SAP HANA systems can run on one server using persistent memory.
Each server should have it’s own directory structure e.g:  /hana/pmem/<DBSID>

Parameter Settings Related With Persistent Memory:

Below are few related parameters which are relevant in context of persistent memory.

PARAMETERDETAILS
global.ini -> [persistence] -> basepath_persistent_memory_volumesFilesystem locations for persistant memory,e.g: /mnt/pmem0
global.ini -> [memorymanager] -> global_allocation_limitThis parameter should be considered for the DRAM based fast restart option
global.ini -> [persistent_memory] -> out_of_persistent_memory_modeDuring table optimzation, if persistent memory is insufficient, this paramter plays important role,refer SAP Note 2057046
global.ini -> [memorymanager] -> persistent_memory_global_allocation_limitThis parameter can be used to limit the maximum size of the persistent memory on a host
global.ini -> [persistent_memory] -> table_defaultDefines utilization of persistent memory on global level
global.ini -> [persistent_memory] -> table_unload_actionControls behaviour to the main storage part inpersistant memory when table columns are manually unloaded.