Database Corruption Advanced Recovery Techniques

Slides:



Advertisements
Similar presentations
Chapter 16: Recovery System
Advertisements

SQL Server Disaster Recovery Chris Shaw Sr. SQL Server DBA, Xtivia Inc.
VMware Data Recovery Presented by Kroll Ontrack at WI Area VMware User’s Group Presented by Kroll Ontrack at WI Area VMware User’s Group.
Active Directory Disaster Recovery Paul Simmons Support Engineer Directory Services Microsoft Corporation.
Database Optimization & Maintenance Tim Richard ECM Training Conference#dbwestECM Agenda SQL Configuration OnBase DB Planning Backups Integrity.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 12: Managing and Implementing Backups and Disaster Recovery.
Backup, Integrity Check and Index and Statistics Maintenance
Backup and Recovery Part 1.
Backup & Recovery Concepts for Oracle Database
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 12: Managing and Implementing Backups and Disaster Recovery.
Administration etc.. What is this ? This section is devoted to those bits that I could not find another home for… Again these may be useless, but humour.
Security The Kingsway School. Accidental Data Loss Data can be lost or damaged by: Hardware failure such as a failed disk drive Operator error e.g. accidental.
Chapter Fourteen Windows XP Professional Fault Tolerance.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 12: Managing and Implementing Backups and Disaster Recovery.
16 Copyright © 2007, Oracle. All rights reserved. Performing Database Recovery.
Rajib Kundu Agenda Definitions Failover Cluster Database Snapshots Log shipping Database Mirroring.
Backup and Recovery Overview Supinfo Oracle Lab. 6.
Module 16: Performing Ongoing Database Maintenance
Week 7 : Chapter 7 Agenda SQL 710 Maintenance Plan:
11 Copyright © 2004, Oracle. All rights reserved. Dealing with Database Corruption.
Alwayson Availability Groups
Learningcomputer.com SQL Server 2008 – Backup and Restore Database.
Data Disaster Recovery Planning Greg Fibiger 1/7/2016.
Praveen Srivatsa Director| AstrhaSoft Consulting blogs.asthrasoft.com/praveens |
Digging Out From Corruption Eddie Wuerch, MCM - Principal, Database Performance - Salesforce Marketing Cloud Data protection and loss recovery with SQL.
SQL SERVER MAINTENANCE PLANS Kat
Strategies for Working with Texas-sized Databases Robert L Davis Database Engineer
13 Copyright © 2007, Oracle. All rights reserved. Using the Data Recovery Advisor.
Linkedin: dennisegraham Dennis E Graham Reporting For SQL Health.
Microsoft SQL is known as RDMS (Relational Database Management System) which is developed by Microsoft and is highly used at corporate and enterprise.
SQL Server High Availability Introduction to SQL Server high availability solutions.
You Inherited a Database Now What? What you should immediately check and start monitoring for. Tim Radney, Senior DBA for a top 40 US Bank President of.
Thank You! Local PASS Community & Sponsors!. Restoring a SQL Server database from Azure Blob Storage (200-level) Randolph
Dealing with Database Corruption DBA 911. Who am I? 2 David M Maxwell twitter.com/dmmaxwell or twitter.com/upsearchsqltwitter.com/dmmaxwelltwitter.com/upsearchsql.
WHEN DATABASE CORRUPTION STRIKES Presented by Steve Stedman Founder/Owner of Stedman Solution, LLC.
The Troubleshooting Process. Hardware Maintenance Make sure that the hardware is operating properly.  Check the condition of parts.  Repair or replace.
SQL Database Management
Oracle Database High Availability
Backups for Azure SQL Databases and SQL Server instances running on Azure Virtual Machines Session on backup to Azure feature (manual and managed) in SQL.
Integrating Disk into Backup for Faster Restores
Database Administration
You Inherited a Database Now What?
Adam Backman Chief Cat Wrangler – White Star Software
Tips for SQL Server Performance and Resiliency
Managing Multi-User Databases
Database Corruption Advanced Recovery Techniques|
Schrödinger’s Backup Will your recovery work?
Designing Database Solutions for SQL Server
Oracle Database High Availability
Warner Chaves MCM / MVP / SQLTurbo.com / Pythian.com
SQL Recovery Freeware is the top notch tool to recover damaged MS SQL database.
Tips for SQL Server Performance and Resiliency
RAID RAID Mukesh N Tekwani
Understanding and Handling Database Corruption
Making PowerShell Useful
Database Corruption Advanced Recovery Techniques
Schrödinger’s Backup Will your recovery work?
Backup and Restore your SQL Server Database
Database Corruption Advanced Recovery Techniques
RPO, RTO & SLA: 3 Letter Words for When the SHT hits the FAN
Turbo-Charged Transaction Logs
Database Corruption Advanced Recovery Techniques
Warner Chaves MCM / MVP / SQLTurbo.com / Pythian.com
Backup to Basics Tom Fox
Warner Chaves MCM / MVP / SQLTurbo.com / Pythian.com
You Inherited a Database Now What?
Performing Database Recovery
RAID RAID Mukesh N Tekwani April 23, 2019
Advanced Recovery Techniques
Presentation transcript:

