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
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. 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. 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. 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. Tip #2 –Fix your design and strategy
Regular backups
Partial and Piecemeal restores
Play with Buffercount, MaxTransferSizeand Blocksize
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. Summary
Physical design and storage layout of the DB
Backup streams
Compression
Instant File Initialization
Monitoring
Do not forget to test your restores!
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