SlideShare a Scribd company logo
1 of 16
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

Less14 Br Concepts
Less14 Br ConceptsLess14 Br Concepts
Less14 Br Conceptsvivaankumar
 
Databaseadmonfundamentalitprosdcchapter6
Databaseadmonfundamentalitprosdcchapter6Databaseadmonfundamentalitprosdcchapter6
Databaseadmonfundamentalitprosdcchapter6Julián Castiblanco
 
Automate DG Best Practices
Automate DG  Best PracticesAutomate DG  Best Practices
Automate DG Best PracticesMohsen B
 
24 HOP edición Español - Sql server 2014 backup encryption - Percy Reyes
24 HOP edición Español - Sql server 2014 backup encryption - Percy Reyes24 HOP edición Español - Sql server 2014 backup encryption - Percy Reyes
24 HOP edición Español - Sql server 2014 backup encryption - Percy ReyesSpanishPASSVC
 
使用Prm恢复受损的oracle数据表几个例子
使用Prm恢复受损的oracle数据表几个例子使用Prm恢复受损的oracle数据表几个例子
使用Prm恢复受损的oracle数据表几个例子maclean liu
 
VMworld 2013: vSphere Data Protection (VDP) Technical Deep Dive and Troublesh...
VMworld 2013: vSphere Data Protection (VDP) Technical Deep Dive and Troublesh...VMworld 2013: vSphere Data Protection (VDP) Technical Deep Dive and Troublesh...
VMworld 2013: vSphere Data Protection (VDP) Technical Deep Dive and Troublesh...VMworld
 
Les 02 Config Rec
Les 02 Config RecLes 02 Config Rec
Les 02 Config Recvivaankumar
 
Firebird Anti-Corruption Approach
Firebird Anti-Corruption ApproachFirebird Anti-Corruption Approach
Firebird Anti-Corruption ApproachAlexey Kovyazin
 
Database backup and recovery
Database backup and recoveryDatabase backup and recovery
Database backup and recoveryAnne Lee
 
Collaborate 2012 - RMAN Eliminate the mystery
Collaborate 2012 - RMAN Eliminate the mysteryCollaborate 2012 - RMAN Eliminate the mystery
Collaborate 2012 - RMAN Eliminate the mysteryNelson Calero
 
Sql server lesson10
Sql server lesson10Sql server lesson10
Sql server lesson10Ala Qunaibi
 
Dataguard physical stand by setup
Dataguard physical stand by setupDataguard physical stand by setup
Dataguard physical stand by setupsmajeed1
 
Adventures in Dataguard
Adventures in DataguardAdventures in Dataguard
Adventures in DataguardJason Arneil
 
NoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
NoCOUG_201411_Patel_Managing_a_Large_OLTP_DatabaseNoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
NoCOUG_201411_Patel_Managing_a_Large_OLTP_DatabaseParesh Patel
 

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

Less14 Br Concepts
Less14 Br ConceptsLess14 Br Concepts
Less14 Br Concepts
 
Databaseadmonfundamentalitprosdcchapter6
Databaseadmonfundamentalitprosdcchapter6Databaseadmonfundamentalitprosdcchapter6
Databaseadmonfundamentalitprosdcchapter6
 
Automate DG Best Practices
Automate DG  Best PracticesAutomate DG  Best Practices
Automate DG Best Practices
 
24 HOP edición Español - Sql server 2014 backup encryption - Percy Reyes
24 HOP edición Español - Sql server 2014 backup encryption - Percy Reyes24 HOP edición Español - Sql server 2014 backup encryption - Percy Reyes
24 HOP edición Español - Sql server 2014 backup encryption - Percy Reyes
 
使用Prm恢复受损的oracle数据表几个例子
使用Prm恢复受损的oracle数据表几个例子使用Prm恢复受损的oracle数据表几个例子
使用Prm恢复受损的oracle数据表几个例子
 
VMworld 2013: vSphere Data Protection (VDP) Technical Deep Dive and Troublesh...
VMworld 2013: vSphere Data Protection (VDP) Technical Deep Dive and Troublesh...VMworld 2013: vSphere Data Protection (VDP) Technical Deep Dive and Troublesh...
VMworld 2013: vSphere Data Protection (VDP) Technical Deep Dive and Troublesh...
 
Les 02 Config Rec
Les 02 Config RecLes 02 Config Rec
Les 02 Config Rec
 
SQL server Backup Restore Revealed
SQL server Backup Restore RevealedSQL server Backup Restore Revealed
SQL server Backup Restore Revealed
 
Les 02 config
Les 02 configLes 02 config
Les 02 config
 
Firebird Anti-Corruption Approach
Firebird Anti-Corruption ApproachFirebird Anti-Corruption Approach
Firebird Anti-Corruption Approach
 
Database backup and recovery
Database backup and recoveryDatabase backup and recovery
Database backup and recovery
 
Collaborate 2012 - RMAN Eliminate the mystery
Collaborate 2012 - RMAN Eliminate the mysteryCollaborate 2012 - RMAN Eliminate the mystery
Collaborate 2012 - RMAN Eliminate the mystery
 
Using AWR for IO Subsystem Analysis
Using AWR for IO Subsystem AnalysisUsing AWR for IO Subsystem Analysis
Using AWR for IO Subsystem Analysis
 
Sql server lesson10
Sql server lesson10Sql server lesson10
Sql server lesson10
 
MySQL 5.1 Replication
MySQL 5.1 ReplicationMySQL 5.1 Replication
MySQL 5.1 Replication
 
Dataguard physical stand by setup
Dataguard physical stand by setupDataguard physical stand by setup
Dataguard physical stand by setup
 
Less04 Instance
Less04 InstanceLess04 Instance
Less04 Instance
 
RMAN – The Pocket Knife of a DBA
RMAN – The Pocket Knife of a DBA RMAN – The Pocket Knife of a DBA
RMAN – The Pocket Knife of a DBA
 
Adventures in Dataguard
Adventures in DataguardAdventures in Dataguard
Adventures in Dataguard
 
NoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
NoCOUG_201411_Patel_Managing_a_Large_OLTP_DatabaseNoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
NoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
 

More from 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 clustersIvan 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 2019Ivan 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 stackIvan 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 19Ivan 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 VMsIvan Donev
 
Develop your database with Visual Studio
Develop your database with Visual StudioDevelop your database with Visual Studio
Develop your database with Visual StudioIvan 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 VMsIvan Donev
 
Building your first AS solution
Building your first AS solutionBuilding your first AS solution
Building your first AS solutionIvan Donev
 
Sql server consolidation and virtualization
Sql server consolidation and virtualizationSql server consolidation and virtualization
Sql server consolidation and virtualizationIvan 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 PowerViewIvan 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 worldIvan Donev
 

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
 
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
 
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
 
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
 
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
 
Develop your database with Visual Studio
Develop your database with Visual StudioDevelop your database with Visual Studio
Develop your database with Visual Studio
 
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
 
Building your first AS solution
Building your first AS solutionBuilding your first AS solution
Building your first AS solution
 
Sql server consolidation and virtualization
Sql server consolidation and virtualizationSql server consolidation and virtualization
Sql server consolidation and virtualization
 
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
 
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
 

Recently uploaded

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 

Recently uploaded (20)

Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

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