Sie sind auf Seite 1von 5

6/7/2019

SAP HANA Administration Guide for SAP


HANA Platform
Generated on: 2019-06-07

SAP HANA Platform | 2.0.04

PUBLIC

Warning

This document has been generated from the SAP Help Portal and is an incomplete version of the official SAP product
documentation. The information included in custom documentation may not re ect the arrangement of topics in the SAP Help
Portal, and may be missing important aspects and/or correlations to other topics. For this reason, it is not for productive use.

For more information, please visit the SAP Help Portal.

This is custom documentation. For more information, please visit the SAP Help Portal 1
6/7/2019

Persistent Memory
Persistent memory (non-volatile RAM, also referred to as Storage Class Memory) is supported in SAP HANA as a persistent
storage type.

Persistent memory (or NVRAM) is an emerging class of memory which combines the qualities of both DRAM and Flash storage
and bridges the gap between disk storage and main memory. For the purposes of SAP HANA its most important characteristics
are that it is byte addressable like DRAM and can be treated by the CPU as RAM therefore offering fast read and write
performance; its latency characteristics are also very close to DRAM.

The latest information about this feature, such as hardware availability and operating system support, is provided in SAP Note
2618154 SAP HANA Persistent Memory (NVM).

The persistent storage functions as DRAM memory and is used speci cally for MAIN data fragments of the column store where
approximately 90% of the data of a table is held. In this way DELTA data can continue to be stored in DRAM (a relatively small
quantity of data requiring the fastest possible access) with the MAIN segment of a table in NVRAM. Note that if persistent
memory storage is enabled, data is still written to the data volumes but is simply ignored. After a system restart the main data
fragments saved in persistent storage are still available in memory and do not have to be reloaded. This storage type has no
impact on backup and recovery or high availability processes.

As with the data volume persistent storage feature, data is persisted on the basis of savepoints. In the case of non-volatile
memory storage, NVM blocks are constructed whenever the in-memory MAIN fragment is created and are kept consistent
according to HANA’s savepoints.

The key performance bene t that this will bring is in greatly accelerated start-up times so that data can be quickly reloaded into
memory and any system downtime can be minimized. Other bene ts may include higher memory capacities per server.

Performance differences of this storage type compared to DRAM due to higher latency are mitigated by features such as
hardware prefetchers. It is also possible to enable persistent memory storage for selected tables or for speci c columns of a
table so that a selective implementation of this storage type is possible (see Con guration below).

Installation

The persistent memory feature can be set up during system installation using the SAP HANA database lifecycle manager
(HDBLCM) which uses two parameters to, rstly, enable persistent memory (use_pmem) and secondly the pmempath
parameter to set the basepath (see Con guration below). For more information on lifecycle manager refer to the SAP HANA
Server Installation and Update Guide .

At the level of the Linux operating system, SAP HANA only supports DAX enabled (Direct Access) le systems.

Filesystem layout of persistent memory block storage

The directory speci ed as the basepath (see Con guration) is the root persistent memory storage directory beneath which
data for each savepoint is stored. The structure beneath the basepath is maintained by HANA and no attempt should be made
to modify this content. Multiple logical versions of blocks are saved and are organized in subdirectories named on the basis of,
for example, service name, Volume ID and current savepoint version. There are two subdirectory systems, one for data and one
for deletion requests: the memory storage persistence maintains a history of requests to delete blocks in a tombstones
directory parallel to the data directory. In the case of tombstone blocks the savepoint version relates to the savepoint when the
data block was requested for deletion.

Con guration

This is custom documentation. For more information, please visit the SAP Help Portal 2
6/7/2019
The default behavior for using persistent memory is determined automatically: the system tests for the DAX lesystem at the
de ned persistent memory basepath. If the hardware is installed and the basepath correctly con gured pointing to the
persistent memory mount then all tables will use persistent memory by default. The SAP HANA installer sets the persistent
memory basepath parameter if it is able to identify the DAX lesystem and if the user of the installation tool con rms the
usage; the basepath parameter can also be set manually if necessary.

This default behavior can be overridden at four levels in the sequence shown here:

4 Database Can be enabled or disabled by con guration parameter.

3 Table Can be enabled or disabled by SQL statement.

2 Partition Can be enabled or disabled by SQL statement.

1 Column Can be enabled or disabled by SQL statement.

This level of granularity offers a high degree of exibility: if persistent memory is applied at a certain level it is automatically
inherited at lower levels of the sequence but can also be overriden at lower levels.

At the highest con guration level (database), persistent memory is managed by setting the table_default con guration
parameter for the database as a whole. You can switch table_default to OFF to enable more selective persistent memory
storage at lower levels for particular tables and partitions.

At other levels persistent memory is managed at the SQL command line using the alter_persistent_memory_spec clause with
the CREATE / ALTER table commands. Here, we give examples to show how this can be applied at each level; refer to the SAP
HANA SQL and System Views Reference for full details of this clause.

Con guration Parameter: Basepath

As with the other data and log persistent storage volumes and also the fast restart option (tmpfs), the storage location
basepath for persistent memory storage must be de ned as a con guration parameter in the persistence section of the
global.ini le. Enter the basepath location in the following parameter:

Parameter basepath_persistent_memory_volumes

Short Location of NVRAM storage.


Description

