SlideShare a Scribd company logo
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 strategies
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
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
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 Throughput/sec 
CPU penalty => control with Resource Governor
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
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
Tip #1 –Instant File Initialization 
Valid and for BACKUP operations 
Skip pre-zeroing of DATA files 
Log cannot be skipped 
Configure using GPEDIT.MSC
Tip #2 –Fix your design and strategy 
Regular backups 
Partial and Piecemeal restores 
Play with Buffercount, MaxTransferSizeand Blocksize
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)
Summary 
Physical design and storage layout of the DB 
Backup streams 
Compression 
Instant File Initialization 
Monitoring 
Do not forget to test your restores!
What I did not mention 
Backup and In-Memory tables 
Backup and Restore to SSDs 
Backup and Restore to Azure Blob 
Backup and encryption
Sponsors
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

More Related Content

Similar to Tips and tricks to optimiza SQL Server Backup and Restore (20)

Dba tuning
Dba tuningDba tuning
Dba tuning
Maximiliano Accotto
 
Db2 recovery IDUG EMEA 2013
Db2 recovery IDUG EMEA 2013Db2 recovery IDUG EMEA 2013
Db2 recovery IDUG EMEA 2013
Dale McInnis
 
Sql server backup internals
Sql server backup internalsSql server backup internals
Sql server backup internals
Hamid J. Fard
 
Restore Backup SQL Data
Restore Backup SQL DataRestore Backup SQL Data
Restore Backup SQL Data
Katherine John
 
Be Proactive: A Good DBA Goes Looking for Signs of Trouble | IDERA
Be Proactive: A Good DBA Goes Looking for Signs of Trouble | IDERABe Proactive: A Good DBA Goes Looking for Signs of Trouble | IDERA
Be Proactive: A Good DBA Goes Looking for Signs of Trouble | IDERA
IDERA Software
 
Database Maintenance Optimization Brad Mc Gehee
Database Maintenance Optimization   Brad Mc GeheeDatabase Maintenance Optimization   Brad Mc Gehee
Database Maintenance Optimization Brad Mc Gehee
Pratik joshi
 
DBCC - Dubi Lebel
DBCC - Dubi LebelDBCC - Dubi Lebel
DBCC - Dubi Lebel
sqlserver.co.il
 
Sql server lesson10
Sql server lesson10Sql server lesson10
Sql server lesson10
Ala Qunaibi
 
Db As Behaving Badly... Worst Practices For Database Administrators Rod Colledge
Db As Behaving Badly... Worst Practices For Database Administrators Rod ColledgeDb As Behaving Badly... Worst Practices For Database Administrators Rod Colledge
Db As Behaving Badly... Worst Practices For Database Administrators Rod Colledge
sqlserver.co.il
 
Prevent Recovery Amnesia - Forget The Backups
Prevent Recovery Amnesia - Forget The BackupsPrevent Recovery Amnesia - Forget The Backups
Prevent Recovery Amnesia - Forget The Backups
Chris Bell
 
Backup and restore
Backup and restoreBackup and restore
Backup and restore
Riteshkiit
 
DB2 LUW - Backup and Recovery
DB2 LUW - Backup and RecoveryDB2 LUW - Backup and Recovery
DB2 LUW - Backup and Recovery
imranasayed
 
4 Ways Centricity Users Hinder SQL Server Performance
4 Ways Centricity Users Hinder SQL Server Performance4 Ways Centricity Users Hinder SQL Server Performance
4 Ways Centricity Users Hinder SQL Server Performance
Carlos L Chacon
 
Database Configuration for Maximum SharePoint 2010 Performance
Database Configuration for Maximum SharePoint 2010 PerformanceDatabase Configuration for Maximum SharePoint 2010 Performance
Database Configuration for Maximum SharePoint 2010 Performance
Edwin M Sarmiento
 
Myth busters - performance tuning 103 2008
Myth busters - performance tuning 103 2008Myth busters - performance tuning 103 2008
Myth busters - performance tuning 103 2008
paulguerin
 
Tempdb3
Tempdb3Tempdb3
Tempdb3
Paresh Motiwala, PMP®
 
database_maintenance sequential plot.ppsx
database_maintenance sequential plot.ppsxdatabase_maintenance sequential plot.ppsx
database_maintenance sequential plot.ppsx
gauravsaxena850349
 
