Skip to main content
Pure Technical Services

Creating Data Snapshots with SAP HANA Studio

In order to create application consistent storage snapshots for SAP HANA databases it is important to note that this operation requires the database instance, operating system, and storage system to all be synchronized during execution. SAP HANA using the naming convention "Data Snapshot" for application consistent storage snapshots. 

Application consistent snapshots can be manually performed using SAP HANA Studio, a secure shell terminal (SSH) signed in with a user who has read/write and execute permissions to the SAP HANA data volume and the Pure Storage FlashArray web user interface. The process can also be automated using programmatic logic interfacing with HANA database SQL, secure shell bash commands, and Pure Storage Flash Arrays REST API or the associated software development kit (SDK).

The process for creating application consistent snapshots differs for systems deployed with multiple database containers (a system with a single tenant is still deployed as MDC), single containers, single host (scale up) and distributed host (scale out) systems.

Data snapshots are only supported by SAP from the SAP HANA 2.0 SPS04 release and onwards for systems with multiple tenants. 

SAP HANA Scale Up / Single Node deployment

Step 1. Verify the system type 

Using SAP HANA Studio connected to the system deployed with the SAP HANA Instance, navigate towards the configuration page.

SAP HANA Studio, Configuration Page.
clipboard_e11e7ae3f0967ddb8fd0479634d82ac5a.png

Expand global.ini and then further expand the multidb section. Look for the key mode and observe its value. If this value is “singledb” then the system is a single container and if the value is “multidb” the system is then set to be a multiple container system. 

In SAP HANA Studio the global.ini file is expanded.
clipboard_ec69b5eacd22889713a58b189d520d8bb.png
In SAP HANA Studio the multidb section under global.ini shows the system properties.
clipboard_eea0c7aa6a87ccfe3bce6572e164e07f9.png

Step 2. Connect to the correct database instance for the creation and management of storage snapshots

If the system is a single database container then ensure that under mode the Single container is selected, for a multiple container system ensures that Multiple containers is selected, and when available ensure that System database is the selected target to connect to. It is important to note that selecting Single container and the mode to connect to will still connect to the single tenant container.

Using SAP HANA Studio connect to a single container system. Using SAP HANA Studio connect to the System dataset on a system with multiple containers
clipboard_e3644253ef510e10ecfb1a5cee559ce02.png clipboard_ee1aabdfc24ac52614aabac08f6e2eb89.png
Connected to a single container system. Connected to a multiple container system.
clipboard_ea1cf26a333fa9fccb4fd6d57bf163d4f.png clipboard_e4d58df67e06d477093ceb1e462365644.png

Step 3. Prepare the system for a storage snapshot 

This can be done from the backup console or using the side menu by right-clicking on the Backup system folder and selecting Manage Storage Snapshot….

In SAP HANA Studio right click on the “Backup” system folder and select “Manage Storage Snapshot…”.
clipboard_e41de4bdc6ff3f1bcc6dfcb1bc3213edb.png

 

In SAP HANA Studio and the backup console, select the camera next to “Status of Currently Active Data Backup”.
clipboard_e81f8ce440fff62b39e72f4532bc65db3.png

 

Select Prepare and add a comment if needed, then press the OK button.
clipboard_e28e853f3c855e45cf6f08fee0ef4be80.png

 

Once the database snapshot is ready then the below will show in the backup console.
clipboard_ec8f96b61c87b8e23e7830665773ad497.png

 

Step 4. Retrieve the SAP HANA prepared storage backup ID using the SQL console in SAP HANA Studio 

Use the SQL console for the database instance the prepared snapshot has been created for and run the query:

 “SELECT BACKUP_ID, COMMENT FROM M_BACKUP_CATALOG WHERE ENTRY_TYPE_NAME = 'data snapshot' AND STATE_NAME = 'prepared'”

This will return the backup ID for the prepared snapshot, which is used in the FlashArray block device snapshot creation as a suffix to link the SAP HANA storage snapshot ID to the Volume snapshot.

