AWS for SAP

How to back up Microsoft SQL Server databases for SAP with VSS Snapshots

Introduction

As you may have seen, AWS recently integrated the VSS application-consistent backup capabilities into AWS Backup In this blog post, we will talk about the possibility of running Microsoft SQL Server database consistent snapshot backups from within the AWS Backup console.

VSS (Volume Shadow Copy Service) is a feature provided by Microsoft Windows which ensures consistent backup operations without requiring you to shut down the application (in our case the SAP software stack).

The integration of VSS consistent backup within the AWS Backup console will give customers the capability to configure and display the scheduling, retention and backup status of several EC2 instances running SAP within a single page. Moreover, the VSS consistent backup operating system calls will be recorded within the logs of the MS SQL Server database engine which ensures full process traceability.

Solution Overview

1 – Prerequisites

Before you can take a consistent snapshot backup of a database, the VSS snapshots capability must be enabled on the EC2 instance.

As per this AWS blog, first you need to to install the VSS components (AwsVssComponents) using AWS System Manager on the target EC2 instance by calling the AWS-ConfigureAWSPackage document.

Select the proper run command (AWS-ConfigureAWSPackage):

AWS Systems Manager document list

 

AWS-ConfigureAWSPackage SSM document

 

Specify the parameter required to enable VSS snapshots (AwsVssComponents) and check the command completes:

AWS-ConfigureAWSPackage SSM document parameters

AWS-ConfigureAWSPackage SSM document output

 

Note: the same can be accomplished via the AWS CLI :

aws ssm send-command –document-name “AWS-ConfigureAWSPackage” –instance-ids “i-12345678” —parameters ‘{“action”:[“Install”],”name”:[“AwsVssComponents”]}’

 

2 – AWS Backup Configuration

 

After the VSS setup is completed, the AWS Backup console can be used to take consistent snapshot backups of EC2 instances that are running Microsoft SQL Server databases. Just ensure that you flag the advanced backup setting “Windows VSS” at the bottom of the page when creating an on demand backup:

 

Advance AWS Settings containing the Windows VSS flag

 

This setting can also be enabled in the backup plan for scheduled backups.

 

 

3 – Running a backup via AWS Backup

 

We can now run a backup either interactively or by scheduling it.

 

AWS Backup job status with Windows VSS setting enabled

 

As you can see, the overall application consistent system backup took 8 minutes for a 390 GB filesystem.

 

To ensure that the VSS call have been successfully triggered on the target EC2 instance, we can also check the database logs (in this case the overall runtime of VSS operations was 2 seconds):

 

SQL Management Studio VSS status logs

 

Backup status can be checked directly within SAP:

 

SAP Database Backup details from SAPGui

SAP Database Backup details from SAPGui

 

4 – Restore

 

The restore procedure relies on the standard AWS Backup functionalities, from the AWS Backup console we choose to restore option:

 

AWS Backup restore console

 

After selecting the right resource, we will be presented the list of successful backups available for restoring, simply select the most appropriate one and wait till the jobs completes:

Restore options (list of available recovery points)

Restore job output

This procedure can be also used to generate a new system, for example a sandbox or training environment which is refreshed regularly.

Conclusion

In this blog, we have shown how to configure a SAP application consistent backups for MS SQL Server databases on AWS through VSS integration in AWS Backup. More information on AWS Backup can be found in the following link .

Let us know if you have any comments or questions—we value your feedback.