Tips for managing a VLDB
Tips for managing a VLDBTips for managing a VLDB
Tips for managing a VLDB
John Martin
 
Understanding the Transaction Log, Your Key to Unlocking Greater Throughput
Understanding the Transaction Log, Your Key to Unlocking Greater ThroughputUnderstanding the Transaction Log, Your Key to Unlocking Greater Throughput
Understanding the Transaction Log, Your Key to Unlocking Greater Throughput
Richard Douglas
 
Sql Server tips from the field
Sql Server tips from the fieldSql Server tips from the field
Sql Server tips from the field
InnoTech
 
Db2 recovery IDUG EMEA 2013
Db2 recovery IDUG EMEA 2013Db2 recovery IDUG EMEA 2013
Db2 recovery IDUG EMEA 2013
Dale McInnis
 
Sql server backup internals
Sql server backup internalsSql server backup internals
Sql server backup internals
Hamid J. Fard
 
Restore Backup SQL Data
Restore Backup SQL DataRestore Backup SQL Data
Restore Backup SQL Data
Katherine John
 
Be Proactive: A Good DBA Goes Looking for Signs of Trouble | IDERA
Be Proactive: A Good DBA Goes Looking for Signs of Trouble | IDERABe Proactive: A Good DBA Goes Looking for Signs of Trouble | IDERA
Be Proactive: A Good DBA Goes Looking for Signs of Trouble | IDERA
IDERA Software
 
Database Maintenance Optimization Brad Mc Gehee
Database Maintenance Optimization   Brad Mc GeheeDatabase Maintenance Optimization   Brad Mc Gehee
Database Maintenance Optimization Brad Mc Gehee
Pratik joshi
 
Sql server lesson10
Sql server lesson10Sql server lesson10
Sql server lesson10
Ala Qunaibi
 
Db As Behaving Badly... Worst Practices For Database Administrators Rod Colledge
Db As Behaving Badly... Worst Practices For Database Administrators Rod ColledgeDb As Behaving Badly... Worst Practices For Database Administrators Rod Colledge
Db As Behaving Badly... Worst Practices For Database Administrators Rod Colledge
sqlserver.co.il
 
Prevent Recovery Amnesia - Forget The Backups
Prevent Recovery Amnesia - Forget The BackupsPrevent Recovery Amnesia - Forget The Backups
Prevent Recovery Amnesia - Forget The Backups
Chris Bell
 
Backup and restore
Backup and restoreBackup and restore
Backup and restore
Riteshkiit
 
DB2 LUW - Backup and Recovery
DB2 LUW - Backup and RecoveryDB2 LUW - Backup and Recovery
DB2 LUW - Backup and Recovery
imranasayed
 
4 Ways Centricity Users Hinder SQL Server Performance
4 Ways Centricity Users Hinder SQL Server Performance4 Ways Centricity Users Hinder SQL Server Performance
4 Ways Centricity Users Hinder SQL Server Performance
Carlos L Chacon
 
Database Configuration for Maximum SharePoint 2010 Performance
Database Configuration for Maximum SharePoint 2010 PerformanceDatabase Configuration for Maximum SharePoint 2010 Performance
Database Configuration for Maximum SharePoint 2010 Performance
Edwin M Sarmiento
 
Myth busters - performance tuning 103 2008
Myth busters - performance tuning 103 2008Myth busters - performance tuning 103 2008
Myth busters - performance tuning 103 2008
paulguerin
 
database_maintenance sequential plot.ppsx
database_maintenance sequential plot.ppsxdatabase_maintenance sequential plot.ppsx
database_maintenance sequential plot.ppsx
gauravsaxena850349
 
Tips for managing a VLDB
Tips for managing a VLDBTips for managing a VLDB
Tips for managing a VLDB
John Martin
 
Understanding the Transaction Log, Your Key to Unlocking Greater Throughput
Understanding the Transaction Log, Your Key to Unlocking Greater ThroughputUnderstanding the Transaction Log, Your Key to Unlocking Greater Throughput
Understanding the Transaction Log, Your Key to Unlocking Greater Throughput
Richard Douglas
 
Sql Server tips from the field
Sql Server tips from the fieldSql Server tips from the field
Sql Server tips from the field
InnoTech
 

More from Ivan Donev (11)