Database Corruption Advanced Recovery Techniques Patrick Flynn | Link Group Australia Database Corruption Advanced Recovery Techniques

Who Am I Patrick Flynn MCM – SQL Server 2008 MCSM – Data Platform Twitter @sqllensman email sqllensman@outlook.com Happy to answers any queries on this or any other SQL Server issues MCM – SQL Server 2008 MCSM – Data Platform Production DBA for 10+ years.

What we will cover: What is Database Corruption. How Do You Protect Against It What to do when Corruption is found. Sample Corruption Scenarios

What is Database Corruption Loss of Durability Property of Transactions. Physical Corruption Logical Corruption Cannot be prevented!. Causes of Physical Corruption: Problem with the I/O subsystem. Remember the I/O subsystem is everything underneath SQL Server in the I/O stack – including the OS, 3rd-party file system filter drivers, device drivers, RAID controllers, SAN controllers, network hardware, drives themselves, and so on. Millions of lines of code and lots of moving parts spinning very fast, very close to very fragile pieces of metal oxide (I once heard Jim Gray liken a disk drive head to a 747 jumbo jet flying at 500 mph at a height of 1/4 inch from the ground…) Problem with the host machine hardware (0.1% of cases). Most of the time this is a memory error. SQL Server bugs (0.1% of cases). Yes, there have been corruption bugs. Every piece of software has bugs. There are KB articles describing bugs. Deliberate introduction of corruption using a hex editor or other means. Causes of Logical Corruption: People. Application bug. The application deletes one part of an inherent data relationship but not the other. Or the application designer doesn’t implement a constraint properly. Or the application designer doesn’t cope with a transaction roll-back properly. Accidental update/delete. Someone deletes or updates some data incorrectly. SQL Server bug. DBCC CHECKDB when using the REPAIR_ALLOW_DATA_LOSS option. As is documented in Books Online if you run repair, it doesn’t take into account any inherent or explicit constraints on the data.

How do you protect against Corruption: Backup Your Databases Use Checksum on Backups Verify your Backups Have a Restore Strategy not a Back Strategy Run Reports to Check for Missing Backups Run Check DB Use SQL Agent Alerts for Page Corruption Backups Maintenance Plans Ola Hallengren Minion Backup Check DB Minion CheckDB Steve Stedman – Database Health Monitor

Regular and Correct Backups 3-2-1 Backup Rule How Much Do You Lose if Even Just One Backup File Goes Bad? The accepted rule for backup best practices is the three-two-one rule. It can be summarized as: if you’re backing something up, you should have: At least three copies, In two different formats, with one of those copies off-site.

Remember!

Page Corruption Errors 823 – Page IO Read Failure SQL Server was unable to read from disk. 824 – Page Checksum Failure The page checksum calculated did not match what was stored on the page. Requires CHECKSUM verification. 825 – Read Retry Error Severity 10 – A read failed, then succeeded. 832 – In-Memory Checksum Failure Checksum failed to match what was stored in the buffer pool memory. 855 – Uncorrectable hardware memory corruption detected 856 – SQL Server has detected hardware memory corruption, but has recovered the page.

When Corruption is found: Rule 1 Don’t Panic. Have a Plan Rule 2 Don’t Make things Worse. Rule 3 Know your SLAs Have a Documented Plan – Use a Check List Run DBCC Check DB – Let it finish and Review Output

Repair Options Restore from Backup  Restore from Backup Full, Page-Level, Piecemeal Restore from Backup  Replace using Redundant Copies of Data Check DB using Repair Rebuild Manual Correction of Corruption DBCC CHECKDB (REPAIR_ALLOW_DATA_LOSS) Should be Last Resort option

sys.system_internals_partition_columns sys.fn_PhysLocFormatter Tools of Choice Hex Editors DBCC CHECKDB fn_dblog DBCC PAGE DBCC IND Trace Flags: 3604 sys.system_internals_partition_columns sys.fn_PhysLocFormatter

Aim is to avoid this Scenario

Corruption Demos

In Summary Take Backups (and test them ) Monitor for Corruption Checksum is your Friend Practice fixing corruption. Don’t Panic ! For more information see Resources pages

Thank you Please remember to thank the Sponsors And all the Wonderful Volunteers

Resources Steve Stedman Corruption Challenge http://stevestedman.com/category/corruption SQL Skills – Paul S Randal http://www.sqlskills.com/blogs/paul/category/checkdb-from-every-angle SQLSoldier - Robert Davis http://www.sqlsoldier.com/wp/tag/31daysofdisasterrecovery Minion Software – Backups and CheckDB http://minionware.net/backup http://minionware.net/checkdb

Resources cont. ORCA MDF – Mark S Rasmussen Hex Editors Pluralsight http://improve.dk/category/SQL%20Server%20-%20OrcaMDF/ Hex Editors http://xvi32.en.softonic.com/download https://mh-nexus.de/en/hxd/ Pluralsight SQL Server: Detecting and Correcting Database Corruption SQL Server: Detecting and Recovering from Database Corruption