How to Stripe Your Backups into Multiple Files

By | In SQL Server | June 16th, 2016

If you have experienced the frustration of waiting in high volumes of traffic in a one lane tunnel, then you know what it’s like to be bogged down with lots of backups in just one file. In this blog, we will explore how to stripe your backup files into four rather than one. We will first run the database backups using one file and then stripe them into four files. We will then compare the backup durations required to achieve optimal time-saving benefits.

The simplest way to run a database full backup is to execute the backup database command. As in:

In the following example, we will run the database full backups for the AdventureWorks2012 and the AdventureWorksDW2012 databases with day and time appended to the backup files for ease of identification for archival and restore purposes.

Script: FullBackupSingleFile.sql

You can stripe the database backup files into a set of disk files to speed up the backup process. For example:

Notice the different drive letters; you can stripe the backup files into multiple drives. This will reduce disk contention and speed up the backup process.

In the following example, we will run the database full backups for the AdventureWorks2012 and the AdventureWorksDW2012 databases with day and time appended to the backup files and stripe the backups into four files for each database.

Script: FullBackupMultiFiles.sql

We will now query the backup histories to make comparisons of the durations for the single file backups and multi-file backups.

Script: QueryingBackupHistories.sql

 Single vs Multi-file Backups

Screen-shot: Single vs Multi-file Backups

Backup duration comparisons:

Database Name Backup Size MB Single file Backup Duration Multi-file Backup Duration
AdventureWorks2012 2,060 00:00:08 00:00:05
AdventureWorksDB2012 1,037 00:00:05 00:00:03

Note that the examples here are for relatively small database backups. Both of them are less than 3,000MB. As backup sizes increase exponentially, the benefits in the shortened backup duration will be more apparent.

Datavail Script: Terms & Conditions

By using this SQL Server software script (“Script”), you are agreeing to the following terms and condition, as a legally enforceable contract, with Datavail Corporation (“Datavail”). If you do not agree with these terms, do not download or otherwise use the Script. You (which includes any entity whom you represent or for whom you use the Script) and Datavail agree as follows:

  1. CONSIDERATION. As you are aware, you did not pay a fee to Datavail for the license to the Script. Consequently, your consideration for use of the Script is your agreement to these terms, including the various waivers, releases and limitations of your rights and Datavail’s liabilities, as set-forth herein.
  2. LICENSE. Subject to the terms herein, the Script is provided to you as a non-exclusive, revocable license to use internally and not to transfer, sub-license, copy, or create derivative works from the Script, not to use the Script in a service bureau and not to disclose the Script to any third parties. No title or other ownership of the Script (or intellectual property rights therein) is assigned to you.
  3. USE AT YOUR OWN RISK; DISCLAIMER OF WARRANTIES. You agree that your use of the Script and any impacts on your software, databases, systems, networks or other property or services are solely and exclusively at your own risk. Datavail does not make any warranties, and hereby expressly disclaims any and all warranties, implied or express, including without limitation, the following: (1) performance of or results from the Script, (2) compatibility with any other software or hardware, (3) non-infringement or violation of third party’s intellectual property or other property rights, (4) fitness for a particular purpose, or (5) merchantability.
  4. LIMITATION ON LIABILITY; RELEASE. DATAVAIL SHALL HAVE NO, AND YOU WAIVE ANY, LIABILITY OR DAMAGES UNDER THIS AGREEMENT.

You hereby release Datavail from any claims, causes of action, losses, damages, costs and expenses resulting from your downloading or other use of the Script.

5. AGREEMENT. These terms and conditions constitute your complete and exclusive legal agreement between you and Datavail.

Contact Us
JP Chen
Practice Leader of SQL Server Services
JP has over 13 years of experience in the IT industry specializing in web development, data analysis, and database administration. He has worked on supporting enterprise level corporations in the financial, retailing, pharmaceutical, aerospace, fashion, and education industries as a DBA and Tech Lead. He has initiated, designed, and developed comprehensive solutions on database documentation, monitoring and alerting, stabilization, and continuous improvements with performance monitoring and tuning. He enjoys sharing his new findings, knowledge, and practical hands-on experiences on SQL Server via his two blogs: www.handsonsqlserver.com and www.handsontsql.com.

Leave a Reply

Your email address will not be published.
Required fields are marked (*).