In SAP HANA Studio right click on the instance and select “Open SQL Console”.
clipboard_edc07ad5e4f9c82d2fbf322c8741ca84d.png
In SAP HANA Studio execute the query to return the Backup_ID of the prepared database snapshot.
SELECT BACKUP_ID, COMMENT FROM M_BACKUP_CATALOG 
WHERE ENTRY_TYPE_NAME = 'data snapshot' 
AND STATE_NAME = 'prepared' 
The Backup ID is returned with any comments added to the entry, take note of the Backup_ID.
clipboard_eb4971bb864f0192d4dc6ace0fa8b05b9.png

Step 5. (Optional)Freeze the filesystem for the SAP HANA data persistence mount point 

Open a terminal (SSH or local to the system) and ensure the prompt is logged in as a user who has read, write and execute permissions on the SAP HANA data persistence mount point. The data persistence mount point can be identified by inspecting the global.ini persistence section for “basepath_datavolumes”. Take the value offered by the global.ini file and remove the database name from the path to only get the base path mount point (this assumes that the SAP HANA systems has been setup with a mount point and single volume each for log and data). We will then use the “fsfreeze” Linux utility to halt any IO to the volume and ensure consistency.

In SAP HANA Studio the persistence section under global.ini shows the system properties. find the "basepath_datavolumes" value. This is the filesystem location of the instances' data volume. 
clipboard_eefa4b75a726b6c48475670e8f70e7fe6.png
Freeze the filesystem of the data persistence mount point using the fsfreeze utility.
clipboard_ef3e56ee40a3ce24f80d41adabce1e2c9.png

 

Step 6. Take a snapshot of the block device on FlashArray 

This step is shown using the web-based graphical user interface to operate the FlashArray storage device. It is assumed the user can identify the block volume which matches the SAP HANA persistence data volume. In the user interface navigate to Storage, select the Volumes tab. Select the volume which corresponds to the SAP HANA persistence data volume under Volume Snapshots.

Pure Storage Flash Array Web Graphical User interface – Main page.
clipboard_efbd0cff7e362c2312af318fac3a6f55b.png
Select Storage and navigate to the “Volumes” section to view all volumes and snapshots.
clipboard_eea64b9fc1d33f2bf32b63bb13bf20040.png
Select the volume which matches the SAP HANA Data persistence volume and select the “+” next to Volume Snapshots.
clipboard_e1c77498778f5a888f185f767d6a5c679.png
Create the snapshot with the suffix “SAPHANA-<Backup_ID from SAP HANA prepared snapshot>.
clipboard_e2dc0c5cc42b265301f64704760d3d490.png
The snapshot is created and listed under the Volume snapshots.
clipboard_e9751f0fcb80872dece0379f12cff0cdd.png

 Step 7. (Optional) Unfreeze the filesystem for the SAP HANA data persistence mount point 

Open a terminal (SSH or local to the system) and ensure the prompt is logged in as a user who has read, write, and execute permissions on the SAP HANA data persistence mount point. The data persistence mount point can be identified by inspecting the global.ini persistence section for “basepath_datavolumes”. Take the value offered by the global.ini file and remove the database name from the path to only get the base path mount point (this assumes that the SAP HANA systems have been set up with a mount point and single volume each for log and data). We will then use the “fsfreeze” Linux utility to resume IO to the volume and allow the database to continue operation.

Unfreeze the filesystem of the data persistence mount point using the fsfreeze utility.
clipboard_e3ab3410711d89cb57ca6aea2ffcb1f43.png

 

Step 8. Confirm or Abandon the data snapshot

Confirm or abandon the snapshot in SAP HANA studio, allowing the backup to be marked as valid or invalid. If something has not operated as expected then the snapshot should be abandoned. To confirm the snapshot an External Backup ID must be supplied, the Backup_ID originally offered by the prepared snapshot and used as a suffix for the Block volume storage snapshotr is used for the value.

Confirm the Snapshot and supply the External Backup ID (Use the volume snapshot serial number), and press OK.
clipboard_e2d750c9930bf5f6ee4d13468bdf04b43.png
The backup now shows in the backup catalogue as complete.
clipboard_e0a3b71b25a993b9863404a398200ee13.png

 

SAP HANA Scale Out/Multi-Node deployment 

Step 1. Verify the System Type 

Using SAP HANA Studio connected to any one of the systems deployed with the SAP HANA Instance, navigate towards the configuration page.

