Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Tips and tricks to optimize your SQL Server backup 
...and restore 
About me 
2| 
@ikdonev 
/ivan.donev 
/in/ikdonev
Agenda 
SQL Server parameters 
Compression 
OS policies 
Not for tapes, storage, 3rdparty software 
Not for backup st...
Initialize BAK 
Copy from MDF to BAK 
Copy from LDF to BAK 
Close BAK 
BACKUP -full/diff 
Initialize BAK 
Copy from LDF to...
Tip #1 –Use multiple devices 
AdventureWorks 
AW_1.bak 
AW_2.bak 
AW_3.bak 
AW_4.bak 
Backup device 
E:Backup_1 
F:Backup_...
Tip #2 –Data compression 
Row compression 
Page compression 
CPU Overhead 
Smaller database => faster backup
Tip #3 –Backup compression 
Smaller size => less I/O 
Pre-allocation 
Trace flag 3042 
Monitor 
CPU 
Backup/Restore ...
Tip #4 –Parameter tweaking 
Buffercount 
No Hard limit 
Memory exhaust!!! 
MaxTransferSize 
Multiples of 64KB 
Suppo...
Pre-zero MDF and LDF 
Copy from BAK to MDF/NDF 
Copy from BAK to LDF 
Recover (Redo and Undo) 
Restore of full/diff backup...
Tip #1 –Instant File Initialization 
Valid and for BACKUP operations 
Skip pre-zeroing of DATA files 
Log cannot be ski...
Tip #2 –Fix your design and strategy 
Regular backups 
Partial and Piecemeal restores 
Play with Buffercount, MaxTransf...
Trace flags to help 
Trace flag 
Description 
-T3004 
Writes in logfilezeroing information 
-T3213 
Writes in logdetailed ...
Summary 
Physical design and storage layout of the DB 
Backup streams 
Compression 
Instant File Initialization 
Moni...
What I did not mention 
Backup and In-Memory tables 
Backup and Restore to SSDs 
Backup and Restore to Azure Blob 
Bac...
Sponsors
Resources 
http://technet.microsoft.com/en-us/library/ms190954(v=sql.105).aspx 
http://henkvandervalk.com/how-to-increas...
Upcoming SlideShare
Loading in …5
×

Tips and tricks to optimiza SQL Server Backup and Restore

631 views

Published on

The backup strategy of every company, running SQL Server is the main reason of making the DBA happy (and able to get his beauty sleep). It the era of enormous data inputs, it is not only important to backup your data, but to back it up fast and to know you can restore it. In this session we will talk about backup strategies, tips and tricks on optimizing the SQL Server backups (both on disk and with 3-rd party software) and last but not least - how to be sure that you can recover and do it in time

Published in: Technology
  • Be the first to comment

Tips and tricks to optimiza SQL Server Backup and Restore

  1. 1. Tips and tricks to optimize your SQL Server backup ...and restore 
  2. 2. About me 2| @ikdonev /ivan.donev /in/ikdonev
  3. 3. Agenda SQL Server parameters Compression OS policies Not for tapes, storage, 3rdparty software Not for backup strategies
  4. 4. Initialize BAK Copy from MDF to BAK Copy from LDF to BAK Close BAK BACKUP -full/diff Initialize BAK Copy from LDF to BAK Close BAK BACKUP -TLog
  5. 5. Tip #1 –Use multiple devices AdventureWorks AW_1.bak AW_2.bak AW_3.bak AW_4.bak Backup device E:Backup_1 F:Backup_2 G:Backup_3 H:Backup_4 E:Backup AWData1.MDF AWData2.NDF
  6. 6. Tip #2 –Data compression Row compression Page compression CPU Overhead Smaller database => faster backup
  7. 7. Tip #3 –Backup compression Smaller size => less I/O Pre-allocation Trace flag 3042 Monitor CPU Backup/Restore Throughput/sec CPU penalty => control with Resource Governor
  8. 8. Tip #4 –Parameter tweaking Buffercount No Hard limit Memory exhaust!!! MaxTransferSize Multiples of 64KB Supported up to 4MB BlockSize Default –512B Supported up to 64KB
  9. 9. Pre-zero MDF and LDF Copy from BAK to MDF/NDF Copy from BAK to LDF Recover (Redo and Undo) Restore of full/diff backup Copy from BAK to LDF Recover (Redo and Undo) Restore of Tlogbackup
  10. 10. Tip #1 –Instant File Initialization Valid and for BACKUP operations Skip pre-zeroing of DATA files Log cannot be skipped Configure using GPEDIT.MSC
  11. 11. Tip #2 –Fix your design and strategy Regular backups Partial and Piecemeal restores Play with Buffercount, MaxTransferSizeand Blocksize
  12. 12. Trace flags to help Trace flag Description -T3004 Writes in logfilezeroing information -T3213 Writes in logdetailed parameter details -T3023: Enable CHECKSUM on all backups -T3226: No backup/restore info in Errorlog -T3001: No backup history saved in MSDB -T1806: Turn off Instant File Initialization -T3014 and –T3216: Writesin Eerrorlogeven more details DBCC TRACEON(3605,3004,3023,-1)
  13. 13. Summary Physical design and storage layout of the DB Backup streams Compression Instant File Initialization Monitoring Do not forget to test your restores!
  14. 14. What I did not mention Backup and In-Memory tables Backup and Restore to SSDs Backup and Restore to Azure Blob Backup and encryption
  15. 15. Sponsors
  16. 16. Resources http://technet.microsoft.com/en-us/library/ms190954(v=sql.105).aspx http://henkvandervalk.com/how-to-increase-sql-database-full- backup-speed-using-compression-and-solid-state-disks http://henkvandervalk.com/how-to-increase-the-sql-database- restore-speed-using-db-compression-and-solid-state-disks http://blogs.technet.com/b/dataplatforminsider/archive/2014/02/05/database-backup-with-memory-optimized-tables.aspx http://msdn.microsoft.com/en-us/library/bb964719.aspx

×