Discovery Day 2019 Sofia - Big data clusters
Discovery Day 2019 Sofia - Big data clustersDiscovery Day 2019 Sofia - Big data clusters
Discovery Day 2019 Sofia - Big data clusters
Ivan Donev
 
Discovery Day 2019 Sofia - What is new in SQL Server 2019
Discovery Day 2019 Sofia - What is new in SQL Server 2019Discovery Day 2019 Sofia - What is new in SQL Server 2019
Discovery Day 2019 Sofia - What is new in SQL Server 2019
Ivan Donev
 
Bi and AI updates in the Microsoft Data Platform stack
Bi and AI updates in the Microsoft Data Platform stackBi and AI updates in the Microsoft Data Platform stack
Bi and AI updates in the Microsoft Data Platform stack
Ivan Donev
 
Power bi - enterprise cloud reporting platform Azure Bootcamp 19
Power bi - enterprise cloud reporting platform Azure Bootcamp 19Power bi - enterprise cloud reporting platform Azure Bootcamp 19
Power bi - enterprise cloud reporting platform Azure Bootcamp 19
Ivan Donev
 
Get the most out of your Windows Azure VMs
Get the most out of your Windows Azure VMsGet the most out of your Windows Azure VMs
Get the most out of your Windows Azure VMs
Ivan Donev
 
Develop your database with Visual Studio
Develop your database with Visual StudioDevelop your database with Visual Studio
Develop your database with Visual Studio
Ivan Donev
 
Windows Azure Bootcamp - Microsoft BI in Azure VMs
Windows Azure Bootcamp - Microsoft BI in Azure VMsWindows Azure Bootcamp - Microsoft BI in Azure VMs
Windows Azure Bootcamp - Microsoft BI in Azure VMs
Ivan Donev
 
Building your first AS solution
Building your first AS solutionBuilding your first AS solution
Building your first AS solution
Ivan Donev
 
Sql server consolidation and virtualization
Sql server consolidation and virtualizationSql server consolidation and virtualization
Sql server consolidation and virtualization
Ivan Donev
 
Self-service BI with PowerPivot and PowerView
Self-service BI with PowerPivot and PowerViewSelf-service BI with PowerPivot and PowerView
Self-service BI with PowerPivot and PowerView
Ivan Donev
 
Is "the bigger the beter" valid in the database world
Is "the bigger the beter" valid in the database worldIs "the bigger the beter" valid in the database world
Is "the bigger the beter" valid in the database world
Ivan Donev
 
Discovery Day 2019 Sofia - Big data clusters
Discovery Day 2019 Sofia - Big data clustersDiscovery Day 2019 Sofia - Big data clusters
Discovery Day 2019 Sofia - Big data clusters
Ivan Donev
 
Discovery Day 2019 Sofia - What is new in SQL Server 2019
Discovery Day 2019 Sofia - What is new in SQL Server 2019Discovery Day 2019 Sofia - What is new in SQL Server 2019
Discovery Day 2019 Sofia - What is new in SQL Server 2019
Ivan Donev
 
Bi and AI updates in the Microsoft Data Platform stack
Bi and AI updates in the Microsoft Data Platform stackBi and AI updates in the Microsoft Data Platform stack
Bi and AI updates in the Microsoft Data Platform stack
Ivan Donev
 
Power bi - enterprise cloud reporting platform Azure Bootcamp 19
Power bi - enterprise cloud reporting platform Azure Bootcamp 19Power bi - enterprise cloud reporting platform Azure Bootcamp 19
Power bi - enterprise cloud reporting platform Azure Bootcamp 19
Ivan Donev
 
Get the most out of your Windows Azure VMs
Get the most out of your Windows Azure VMsGet the most out of your Windows Azure VMs
Get the most out of your Windows Azure VMs
Ivan Donev
 
Develop your database with Visual Studio
Develop your database with Visual StudioDevelop your database with Visual Studio
Develop your database with Visual Studio
Ivan Donev
 
Windows Azure Bootcamp - Microsoft BI in Azure VMs
Windows Azure Bootcamp - Microsoft BI in Azure VMsWindows Azure Bootcamp - Microsoft BI in Azure VMs
Windows Azure Bootcamp - Microsoft BI in Azure VMs
Ivan Donev
 