SAP HANA Studio, Configuration Page.
clipboard_ef193ec562f3fea3586f66948b9d0d7b9.png

Expand the global.ini filename and then further expand the multidb section. Look for the key mode and observe its value. If this value is “singledb” then the system is a single container and if the value is “multidb” the system is then set to be a multiple container system. 

In SAP HANA Studio the global.ini file is expanded.
clipboard_ebecab6d66378eb85147cf22c0b8f2aeb.png
In SAP HANA Studio the multidb section under global.ini shows the system properties.
clipboard_eea85169c4b05620ba9e2a304685b8d3d.png

 

Step 1a. If Database is "multidb" Find the Host on which the SYSTEMDB is Running 

To identify the host which the SYSTEMDB is running on the nameserver and other non-persistent services needs to be identified. As per the SAP Knowledgebase article (201244) the most notable differences between the list of services running on the SYSTEM DB and tenant database are the nameserver and other non-persistent services are available on the SYSTEMDB. The SYSTEMDB will only ever exist on a single host in a scale out/distributed system environment and cannot be distributed across multiple hosts.

To investigate the services on each system in a scale out/distributed environment the landscape view and services tab is inspected to provide the required information.

The host on which the “nameserver” service and “master” detail are shown, is the system on which the SYSTEMDB is running.

In SAP HANA Studio, under Landscape for the deployment, the SYSTEMDB is running on SHN3
clipboard_e2691bdb3976fa4ebe70c75c794ca209b.png

Step 1b. Identify which Host each Storage Device is Mounted to at that Point in Time

The volumes and services used can be identified by selecting the volumes view and viewing the information for the “indexserver” service where “Data Volume Size” has a value. Each data persistence mount point for the scale out/distributed environment will typically be in the form “{BASE_PATH}/Data/<Database Name>/mntXXXXX” but this can vary between each deployment.

In SAP HANA Studio the relevant volumes can be identified under the “Volumes” view. In this case the mount points and hosts they are attached to are:

SHN1: /hana/data/SH1/mnt00002

SHN2: /hana/data/SH1/mnt00003

SHN3: /hana/data/SH1/mnt00001

clipboard_ef172f7fa5aa29af35a02b2dd298a24fe.png

Step 2. Connect to the Correct Database Instance for the Creation and Management of Storage Snapshots 

If the system is a single database container then, ensure that under mode the Single container selection is selected. For a multiple container system, confirm that Multiple containers is selected, and when available ensure that System database is the selected target to connect to. It is important to note that selecting Single container and the mode to connect to will still connect to the single tenant container.

Using SAP HANA Studio connect to a single container system. Using SAP HANA Studio, connect to the System dataset on a system with multiple containers.
clipboard_eb8726b4ba01e2d5d3716c68575556a3b.png clipboard_e1122aed950ff88bd10026c949359dd75.png
Connected to a single container system. Connected to a multiple container system.
clipboard_ebe4e1ae1ed5103b5d2880220bcbd8b3f.png clipboard_ea81c0e8ba64d69e6b604f72bfc0abef7.png

Step 3. Prepare the System for a Storage Snapshot 

This can be done from the backup console or using the side menu by right-clicking on the Backup system folder and selecting Manage Storage Snapshot….

In SAP HANA Studio right click on the “Backup” system folder and select “Manage Storage Snapshot…”.
clipboard_e41de4bdc6ff3f1bcc6dfcb1bc3213edb.png

 

In SAP HANA Studio and the backup console, select the camera next to “Status of Currently Active Data Backup”.
clipboard_e81f8ce440fff62b39e72f4532bc65db3.png

 

Select Prepare and add a comment if needed, then press the OK button.
clipboard_e28e853f3c855e45cf6f08fee0ef4be80.png

 

Once the database snapshot is ready then the below will show in the backup console.
clipboard_ec8f96b61c87b8e23e7830665773ad497.png

 

Step 4. Retrieve the SAP HANA Prepared Storage Backup ID Using the SQL Console in SAP HANA Studio 

Use the SQL console for the database instance the prepared snapshot has been created for and run the query:

 SELECT BACKUP_ID, COMMENT FROM M_BACKUP_CATALOG WHERE ENTRY_TYPE_NAME = 'data snapshot' AND STATE_NAME = 'prepared'

