Oracle Database 21c - Persistent Memory Database – Eliminate Latency with Directly Mapped Buffer Cache

April 14, 2022 | 10 minute read
Maruti Sharma
Senior Principal Product Manager
Text Size 100%:


Oracle Database 21c Persistent Memory Database maps the database buffer cache directly onto Persistent Memory, which means the buffer cache and storage become one in the same. The majority of input/output operations simply disappear because the database directly uses data that resides in storage and operates on that data in the same manner it uses data in memory in the database buffer cache. The Directly Mapped Buffer Cache is the defining feature of Oracle Database 21c Persistent Memory Database and embodies the true promise of Persistent Memory.


Oracle Database 19c also supports Persistent Memory as outlined in our previous blog (Oracle Database 19c Running @Memory Speed) but in a quite different manner. Oracle Database 19c allows database files to reside on Persistent Memory, which gives the benefit of dramatically improved I/O performance. Oracle Database 21c eliminates I/O by mapping the buffer cache into the Persistent Memory contents, allowing the database to bypass the I/O layer entirely.  Of course, these features are also quite different from Exadata, which uses Persistent Memory in the storage-side. Both Oracle Database 19c (using OMS) and Oracle Database 21c Persistent Memory Database use server-side Persistent Memory.


In this blog, we will go through the process of setting up PMEM devices and creating an Oracle database on Persistent Memory. We will explore how Oracle databases can be created from scratch (using the CREATE DATABASE command) or using RMAN ACTIVE DUPLICATE command to bring an active database from another server.


What is Persistent Memory

Persistent Memory is a solid-state, high-performance, byte-addressable technology (like DRAM) that resides on the memory bus, giving PMEM the access and speed characteristics of DRAM. Memory (or DRAM) is ephemeral, and storage (such as Disk or Flash) has traditionally been required for persistent copies of data. For any computer application to work, the application data stored in HDD/SSD must be loaded in memory, introducing latency into the process.

Persistent Memory, on the other hand serves a dual purpose. Persistent Memory is a storage device that sits on the memory bus and can be used for memory expansion or adding storage to a server.

Persistent Memory Module
Persistent Memory Module

With the advancements in infrastructure technology (compute, storage, memory, networking etc.), and fast running database systems, there has always been a struggle to optimize database workloads and improve performance. Increasing data volumes have taken a big toll on bringing the data (IO system) to the compute for processing, and disks or flash (persistent storage) performance have been a bottleneck. Although we have seen huge advancement in storage technologies in the hardware itself (mechanical to flash to NVME) and clever technologies on top of them (cache layer built on top of storage devices), IO has always been a bigger bottleneck.

In the later part of the blog, we will show how to set up an existing Oracle database on a Persistent Memory store. Let’s first look at the memory storage hierarchy.

Memory Storage Hierarchy

In the below diagram, you can see where Persistent Memory sits in the memory and storage hierarchy and the latency to bring data to the compute.


How does Oracle utilize Persistent Memory?

Persistent Memory with Oracle databases can be utilized in three different ways.

  1. Persistent Memory Database using Oracle Memory Speed (OMS). This feature is available starting Oracle Database 19c. This feature was covered in the blog here.


  1. Persistent Memory Database with Directly Mapped Buffer Cache (available from Oracle Database 21c onwards) – Accelerates DBMS operations, I/O is done via memory copy and/or direct access. Data is accessed directly from PMEM as an integral part of the database buffer cache. Persistent Memory File-Store is tightly coupled with the database. (we will talk about the capability in this blog)


  1. Storage side (Exadata) – Combined with RDMA (Remote Direct Memory Access), Oracle database access data cached in PMEM on the storage side of Exadata. Read more about Persistent Memory magic in Exadata.


In this blog, we will focus on the Directly Mapped Buffer Cache feature which fully utilizes the potential of persistent memory. So, what is the Directly Mapped Buffer Cache? Let us find out.

Introduction to Directly Mapped Buffer Cache

Typically, when data is read storage, it is necessary to copy data blocks into DRAM (Dynamic Random-Access Memory) regardless of whether the underlying storage device is a Hard Disk or Flash Storage or even Persistent Memory (as we have seen with Oracle Database 19c using OMS). Using the Directly Mapped Buffer Cache feature of Oracle Database 21c, Oracle Database accessed data directly from the PMEM device, rather than copying the data into buffer cache (DRAM), eliminating the majority of I/O operations entirely. With Directly Mapped Buffer Cache, database files on PMEM become part of the database buffer cache as we will see in the set up.

Avoiding Fractured Blocks (aka torn writes) and Data loss with Persistent Memory