Building your first AS solution
Building your first AS solutionBuilding your first AS solution
Building your first AS solution
Ivan Donev
 
Sql server consolidation and virtualization
Sql server consolidation and virtualizationSql server consolidation and virtualization
Sql server consolidation and virtualization
Ivan Donev
 
Self-service BI with PowerPivot and PowerView
Self-service BI with PowerPivot and PowerViewSelf-service BI with PowerPivot and PowerView
Self-service BI with PowerPivot and PowerView
Ivan Donev
 
Is "the bigger the beter" valid in the database world
Is "the bigger the beter" valid in the database worldIs "the bigger the beter" valid in the database world
Is "the bigger the beter" valid in the database world
Ivan Donev
 
Ad

Recently uploaded (20)

The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry ReportThe State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data ResilienceFloods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und AnwendungsfälleDomino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
panagenda
 
Secure Access with Azure Active Directory
Secure Access with Azure Active DirectorySecure Access with Azure Active Directory
Secure Access with Azure Active Directory
VICTOR MAESTRE RAMIREZ
 
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdfcnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
AmirStern2
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free DownloadViral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...
“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...
“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...
Edge AI and Vision Alliance
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
Ben Blair - Operating Safely in a Vibe Coding World
Ben Blair - Operating Safely in a Vibe Coding WorldBen Blair - Operating Safely in a Vibe Coding World
Ben Blair - Operating Safely in a Vibe Coding World
AWS Chicago
 
PyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent IntegrationPyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent Integration
barqawicloud
 
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Safe Software
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI ProfessionalOracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
How to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptxHow to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementaryMurdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization ProgramOracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
If You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FMEIf You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FME
Safe Software
 
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely
 
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
NTT DATA Technology & Innovation
 
Cisco ISE Performance, Scalability and Best Practices.pdf
Cisco ISE Performance, Scalability and Best Practices.pdfCisco ISE Performance, Scalability and Best Practices.pdf
Cisco ISE Performance, Scalability and Best Practices.pdf
superdpz
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry ReportThe State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data ResilienceFloods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und AnwendungsfälleDomino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
panagenda
 
Secure Access with Azure Active Directory
Secure Access with Azure Active DirectorySecure Access with Azure Active Directory
Secure Access with Azure Active Directory
VICTOR MAESTRE RAMIREZ
 
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdfcnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
AmirStern2
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free DownloadViral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...
“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...
“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...
Edge AI and Vision Alliance
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
Ben Blair - Operating Safely in a Vibe Coding World
Ben Blair - Operating Safely in a Vibe Coding WorldBen Blair - Operating Safely in a Vibe Coding World
Ben Blair - Operating Safely in a Vibe Coding World
AWS Chicago
 
PyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent IntegrationPyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent Integration
barqawicloud
 
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025Developing Schemas with FME and Excel - Peak of Data & AI 2025
Developing Schemas with FME and Excel - Peak of Data & AI 2025
Safe Software
 
Oracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI ProfessionalOracle Cloud Infrastructure Generative AI Professional
Oracle Cloud Infrastructure Generative AI Professional
VICTOR MAESTRE RAMIREZ
 
How to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptxHow to Detect Outliers in IBM SPSS Statistics.pptx
How to Detect Outliers in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementaryMurdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization ProgramOracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
If You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FMEIf You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FME
Safe Software
 
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely
 
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
Can We Use Rust to Develop Extensions for PostgreSQL? (POSETTE: An Event for ...
NTT DATA Technology & Innovation
 
Cisco ISE Performance, Scalability and Best Practices.pdf
Cisco ISE Performance, Scalability and Best Practices.pdfCisco ISE Performance, Scalability and Best Practices.pdf
Cisco ISE Performance, Scalability and Best Practices.pdf
superdpz
 
Ad

Tips and tricks to optimiza SQL Server Backup and Restore

  • 1. Tips and tricks to optimize your SQL Server backup ...and restore 
  • 2. About me 2| @ikdonev /ivan.donev /in/ikdonev
  • 3. Agenda SQL Server parameters Compression OS policies Not for tapes, storage, 3rdparty software Not for backup strategies
  • 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. 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. Tip #2 –Data compression Row compression Page compression CPU Overhead Smaller database => faster backup
  • 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
  • 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