Speedup SQL Server Database Backup Performance Tips (2024)

Taking regular backups is a crucial and necessary part of an SQL database administrator’s routine job. Backup helps to safeguard SQL server database from any data loss. Usually, an organizational database contains huge amounts of important data that the organization can by no means afford to jeopardize. Hence, irrespective of how voluminous the database is and how tedious it might be, an SQL Server database must be thoroughly backed up.

Speedup SQL Server Database Backup Performance Tips (1)

However, the process is not very straightforward. With an increase in the size of the database, the time taken to back it up also rises. You might very well have a backup process stretching over days. That could put everything else on hold, but frankly, which organization has the time for that? So what seems to be the solution? Some cool tips and tricks to improve SQL backup performance.

Need for Speed in SQL Backups

A single database having a size in gigabytes can have millions of rows of data. Extend that size to terabytes, and the database will contain a couple of billion rows of data occupying massive disk space and spread across multiple Filegroups. Naturally, backing up such mammoth volumes of data is going to take time. However, for any organization, time is money. Putting an SQL Server database for backing up could mean holding up other tasks on it. That means inaccessibility of the server for the users. And when it comes to work, no user would be happy wasting time to server inaccessibility even for a couple of hours, let alone days. So something needs to be done to speed up things a bit.

Techniques that can help speed up SQL Backups

There are a lot of things that you can do in order to bring down the time it takes to backup the entire SQL server database. Some helpful techniques and tips are mentioned below:

  • The SQL 2008 Database backup compression feature (introduced as Enterprise Edition only feature in SQL 2008) proves to save quite some amount of disk space and improves backup performance. This technique also helps in speeding up the restore process that can be extremely helpful for reducing downtime in a disaster recovery situation. However, the catch here is more CPU utilization and maximum available IO bandwidth use.
  • Take care, not to use the same drive for storing the database files. Reading from and writing to the same drive takes significantly more time than 2 separate drives. In addition to contention issues, any damage to the sole drive could mean you lose the database and the backup.
  • Since extra CPU and IO bandwidth are needed for the process, and you’ll preferably need other drives for storing the backup, using Solid State Drive units is advisable. It will also further give the performance a boost.
  • Using advanced parameters like BLOCKSIZE, MAXTRANSFERSIZE, BUFFERCOUNT etc also adds massive gains.
  • Instruct the BACKUP command to keep deleting old backup files of the same database and of the same type as part of the whole operation. Using ERASEFILES, ERASEFILES_ATSTART, or ERASEFILES_REMOTE options with the BACKUP command can achieve this.
  • To identify the files to delete, the headers of all the files in the backup folder are read. The larger the number of files stored in the folder, the longer it takes to read all of the file headers.Hence, to reduce the number of file headers to be read each time, store backups in folders according to database name and backup type. Including the <DATABASE> and <TYPE> tags in folder paths can achieve this.
  • Another helpful step towards saving backup time is selecting to stop deleting backup and restore history that’s older than <n Days | Hours> (available from Tools > Server Options > File Management). Usually this option is selected and causes the stored procedure msdb..sp_delete_backuphistory to delete history from the msdb database that contains a lot of history thus adding to the overall backup time. But if you clear this option and perform the delete at some other convenient time manually, you can save quite a bit.

Now that we’ve taken care of the basics, let’s jump head on into the steps to speed up SQL backup through compression.

How to speed up SQL backups through compression

Step 1: The option to compress database backup is disabled by default. To enable it, you’ll need to add the word “COMPRESSION” to a T-SQL backup query in the SQL Server Management Studio (SSMS) GUI. In this GUI, you can find the Compression feature as follows:

Right click on the database to be backed up -> Tasks -> Back Up -> Options -> Compression (at the bottom).

Step 2: Once the “Compress Backup” option has been selected, you can generate the TSQL statement by clicking on the Script option.

Step 3: If you want to enable backup compression as the default option for all databases, execute the following command:

USE masterGOEXEC sp_configure backup compression default, ‘1’;RECONFIGURE WITH OVERRIDE

Step 4: If you’re using Solid State Disks for the backup as suggested earlier, running the above query will result in more than 1400 MB / sec being read on average for each disk (that’s roughly equivalent to reading 2 CD ROMs full of data each second).

Step 5: A feature not much talked about is the option to specify multiple file destinations to improve throughput. You can implement this to give the backup performance a further boost by running the following command:

DBCC TRACEON (3605, -1)DBCC TRACEON (3213, -1)BACKUP DATABASE [TPCH_1TB]TODISK = <filepathtodisk1>DISK = <filepathtodisk2>DISK = <filepathtodisk3>DISK = <filepathtodisk4>DISK = <filepathtodisk5>WITH NOFORMAT, INIT, NAME = N'TPCH_1TB-Full Database Backup',SKIP, NOREWIND, NOUNLOAD, COMPRESSION, STATS = 10DBCC TRACEOFF (3605, -1)DBCC TRACEOFF (3213, -1)