Persistent Memory, like DRAM, is byte addressable rather than block addressable as with conventional disk or Flash storage. With PMEM, data is persisted 8-bytes at a time rather than in increments of 4,096 bytes with the typical O/S pages or storage sector sizes. If an Oracle Database writes a block of data (8192 bytes = 8K), the data would be persisted into PMEM in 1024 chunks (1024 chunks of 8 bytes each). Any disruption (power failure for example) during the time of this write, can leave data “fractured” or “torn” with inconsistent data in some of those 1024 chunks (old and new data). Both the 19c (OMS) and Directly Mapped Buffer Cache (21c) solutions eliminates this “fractured” block problem. Oracle accomplishes this internally by doing an out of place copy with metadata update to reference the new block only after the entire block is written successfully written.

While database blocks are accessed directly in PMEM as part of the Directly Mapped Buffer Cache, Oracle copies blocks into DRAM when they are modified. All changed blocks are written by the Database Writer (DBWR) process, including retaining copies of prior block versions in rollback segments for read consistency purposes. In any well-tuned system, writing of blocks is done asynchronously from the transaction and is not latency sensitive. Of course, writing of REDO blocks is latency sensitive, so REDO is written directly to PMEM in Oracle Database 21c Persistent Memory Database. Oracle Database 21c includes logic to prevent fracturing (or tearing) of REDO blocks to guard against corruption of REDO as well.

Let us get into details of how to configure Oracle Database with Persistent Memory using Directly Mapped Buffer Cache. We will start with basic requirements including, software versions and then move on to create PMEM File store followed by creating an Oracle database.

