Backup For MS-SQL Server Databases
Backup For MS-SQL Server Databases
Table of contents
Executive summary ..............................................................................................................................................................2
Introduction to Microsoft SQL Server backup and restore............................................................................................... 3
HP StoreOnce Backup systemskey features and benefits ..........................................................................................4
Introducing HP StoreOnce Catalyst.................................................................................................................................4
HP StoreOnce Plug-in for Microsoft SQL Server ...............................................................................................................4
Configuration guidance ....................................................................................................................................................5
Creating multiple backup copies .....................................................................................................................................7
Using Federated Catalyst stores .....................................................................................................................................7
Using Fibre Channel connection to Catalyst stores ......................................................................................................7
Password protected access to Catalyst stores for added security.................................................................................7
HP StoreOnce Plug-in for Microsoft SQL Server in action ................................................................................................9
Backup with MIRROR TO clausemonitoring performance .................................................................................... 10
Automating daily tasks .................................................................................................................................................. 13
Viewing backups on the Catalyst store ....................................................................................................................... 14
Point-in-time restore..................................................................................................................................................... 14
Performance ....................................................................................................................................................................... 15
Known limitations .............................................................................................................................................................. 18
Summary ............................................................................................................................................................................. 19
Appendix AHP StoreOnce Catalyst overview .............................................................................................................. 19
Supported device types ................................................................................................................................................. 19
StoreOnce Catalyst terminology and summary features ......................................................................................... 19
Executive summary
Organizations worldwide run Microsoft SQL Server databases to support their mission-critical applications. The two main
concerns from a backup perspective in SQL Server database environments are high data growth rates and shrinking backup
windows. HP StoreOnce Backup appliances provide highly efficient deduplicating storage that is accessed using virtual tape,
NAS, CIFS and NFS, and HP StoreOnce Catalyst device types. HP StoreOnce Catalyst is purpose-designed for backup and
recovery workflows, without the overheads and limitations of general purpose protocols, and as a result is the highest
performing and most configurable of these device types. Using a Catalyst-capable backup application software or an
HP StoreOnce Plug-in, the reduction of duplicate backup data can be executed at the database server (source-side
deduplication) to reduce network bandwidth requirements for backup and enable faster backups. For added data protection,
deduplication-optimized replication of backups can also be configured.
The HP StoreOnce Plug-in for Microsoft SQL Server enables direct backup of SQL Server databases to Catalyst stores with
faster throughput and greater deduplication ratios than other backup solutions, thus helping to solve the issues associated
with high data growth rates and shrinking backup windows for Microsoft SQL Server databases.
In many organizations, a key role of the MS SQL Server database administrators (DBAs) is to manage the availability of the
databases. A DBA who is responsible for database availability should be able to rely on backups as the last resort, during
any disaster event, to restore lost or corrupt data. Failing to have reliable backups can cost the DBA his or her job. To avoid
this situation, the DBA should have total visibility into the control of backup and disaster recovery (DR) processes without
involving the backup administrator. The StoreOnce Plug-in for MS SQL empowers DBAs to manage the entire backup,
recovery, and DR process using standard MS SQL BACKUP and RESTORE T-SQL commands. Today, MS SQL DBAs generally
use local disks or CIFS shares as the target device for backups. This paper describes the many advantages of using
HP StoreOnce Catalyst as the target device for MS SQL Server backups. In summary, these benefits are:
Improved backup throughput by means of:
Usage notes:
When using the StoreOnce Plug-in for MS SQL Server note that consideration needs to be given to the additional CPU
requirements on the MS SQL Server to support the StoreOnce Catalyst Plug-in, and if configured, source-side
deduplication. When using source-side deduplication, a large part of the deduplication is done on the SQL Server itself.
An HP StoreOnce Catalyst license must be purchased and installed on the StoreOnce appliance hosting the target Catalyst
The HP StoreOnce Plug-in for Microsoft SQL Server concept is shown in figure 1.
Figure 1. HP StoreOnce Plug-in concept
Target audience: This white paper is intended to assist MS SQL Server administrators who are responsible for backups as
part of their responsibility for database availability. They prefer generally to use the standard MS SQL Server tools such as
SQLCMD or SQL Maintenance Tasks to back up directly to disk or NAS share and maintain total control of the entire MS SQL
Server environment. However, this may not make optimal use of the backup storage or backup window available.
Using the HP StoreOnce Plug-in for Microsoft SQL Server, the DBA can achieve improved backup performance, using lower
bandwidth with higher deduplication ratios to save on network and storage costs and to get the backups finished faster.
This white paper describes how this technology works and how to take advantage of it.
Assumptions: The bulk of this white paper assumes a working knowledge of Microsoft SQL database structures,
BACKUP/RESTORE DATABASE/LOG T-SQL syntaxes, and HP StoreOnce Catalyst. For those not familiar with MS SQL Server
BACKUP/RESTORE syntaxes, the user guide lists the available options.
Figure 2 shows the two modes of operations that underpin this technology when the plug-in is installed on the MS SQL
Server. Referred to as target-side deduplication (high-bandwidth backup) or source-side deduplication (low-bandwidth
backup), both modes feature intelligent MS SQL Server data processing where the format of the MS SQL Server backup
stream is understood and optimized by the plug-in to increase space saving and backup speed. In target-side deduplication,
all the deduplication processing takes place on the HP StoreOnce appliance with all the backup data transferred across the
network. In source-side deduplication, (low-bandwidth mode) the majority of the deduplication process is performed on the
MS SQL Server itself and only unique chunks of backup data are sent over the network to the HP StoreOnce appliance, with
significant savings on network bandwidth.
HP recommends using the low-bandwidth mode on Catalyst stores used with the HP StoreOnce Plug-in for MS SQL Server.
Using low-bandwidth mode deliver significantly faster backup and improved space savings for many use cases.
Figure 2. HP StoreOnce Plug-in for MS SQL Serverhow it works
Configuration guidance
The HP StoreOnce Plug-in for Microsoft SQL Server is optimized to back up large databases using multiple data files located on
different partitions or mount points, as recommended by the Microsoft best practices for mission-critical databases.
The plug-in automatically splits the backup stream generated by the SQL Server into several Catalyst items, all copied in
parallel to the StoreOnce appliance. By default, the plug-in creates N+2 output items in the Catalyst store, where N is the
number of data files in the database. Unless the backup targets a StoreOnce appliance with a maximum concurrent stream
count less than N+2, it is recommended to use the default value. Should you need to decrease the value, for example, to
back up a StoreOnce virtual storage appliance (VSA), the parameter maxstreams=n can be specified. Note, however, that a
lower value does impact negatively the backup performance and deduplication ratio.
To increase backup throughput performance and storage space savings, the following guidelines should be followed:
Set the Catalyst store with Primary (default) transfer policy: Low bandwidth (Be careful, its not the default when
creating new Catalyst stores). This mode enables the deduplication load to be split between the database server and the
StoreOnce appliance. The amount of data to be transferred between the SQL Server and the StoreOnce application is
consequently decreased significantly. The low-bandwidth mode also makes possible internal optimization for better
performance not available with the high-bandwidth mode.
Run the SQL backup with a large value of the SQL parameter maximum transfer size, for example,
WITH MAXTRANSFERSIZE=4194304.
Do not specify any value for the parameter maxstreams. Leave the plug-in to compute a default value.
Backup throughput
Figure 3. Effect of multiplexing on throughput using a SQL Server database with 8 data files
0
1
7
8
9
10
Full backups
maxstreams=6
11
12
13
14
maxstreams=3
Note
The plug-in does not support more than one output device as it already splits the stream into several Catalyst items.
Therefore, do not attempt to specify multiple output devices to the SQL BACKUP command.
The first backup of a database is generally slower than subsequent backups. This is because it is likely that all or most of the
chunks that make up the first backup do not exist in the Catalyst store, so have to be compressed and transmitted to the
StoreOnce appliance. As more backups are written to the Catalyst store, it is likely that more duplicate chunks can be
identified so fewer unique chunks have to be compressed and transmitted making the backups faster. It is the same when
backup copies are configured. The first time a copy is made it is likely that the copy requires more data to be transmitted
and takes significantly more time than subsequent copies.
Figure 4. The StoreOnce appliance administrator creates a Client (SQL_DBA) for the database administrator to use and enables access to
the backup target (Store_1)
$FileString = C:\credentials.txt
$Credential = Get-Credential
# With the following command, we get the username in a secure string
$username = convertto-securestring $Credential.username -asplaintext -force
$password = $Credential.Password
# To save username and password to file
$username | ConvertFrom-SecureString | Set-Content $FileString
$password | ConvertFrom-SecureString | Add-Content $FileString
Note
If the DBA loses the Windows Credential Manager account, the username and password are not recoverable. In this case the
script 1 will need to be rerun.
8
$FileString = C:\credentials.txt
# Get credentials from file
$credentials = Get-Content $FileString | ConvertTo-SecureString
# Separate user name and password (username is line 1 whereas password is stored in line 2)
$username = convertfrom-securestring -securestring $credentials[0]
$password = convertfrom-securestring -securestring $credentials[1]
# Convert username and password which are currently stored as secure string into plain text.
$PlainTextUserName =
[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR( (ConvertToSecureString $username) ))
$PlainTextPassword =
[Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR( (ConvertToSecureString $password) ))
# This script needs to be in the folder where HPStoreOnceForMSSQL.exe is located
.\HPStoreOnceForMSSQL.exe -backup BACKUP DATABASE [master] TO
STORE='$PlainTextUserName`:$PlainTextPassword@123.45.67.89/Store_1' WITH MAXTRANSFERSIZE=4194304,
CHECKSUM
Note
The following examples contain performance information that was achieved with the following configuration:
Host details:
HP ProLiant Server DL380 G6 with Windows 2008 R2 Enterprise edition
2.33 GHz CPU
32 GB RAM
QLogic 8 Gb Fibre Channel HBA
Emulex NC552SFP 10GbE NIC
SQL Server 2012
Storage details:
HP 8400 Enterprise Virtual Array (EVA)
Switch details:
HP SN6000 Fibre Channel Switch
HP 5920AF-24XG 10GbE Ethernet switch
10
: SuperCADB
Type
: DB_FULL
Name
: S=CBCSRV19;I=DEFAULT;DB=SuperCADB;TS=2014-10-16T13:56:58.151;T=DB_FULL;V=1;ID=6BC84D2E7AAB-4D9A-8C9F-07AA6C418789;TAG=SpecialBackupBeforeMigration;
Copied
: 51992.198 MB
Stored
: 348.065 MB
: 51992.647 MB
Stored
: 259.116 MB
11
Since the parameter maxstreams has not been specified in the command line, the plug-in automatically selected one
stream or item per data file in the DB, plus two control streams or items. These Catalyst items are all accessed in parallel
during backups, restores, or Catalyst copies. These Catalyst objects are visible on both the first and the second StoreOnce
under the tab Item Summary.
12
Figure 8. Items stored in an HP StoreOnce Catalyst store, as viewed in the StoreOnce appliance graphical interface
In addition to this, the backup to the first StoreOnce leaves traces in the tab Data Jobs; and the Catalyst copies leave trace
in the tabs Outbound Copy Jobs and Inbound Copy Jobs, respectively on the first and second StoreOnce.
Regular backupsTypically, database backups are run once per day, and Transaction Log backups are executed once
every n hours.
2.
Deleting expired backupsUsually, expired backups are deleted after a new successful backup.
These two tasks can be automated with scripts, scheduled at regular intervals using the Windows Scheduler. To write the
scripts, it is recommended to use PowerShell, which includes all the needed components:
The assembly Microsoft.SqlServer.SMO can be used to enumerate the databases running under a specific server
or instance.
The SMO object pointing to a database has many properties that can be used to test if the database is accessible
(.IsAccessible), is a system database (.IsSystemDatabase), and requires a Transaction Log backup (.RecoveryModel).
PowerShell supports lists (collections) that can be used to manage include and exclude lists. For example, the database
example, a Full backup on Friday and Differential backups on the other days of the week.
The optional qualifier -tag=name should be used during backups, so that backups of different types, for example,
weekly and monthly, can then be distinguished and expired with different retentions.
To expire backups, the output of the -list tag=name date-end=date&time command should be processed, the backup
names extracted, and the backups deleted with the delete command.
The executable HPStoreOnceForMSSQL.exe returns a status code that can be tested with the variable $LASTEXITCODE.
13
In the following example, only the backups for database RealDB_5 will be displayed:
PS C:\Program Files\Hewlett-Packard\StoreOnce\isvsupport\sql\bin> ./HPStoreOnceForMSSQL.exe -list
-store=10.1.2.151/Backups database RealDB_5
2015-01-12 15:01:18 S=SKYSQL;I=DEFAULT;DB=RealDB_5;TS=2015-01-12T15:01:18.029;T=DB_FULL;V=1;
ID=D6F2D62B-F489-41A5-AACC-68F92A04AB88;
Point-in-time restore
The database PRD needs to be restored to the state it had on October 14, at 3 a.m. Because we dont want to overwrite the
production database, it needs to be restored under another name (P2), and new file locations have to be specified during the
restore of the Full backup.
The Full, Differential, and Transaction Logs backups can be restored using the following commands:
C:\Program Files\Hewlett-Packard\StoreOnce\isvsupport\sql\bin\HPStoreOnceForMSSQL.exe -restore RESTORE
DATABASE [P2] FROM STORE=192.168.1.133/TC-SQL/S=CBCSRV19;I=DEFAULT;DB=PRD;TS=2014-10-10T20:11:00.333;
T=DB_FULL;V=1;ID=F3A5086C-7F01-4B82-A9F1-B912525F0678;TAG=Weekly; WITH NORECOVERY, CHECKSUM,
REPLACE, MOVE PRD_01 TO M:\SQL\Data01\P2.mdf, MOVE PRD_02 TO N:\SQL\Data02\P2.ndf, MOVE PRD_log
TO L:\SQL\Log\P2.ldf
C:\Program Files\Hewlett-Packard\StoreOnce\isvsupport\sql\bin\HPStoreOnceForMSSQL.exe -restore
RESTORE DATABASE [P2] FROM STORE=192.168.1.133/TC-SQL/S=CBCSRV19;I=DEFAULT;DB=PRD;
TS=2014-10-13T20:11:52.358;T=DB_DIFF;V=1;ID=D50755E0-1D68-47EE-92AB-388BC645087F;TAG=Daily; WITH
NORECOVERY, CHECKSUM, REPLACE
C:\Program Files\Hewlett-Packard\StoreOnce\isvsupport\sql\bin\HPStoreOnceForMSSQL.exe -restore
RESTORE LOG [P2] FROM STORE=192.168.1.133/TC-SQL/S=CBCSRV19;I=DEFAULT;DB=PRD;
TS=2014-10-13T22:06:39.692;T=LOG;V=1;ID=E50E39DB-6B49-4BE1-ACE9-A88DE5AC2018;TAG=Log; WITH
NORECOVERY, CHECKSUM, REPLACE, STOPAT=2014-10-14 03:00:00
14
Identify all the backups needed for this restore with the command -store=192.168.1.133/TC-SQL -list -database=PRD.
The output lists, in descending order, the backups done on this DB. Select the Full, Differential (if any), and Transaction
Log backups required to restore the DB to the selected time stamp. The backup name follows the Catalyst object
creation time in each line of the output.
2.
Use the plug-in and run a RESTORE FILELISTONLY on one of the backups of this database. The output contains the
logical names of each data and log file. These names are needed in the next step.
3.
Restore the Full backup with a RESTORE DATABASE, specifying a MOVE TO clause for each file, and NORECOVERY to
keep the database open for further restores.
4.
Restore the Differential backup with a RESTORE DATABASE and also with a NORECOVERY so that Transaction Log
backups can then be applied.
5.
Restore the Transaction Log backups in the order they have been performed with a succession of RESTORE LOG.
All but the last one needs NORECOVERY; the last one requires RECOVERY.
Performance
Performance (backup speed, restore speed, and deduplication ratio) depends on many factors such as available resources
on the SQL Server, network load, number of concurrent backups, amount changed in the DB between two backups,
retention period, and so on.
HP testing has shown that the HP StoreOnce Plug-in for Microsoft SQL Server has been seen providing better performance
than alternative solutions in the vast majority of use cases. This point is further illustrated by a test conducted under the
following conditions:
500 GB database with eight data files, each on a different mount point.
60 Full database backups with 30 backup retention.
Approximately 5 percent of the DBs rows or bytes changed between the backups.
Comparing the performance of the plug-in vs. backups to a StoreOnce CIFS share, we found the HP StoreOnce Plug-in for
Microsoft SQL Server providing 18.6 percent faster backups and saving 2.8 times more disk space.
15
Deduplication ratio
520
50
500
40
480
460
30
440
20
420
10
400
380
0
Plug-in for SQL
CIFS
CIFS
Note
Approximately 40 percent of the maximum throughput of a 10 Gbps Ethernet connection is required to achieve 450 MB/s to
a CIFS share. In other words, the Ethernet connection becomes rapidly the bottleneck when several MS SQL Servers or
databases are backed up in parallel.
The plug-in for MS SQL only consumes a small percentage of the throughput; therefore, it becomes a lot faster when
multiple SQL Servers or databases are backed up in parallel.
Low-bandwidth vs. high-bandwidth
HP recommends using low-bandwidth mode on Catalyst stores used with the HP StoreOnce Plug-in for MS SQL Server.
Using low-bandwidth mode delivers significantly faster backup and improved space savings for many use cases, as shown
in figures 11 and 12.
Backup throughput
Figure 11. Low-bandwidth vs. high-bandwidth throughput with 1 percent data change
0
1
10
Full backups
Low-bandwidth
High-bandwidth
16
11
12
13
14
Deduplication ratio
Figure 12. Low-bandwidth vs. high-bandwidth deduplication ratio with 1 percent data change
0
1
10
11
12
13
14
Full backups
Low-bandwidth
High-bandwidth
Data change rate
Data change rate can have a significant impact on deduplication ratios. Deduplication ratios will be higher if the data change
rate is low. The chart below illustrates how the database change rate between each full backup affects StoreOnce
deduplication ratios.
Deduplication ratio
Figure 13. Effect of various data change rates on deduplication ratio through 2 weeks of full backups
0
1
1% Change
7
8
Full backups
3% Change
10
11
12
13
14
5% Change
17
Deduplication ratio
Figure 14. Effect of retention period on deduplication ratio30 day retention period and 1 percent data change rate was used
0
1
17
25
33
41
49
57
65
73
81
89
Full backups
Note
There will be a slight decline in deduplication ratio once the retention period is reached; however, the deduplication ratio will
stabilize. The reason for this decline is that the backup being expired has a small amount more deduplicated data than the
newer backup. This phenomenon is not a characteristic of the HP StoreOnce Plug-in for SQL Server and is not data type
dependent.
Known limitations
Please note the following known limitations of the HP StoreOnce Plug-in for Microsoft SQL Server version 1:
No support for FILE and FILEGROUP backups.
Testing indicates maximum restore speed is ~180 MB/s.
Cannot write mirror copies over a Fibre Channel network.
18
Summary
The StoreOnce Plug-in for Microsoft SQL Server in conjunction with Catalyst targets on StoreOnce appliances is the highest
performing solution to MS SQL Server backups as the test results in this paper demonstrate. Compared to existing backup
solutions, it gives the database administrator increased control over how backups are run and the ability to finish backups
faster while using less space to store the backups. All backup and restore operations are executed using commands similar
to known T-SQL commands. In summary, the reasons to deploy the StoreOnce SQL Server Plug-in are:
Improved backup throughput compared to back up to CIFS targets:
appliance
Added protection and DR capability with up to three additional copies of the backup made using MS SQL
MIRROR TO directive
No learning curve as most of the standard Microsoft SQL Server BACKUP/RESTORE WITH options supported
Zero cost for the plug-in that is downloadable from hp.com/go/softwaredepot
by traditional backup software that was first designed for use with tape-backed devices. This device type emulates the
geometry of physical tape devices for simple integration with backup software. It is robust and well proven but provides
limited advanced functionality compared to StoreOnce Catalyst devices.
NAS (CIFS and NFS) devices are supported for connection over Ethernet networks. These device types are primarily used
for newer backup applications that were not initially designed for use with tape devices. NAS is also used for business
applications, such as Microsoft SQL Server, which have built in backup and recovery modules.
HP StoreOnce Catalyst is a device type specifically designed for backup and recovery. Catalyst is supported for connection
over Fibre Channel and Ethernet networks. It removes many of the limitations of the general purpose VTL and NAS device
types and adds features for enhanced control and performance. It uses a client-server architecture; the Catalyst server
runs on the StoreOnce appliance, and the Catalyst client is integrated with the backup or business application.
Source-side deduplication can be configured for low-bandwidth backups to help reduce, usually by 90 percent or more, the
load on the network by only transmitting new and updated blocks to complete the backup. If there are multiple application
servers or media servers running the Catalyst client software, it means the deduplication is federated and distributed so it is
possible to achieve overall higher throughput to the StoreOnce appliance for reduced times to complete backups.
HP Catalyst also enables more flexible replicationknown as Catalyst copy. NAS and VTL replication is a 1:1 asynchronous
mirror between the source and target. Catalyst copies enable added features such as multi-hop replication.
Integrating the Catalyst client with the backup software or business application enables control of the StoreOnce capabilities
to be executed through the backup software or business application for a unified point of backup management. Depending
upon the level of integration, this enables the application to manage device configuration, backup specification, copy
configuration, and view reporting and troubleshooting information. figure 15 illustrates the use of StoreOnce appliances in a
data protection solution that includes backups and replicated backups.
Figure 15. Multiple HP StoreOnce device types in use
The HP StoreOnce Plug-in for Microsoft SQL Server fully supports CoFC. When this protocol is used, the data is transferred
using the Fibre Channel protocol instead of the Ethernet.
The HP StoreOnce Plug-in for Microsoft SQL Server also supports Federated Catalyst stores, with the restrictions that such a
store cannot be the target of a Catalyst inbound copy job. In other words, it can be used in a TO STORE expression but cannot
be used in a MIRROR TO STORE clause.
20
Useful links
HP StoreOnce official page
HP StoreOnce appliance manuals
HP StoreOnce Catalyst Service technical data sheet
HP StoreOnce Catalyst Service solution brief
Microsoft TechNet for SQL Server
To get your copy of the StoreOnce Plug-in for Microsoft SQL Server
1. Go to hp.com/go/softwaredepot.
2. Expand the HP Storage menu and select Storage Software.
3. Under Product, locate and select StoreOnce Free Software.
4. Locate and read the information about the StoreOnce Plug-in for Microsoft SQL Server.
5. At the top or bottom of page, select Receive for Free.
6. When prompted, enter your HP Passport credentials (if not sign upit is free and fast).
7. Check your details on the next page and read license terms, then select Next.
8. From the Software downloads and licenses page, select the StoreOnce Plug-in for Microsoft SQL Server and
select Download.
9. Follow instructions to download the package containing the plug-in and the user guide.
Note
By default, the StoreOnce Plug-in for Microsoft SQL Server user guide is installed in \Program Files\Hewlett-Packard\
StoreOnce\isvsupport\sql\doc
Learn more at
hp.com/go/storage
Copyright 20142015 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice. The only
warranties for HP products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should
be construed as constituting an additional warranty. HP shall not be liable for technical or editorial errors or omissions contained herein.
Microsoft, Windows, and Windows Server are trademarks of the Microsoft group of companies.
4AA5-6133ENW, March 2015, Rev. 1