Step 6: As mentioned in the techniques to improve throughput, setting advanced backup parameters can add significant points to increase backup throughput.

  • BUFFERCOUNT – indicates the number of I/O buffers to be used while backing up
  • MAXTRANSFERSIZE – indicates the largest unit of transfer to be used between SQL server and the backup media (in bytes).
  • BLOCKSIZE – indicates the physical block size in bytes.

Adding these parameters to your query isn’t tough. Just add the following snippet after the line starting with SKIP and right before the ‘DBCC TRACEOFF’ code lines:

,BUFFERCOUNT = <count>,BLOCKSIZE = <size>,MAXTRANSFERSIZEGO

Note: You can use the special option TO DISK = ‘NUL’ in order to estimate how quickly data can be read from a database or Filegroup.

To sum it up

Why let SQL backup make you wait for hours together when you can reduce the time it takes with some simple steps? Do keep compression in mind and also use our helpful tips where you can to gain major perks regarding backup throughput.

Was this article helpful?

Speedup SQL Server Database Backup Performance Tips (2) YES0

Speedup SQL Server Database Backup Performance Tips (3) NO

About The Author

Speedup SQL Server Database Backup Performance Tips (4)

Bharat Bhushan Speedup SQL Server Database Backup Performance Tips (5)

Bharat Bhushan is an experienced technical Marketer working at Stellar Data Recovery - expertise in data care. He is skilled in Microsoft Exchange Database, MSSQL Database troubleshooting & data warehousing. He is a Management Post Graduate having a strong grip in Technology & certified in SAP-SD, Oracle 10g & Informatica Powercenter 9.1.

Speedup SQL Server Database Backup Performance Tips (2024)
Top Articles
The Risk of Running Out of Money in Retirement: What to Know
Crypto analysts are bullish on these five crypto coins despite a sluggish start to April - ET BFSI
Foxy Roxxie Coomer
Victor Spizzirri Linkedin
Tlc Africa Deaths 2021
Craigslist Monterrey Ca
Libiyi Sawsharpener
Craigslist Niles Ohio
Ret Paladin Phase 2 Bis Wotlk
How to know if a financial advisor is good?
Fototour verlassener Fliegerhorst Schönwald [Lost Place Brandenburg]
Khatrimaza Movies
Space Engineers Projector Orientation
Mini Handy 2024: Die besten Mini Smartphones | Purdroid.de
Rhinotimes
Letter F Logos - 178+ Best Letter F Logo Ideas. Free Letter F Logo Maker. | 99designs
Wisconsin Women's Volleyball Team Leaked Pictures
60 X 60 Christmas Tablecloths
Icommerce Agent
Labby Memorial Funeral Homes Leesville Obituaries
Van Buren County Arrests.org
2013 Ford Fusion Serpentine Belt Diagram
Craigslist Houses For Rent In Milan Tennessee
Certain Red Dye Nyt Crossword
eugene bicycles - craigslist
Sam's Club Gas Price Hilliard
480-467-2273
Kabob-House-Spokane Photos
Royalfh Obituaries Home
Tactical Masters Price Guide
2021 Tesla Model 3 Standard Range Pl electric for sale - Portland, OR - craigslist
Dreamcargiveaways
Golden Tickets
Craigslist Greencastle
拿到绿卡后一亩三分地
Hingham Police Scanner Wicked Local
2008 DODGE RAM diesel for sale - Gladstone, OR - craigslist
Cygenoth
301 Priest Dr, KILLEEN, TX 76541 - HAR.com
Acts 16 Nkjv
Isabella Duan Ahn Stanford
ESA Science & Technology - The remarkable Red Rectangle: A stairway to heaven? [heic0408]
21 Alive Weather Team
Victoria Vesce Playboy
Hillsborough County Florida Recorder Of Deeds
Xre 00251
Rick And Morty Soap2Day
Barber Gym Quantico Hours
Ewwwww Gif
Skybird_06
The Ultimate Guide To 5 Movierulz. Com: Exploring The World Of Online Movies
Latest Posts
Article information

Author: Mr. See Jast

Last Updated:

Views: 6254

Rating: 4.4 / 5 (75 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Mr. See Jast

Birthday: 1999-07-30

Address: 8409 Megan Mountain, New Mathew, MT 44997-8193

Phone: +5023589614038

Job: Chief Executive

Hobby: Leather crafting, Flag Football, Candle making, Flying, Poi, Gunsmithing, Swimming

Introduction: My name is Mr. See Jast, I am a open, jolly, gorgeous, courageous, inexpensive, friendly, homely person who loves writing and wants to share my knowledge and understanding with you.