Requirements and guidelines for Directly Mapped Buffer Cache


    • An Intel Cascade Lake or Ice Lake based server or later.
    • Persistent Memory devices (PMEM) in each socket capable of memory interleaving.
    • Oracle Linux with Huge-Page support.
    • A DAX capable (DAX) file system such as XFS.
    • Oracle version 21.3 with patch – 33516412 (DBRU

bash-4.2$ $ORACLE_HOME/OPatch/opatch lspatches

33907983;MERGE ON DATABASE RU OF 33339444 33486067

33516412;Database Release Update: (33516412)

Persistent Memory Filestore:

Oracle Database 21c Persistent Memory Database includes the integrated Persistent Memory Filestore to store all files.



                Directly Mapped Buffer Cache feature is only supported for a single instance Oracle database deployment, not with Oracle Real Application Clusters. In addition, each PMEM Filestore can only contain Oracle datafiles from one Oracle Database. Multiple PMEM Filestores are required to deploy multiple databases on a single server.


Let us start setting up:

  1. Setup environment variables (tst21pm is our target instance on PMEM Filestore)

export ORACLE_HOME=/u01/app/oracle/product/21.5

export ORACLE_BASE=/u01/app/oracle


export PATH=$ORACLE_HOME/perl/bin: $PATH


export TWO_TASK=

export ORACLE_SID=tst21pm


  1. The following command lists some of the XFS file systems created using PMEM devices

df -hT


/dev/pmem0p1                 xfs       1.5T  1.4T   57G  97% /mnt/pmem12

/dev/pmem1p1                 xfs       1.5T  1.4T   57G  97% /mnt/pmem13


  1. Create sample init.ora (initialization file) to start up the instance






*.db_file_name_convert='/u01/app/oracle/oradata/TSTLOCAL’, ‘/u01/app/oracle/oradata/TST21PM'

*.log_file_name_convert=’ /u01/app/oracle/oradata/TSTLOCAL’, '/u01/app/oracle/oradata/onlinelog/TST21PM', ‘/u01/app/oracle/oradata/onlinelog/TSTLOCAL’, ‘/u01/app/oracle/oradata/onlinelog/TST21PM’





*.dispatchers='(PROTOCOL=TCP) (SERVICE=tst1smplXDB)'













  1. Make sure /pmemfs/TST21PM directory exists, and user oracle has proper permissions to it.
  2. Edit /etc/fuser.conf file to add (or uncomment if one already exists)

‘user_allow_other’ option

$ cat /etc/fuser.conf




  1. Linux userid that owns Oracle database server binary (located at $ORACLE_HOME/bin/oracle) must have execute permissions for /bin/fusermount program. This can be accomplished in different ways, such as by changing file permissions, adding this user to the Access Control List associated with /bin/fusermount, etc.

Please note that /bin/fusermount program has setuid bit set, and it is typically owned by root.

$ ls -l /bin/fusermount

-rwsr-x---. 1 root root 32584 Sep  6  2016 /bin/fusermount


$ chmod o+rx /bin/fusermount

$ ls -l /bin/fusermount

-rwsr-xr-x. 1 root root 32584 Sep  6  2016 /bin/fusermount


  1. Create SPFILE

Create a spfile (from the initial init file we created in step 3). The reason for that is when "CREATE PMEM FILESTORE" command is run, spfile will record the mountpoint

for the PMEM device for subsequent startup of the instance. In case you chose to use init file instead of spfile, you will have to manually specify the parameter pmem_filestore and its mapping.


SQL> CREATE spfile=’/u01/app/oracle/dbs/spfiletst21pm.ora’ from pfile=’/u01/app/oracle/dbs/inittst21pm.ora’;


  1. SQL > startup nomount

SQL > create pmem filestore TST21PM MOUNTPOINT '/u01/app/oracle/oradata/TST21PM' BACKINGFILE '/pmemfs/TST21PM/' SIZE 80G;


PMEM filestore created.


In alert log you will see following messages:


PDBID-1 OFS:TST21PM of type fsdirect CREATED

PDBID-1 OFS:TST21PM MOUNTED at /u01/app/oracle/oradata/TST21PM/ w/type fsdirect


PDBID-1 OFS:/u01/app/oracle/oradata/TST21PM/ UNMOUNTED

PDBID-1 OFS:TST21PM of type fsdirect DESTROYED


Creating PMEM Filestore with the following parameters:

  Backing Storage    :/pmemfs/TST21PM/

  Filestore Name     :TST21PM

  Block Size         :8192

  Filestore Size     :85899345920

  Auto Extend Size   :0

  Max Size           :85899345920

  InternalVsize      :167503724544

  InternalRootSz     :10485760


PMEM Filestore is mounted with the following parameters:

  Backing Storage    :/pmemfs/TST21PM/

  Filestore Name     :TST21PM

  Block Size         :8192

  Filestore Size     :86769664000

  Auto Extend Size   :0

  Max Size           :86769664000

  InternalVsize      :167503724544

  InternalRootSz     :10485760


PDBID-1 OFS:TST21PM of type fsdirect CREATED

PDBID-1 OFS:TST21PM MOUNTED at /u01/app/oracle/oradata/TST21PM/ w/type fsdirect


Completed: create pmem filestore TST21PM MOUNTPOINT '/u01/app/oracle/oradata/TST21PM' BACKINGFILE '/pmemfs/TST21PM/' SIZE 80G


spfile is updated with the following parameter


SQL> show parameter pfile


NAME                             TYPE        VALUE

------------------------------------ ----------- -------------------------------------------------

spfile                               string      /u01/app/oracle/dbs/spfiletst21pm.ora

SQL> show parameter pmem

NAME                        TYPE        VALUE

------------------------------------ ----------- --------------------------------------------------

pmem_filestore      string      /u01/app/oracle/oradata/TST21PM, /pmemfs/TST21PM/


  1. Make sure you can connect to source database, and to the PMEM DB (that we are going to create) using the same SYS password. You may want to create static listener for the PMEM DB so that you can connect to it using SYS in nomount mode.
  2. I will use RMAN ACTIVE DUPLICATE command to clone the source database to the PMEM DB.

I have a script that I will use to run for the DUPLICATE command. tstlocal is the source database running on a different host. tst21pm is the target database that will be a PMEM database.


connect target sys/<password>@tstlocal;

connect auxiliary sys/<password>@tst21pm;






















  1. Once the database is cloned, let us validate the data files and their destination file system.

To validate datafiles are located on the right mount point, query the name and size of the datafiles.


Resources and Further Reading

Oracle Database 19c Running @Memory Speed

Persistent Memory Primer – By Chris Craft


                In this blog, we have seen how we can clone an Oracle database running on a different server to PMEM Filestore. From the memory-storage hierarchy diagram earlier in the blog, we can see that PMEM devices are about ~3000x faster than SSDs. We have significantly reduced the IO latency when our database run on an PMEM device. With Directly Mapped Buffer Cache, the data is read directly from the PMEM Filestore, rather than buffer cache as we see in traditional stores or even in OMS solution of PMEM. As we see in Memory-Storage hierarchy, DRAM is still more efficient compared to PMEM, this solution also uses intelligent caching policies where, frequently accessed blocks are still cached in DRAM. Both the OMS and Directly Mapped Buffer Cache solution of PMEM database ensures that updates to Oracle data blocks are always atomic and free from fractured block issues. You may wonder about the capability of key features of Oracle database - Scalability and Availability. PMEM databases can scale horizontally using Oracle database Sharding capability. Availability of databases can be achieved by using local Data Guard or remote site data guard set up.

Maruti Sharma

Senior Principal Product Manager

Maruti Sharma is a Senior Principal product manager for mission critical database systems at Oracle with over 25 years of software experience focused on relational databases, Big Data, NoSQL data stores, server programming, microservices. Prior to joining Oracle, Maruti was a Chief Architect and Associate Technical Fellow at The Boeing Company where he was responsible for managing everything data related.

Previous Post

Steps to Enable Exadata Cloud Service Monitoring using OCI Performance Hub

Sathis Muniyasamy | 9 min read

Next Post

Introducing Exadata Cloud Infrastructure X9M

Tammy Bednar | 5 min read