I'm in the process of re-writing our maintenance plans and at the moment the focus is backups. Whilst preparing this plan, I'd like to try and ensure that procedures are in place to ensure that backup performance is optimal. I am aware of implementing the below, however I'd like to get an idea of how I can improve beyond that scope.
Current Considerations:
- Backup Compression
- Multiple data files for larger databases – perhaps over 100GB?
- Writing backups to another I/O subsystem
- Defining values for parameters including BLOCKSIZE, MAXTRANSFERSIZE & BUFFERCOUNT
- Purging old files
- Deleting backup history
Beyond the above, is there anything that would be benificial to implement. Also whilst setting the values for BLOCKSIZE, MAXTRANSFERSIZE & BUFFERCOUNT, are there any considerations I should take/how do I go about defining the correct values? I appreciate it will be a bit of trial and error with testing but it would be useful to get an idea of best practices.
To give an idea of my routine, I'm to run hourly transaction log backups, daily differentials and weekly full backups.
Thanks
Best Answer
Start planning to upgrade to SQL Server 2017 as backup operation has been made faster in SQL Server 2017. How Do We Made Backups Faster With SQL Server 2017
For SQL Server 2014 I believe you already know most of the things, I would help you in deciding how to choose appropriate value for
BLOCKSIZE, MAXTRANSFERSIZE & BUFFERCOUNT
. Here trace flags can be used to dump additional information into errorlog. For exampleThis command will force SQL Server to write additonal parameters into errorlog about internal backup operations.
Now if you see for the simple backup the SQL Server internally chooses
7 buffer buckets
and andmaxtransfer size of 1 MB
. You can perform similar test on UAT and can play around with above 2 values. Please note these parameters are selected considering various resources available and SQL Server takes best decision to make sure the backup runs faster. Make sure not to make the values too large or you will end up with OOM error.Choosing optimum number of backup files is also important. Brent Ozar in This Blog did some test on backup speed with single to multiple files, this may be helpful to you.
Finally some good readings about SQl Server backup and restore operation from MSDN blogs.
PS: The trace flags are undocumented so please use it ONLY in UAT environment. The same is mentioned in the MSDN links I have shared.