Full Data for NVRAM-enabled tables or columns is stored at the location de ned in this parameter. Multiple locations can be
Description de ned here using a semi-colon as a separator (no spaces). Multiple paths correspond to NUMA nodes without any
ordering restriction in terms of NUMA node mapping, for example, for a four-NUMA node system:
"/mnt/pmem0;/mnt/pmem1;/mnt/pmem4;/mnt/pmem2

Type Text

Change Restart required (offline changeable only)

Default Blank

Con guration Parameter: Enable persistent memory storage

The table_default parameter is in the persistent_memory section of the indexserver.ini le.

Parameter table_default

Short Enable or disable persistent memory storage for the database generally.
Description

This is custom documentation. For more information, please visit the SAP Help Portal 3
6/7/2019

Parameter table_default

Full This parameter can be set to ON or OFF or DEFAULT (no explicit preference, follow the existing default behavior). The
Description setting applies for the complete database but can be overridden by settings applied at a lower level.

Change Online

Default DEFAULT

SQL Alter Persistent Memory Clause

Persistent memory can be enabled by SQL command using the alter_persistent_memory_spec clause with CREATE and ALTER
table. This can be used at any of the three levels - table, partition or column to enable or disable persistent memory storage
using the PERSISTENT MEMORY switch. The following examples illustrate this using CREATE TABLE.

Example 1: Create table with persistent memory storage enabled for the new table.

CREATE COLUMN TABLE PMTABLE (C1 INT, C2 VARCHAR (10)) PERSISTENT MEMORY ON

PERSISTENT MEMORY can be set to ON, OFF or DEFAULT meaning no preference.

Example 2: Create range-partitioned table with persistent memory storage for a selected partition (this is only valid for range
partitions):

CREATE COLUMN TABLE PMTABLE (C1 INT) PARTITION BY RANGE (C1) (


PARTITION ‘0’ <= VALUES < ’10’ PERSISTENT MEMORY ON,
PARTITION OTHERS PERSISTENT MEMORY OFF);

Example 3: Create table with persistent memory storage applied to selected columns of a table:

CREATE COLUMN TABLE PMTABLE (C1 INT PERSISTENT MEMORY ON, C2 VARCHAR (10), C3 INT PERSISTENT MEMORY

For ALTER TABLE a preference value is also required (in addition to the ON/OFF switch) to determine how the change will be
applied. This is the alter persistent memory preference clause which requires one (or more) of the following keywords:

IMMEDIATE - the change is applied immediately and the speci ed storage is populated.

DEFERRED - the speci ed storage will be populated at the time of the next delta merge or reload.

CASCADE - this keyword can be used at table level in addition to IMMEDIATE and DEFERRED to apply the change to all
lower levels of the hierarchy.

The following example shows this usage with ALTER TABLE and cascades the change immediately to partitions and columns of
the named table:

ALTER TABLE MYTABLE PERSISTENT MEMORY ON IMMEDIATE CASCADE

Unloading Tables from Memory


The standard UNLOAD statement and also table unloads executed implicitly by HANA services due to memory running low, do
not by default free the memory but simply remove the mapping of relevant data structures from the HANA service process
address space and the MAIN data fragment remains; this applies to both persistent memory and the fast restart option
(tmpfs). The con guration parameter table_unload_action in the [persistent_memory] section of the indexserver.ini le can be

This is custom documentation. For more information, please visit the SAP Help Portal 4
6/7/2019
used to control this unload behavior. The default value of the parameter is RETAIN but this can be set to DELETE in which case
MAIN data fragments are cleared from memory.

Regardless of the setting of this parameter, you can also use UNLOAD with the additional DELETE PERSISTENT MEMORY clause
to completely free memory, for example:

UNLOAD FRAOTABLE DELETE PERSISTENT MEMORY;

Monitoring Views
For full details of the monitoring views and values named here refer to the SAP HANA SQL and System Views Reference .

The following monitoring views show information about persistent memory in the PERSISTENT_MEMORY column:
M_CS_TABLES, M_CS_COLUMNS and M_CS_ALL_COLUMNS. This shows either TRUE (persistent memory is enabled) or FALSE.

At the level of tables (M_CS_TABLES) usage information is shown as PERSISTENT_MEMORY_SIZE_IN _TOTAL and
PERSISTENT_MEMORY_SIZE_IN _MAIN.

At the level of columns (M_CS_COLUMNS and M_CS_ALL_COLUMNS) usage information is shown in a series of columns
named: MAIN_PERSISTENT_MEMORY_SIZE_IN_* These columns show usage in the categories DATA, DICT, INDEX, MISC and
UNUSED. These column views also include STORED_IN_PERSISTENT_MEMORY and LOADED_FROM_PERSISTENT_MEMORY,
both TRUE/FALSE values.

Three monitoring views show full statistical details of persistent memory usage:

M_PERSISTENT_MEMORY_VOLUMES - capacity, usage and metadata of persistent memory volumes con gured per
NUMA Node.

M_PERSISTENT_MEMORY_VOLUME_DATA_FILES - metadata statistics about les created by SAP HANA services for
data storage on the persistent memory volumes.

M_PERSISTENT_MEMORY_VOLUME_STATISTICS - statistics of physical lifecycle events of blocks managed by SAP HANA


services on the persistent memory volumes.

Related Information
SAP Note 2618154
SAP HANA Server Installation and Update Guide
SAP HANA Fast Restart Option

This is custom documentation. For more information, please visit the SAP Help Portal 5

Das könnte Ihnen auch gefallen