This will return the backup ID for the prepared snapshot, which is used in the FlashArray block device snapshot creation as a suffix to link the SAP HANA storage snapshot ID to the Volume snapshot.

In SAP HANA Studio right click on the instance and select “Open SQL Console”.
clipboard_edc07ad5e4f9c82d2fbf322c8741ca84d.png
In SAP HANA Studio execute the query to return the Backup_ID of the prepared database snapshot.
SELECT BACKUP_ID, COMMENT FROM M_BACKUP_CATALOG 
WHERE ENTRY_TYPE_NAME = 'data snapshot' 
AND STATE_NAME = 'prepared' 
The Backup ID is returned with any comments added to the entry, take note of the Backup_ID.
clipboard_eb4971bb864f0192d4dc6ace0fa8b05b9.png

Step 5. (Optional) Freeze the filesystem for the SAP HANA Data Persistence Mount Points on Each Host

Use the data volume mount points from Step 1b in this step.

Open a terminal (SSH or local to the system) and ensure the prompt is logged in as a user who has read, write, and execute permissions on the SAP HANA data persistence mount point. The data persistence mount points and each host they are attached to were identified in step 1b. The “fsfreeze” Linux utility will be used to halt any IO to the volume and ensure consistency.

Freeze the filesystem of each data persistence mount point using the fsfreeze utility.

clipboard_e7bf4d9e0fc4b02307f1985ca5abc1fc4.png

clipboard_e1bcb5bbb1717e7c7b8484f8efb663f61.png

clipboard_ec410bcc2f55a4ba2a8502caf4eaf7f65.png

Step 6. Take a Snapshot of each Block Storage Device on FlashArray 

This step is shown using the web-based graphical user interface to operate the FlashArray storage device. It is assumed the user can identify the block volume which matches each SAP HANA persistence data volume. In the user interface navigate to the “Storage” section, select “Volumes”. Select the volume which corresponds to each SAP HANA persistence data volume.  Under “Volume Snapshots”.

Pure Storage Flash Array Web Graphical User interface – Main page.
clipboard_ea1673333d3f8781efe921fe22030d6f9.png
Select Storage and navigate to the “Volumes” section to view all volumes and snapshots.
clipboard_eaba39be57006f83226a12b9553cba6eb.png
Select the volume which matches the SAP HANA Data persistence volume and select the “+” next to Volume Snapshots.
clipboard_ea27cc23cd440ed9d4cc2778040d3edbb.png
Create the snapshot with the suffix “SAPHANA-<Backup_ID from SAP HANA prepared snapshot>-Host-<Host>-Path-<mounted Path At time of Snapshot>.
clipboard_ea218f2da6f368a06ae64f45313e08abe.png
The snapshot is created and listed under the Volume snapshots.
clipboard_e3b899f089057e7f9590cb8e6135fee85.png

Step 7. (Optional) Unfreeze the filesystem for each SAP HANA Data Persistence Mount Point

Open a terminal (SSH or local to the system) and ensure the prompt is logged in as a user who has read, write, and execute permissions on each SAP HANA data persistence mount point. We will then use the “fsfreeze” Linux utility to resume IO to the volume and allow the database to continue operation.

Unfreeze the filesystem of each data persistence mount point using the fsfreeze utility.

clipboard_e792debf72773895ab177b50a3c6b71e2.png

clipboard_e8fa8217ccb3da25e1c539060c6b15139.png

clipboard_eb5fda70c96633c0700a5ac0e1f196910.png

Step 8. Confirm or Abandon the Data Snapshot 

Confirm or abandon the snapshot in SAP HANA studio , allowing the backup to be marked as valid or invalid. If something has not operated as expected then the snapshot should be abandoned. To confirm the snapshot an External Backup ID must be supplied, the Backup_ID originally offered by the prepared snapshot and used as a suffix for the Block volume storage snapshot is used for the value.

Confirm the Snapshot and supply the External Backup ID, and press OK.
clipboard_e9c9526e814b1874effe57f60814ac00b.png
The backup now shows in the backup catalog as complete.
clipboard_ef1fb3317cf42ab78b77cc1f245693585.png