Database Corruption Advanced Recovery Techniques

Slides:



Advertisements
Similar presentations
Big Data Working with Terabytes in SQL Server Andrew Novick
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.
Transaction log grows unexpectedly
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.
SQL Server 2008 Implementation and Maintenance Chapter 7: Performing Backups and Restores.
PPOUG, 05-OCT-01 Agenda RMAN Architecture Why Use RMAN? Implementation Decisions RMAN Oracle9i New Features.
Managing Multi-User Databases AIMS 3710 R. Nakatsu.
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.
Module 16: Performing Ongoing Database Maintenance
Recovery System By Dr.S.Sridhar, Ph.D.(JNUD), RACI(Paris, NICE), RMR(USA), RZFM(Germany) DIRECTOR ARUNAI ENGINEERING COLLEGE TIRUVANNAMALAI.
IN-MEMORY OLTP By Manohar Punna SQL Server Geeks – Regional Mentor, Hyderabad Blogger, Speaker.
Week 7 : Chapter 7 Agenda SQL 710 Maintenance Plan:
ADVANTAGES OF DATA BASE MANAGEMENT SYSTEM. TO BE DICUSSED... Advantages of Database Management System  Controlling Data RedundancyControlling Data Redundancy.
Alwayson Availability Groups
Learningcomputer.com SQL Server 2008 – Backup and Restore Database.
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
How to recover... deleted data without backups? Vedran Kesegić.
Strategies for Working with Texas-sized Databases Robert L Davis Database Engineer
SQL Server 2016 – New Features Tilahun Endihnew March 12, 2016.
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.
Agenda for Today  DATABASE Definition What is DBMS? Types Of Database Most Popular Primary Database  SQL Definition What is SQL Server? Versions Of SQL.
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.
You Inherited a Database Now What?
Managing Multi-User Databases
Database Corruption Advanced Recovery Techniques|
Schrödinger’s Backup Will your recovery work?
Designing Database Solutions for SQL Server
Building Effective Backups
Introduction of Week 6 Assignment Discussion
Warner Chaves MCM / MVP / SQLTurbo.com / Pythian.com
SQL Recovery Freeware is the top notch tool to recover damaged MS SQL database.
dbatools! The reason to finally start learning and using Powershell
RAID RAID Mukesh N Tekwani
Database Corruption Advanced Recovery Techniques
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
TechEd /24/2018 8:21 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
Turbo-Charged Transaction Logs
Database Corruption Advanced Recovery Techniques
Warner Chaves MCM / MVP / SQLTurbo.com / Pythian.com
dbatools! The reason to finally start learning and using Powershell
Backup to Basics Tom Fox
Warner Chaves MCM / MVP / SQLTurbo.com / Pythian.com
Making PowerShell Useful
Introduction of Week 13 Return assignment 11-1 and 3-1-5
You Inherited a Database Now What?
deleted data without backups?
GitHub 101 Using Github and Git for Source Control
RAID RAID Mukesh N Tekwani April 23, 2019
Advanced Recovery Techniques
dbatools! The reason to finally start learning and using Powershell
Using wait stats to determine why my server is slow
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. 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.

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 Full, Page-Level, Piecemeal Requires working, tested Backups!! 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 DBATools.io Function to Test Backups and Test Restores, Run CheckDB

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

Structure of Page

Page Structure at Byte Level Data Record http://improve.dk/deciphering-a-sql-server-data-page/ http://aboutsqlserver.com/2013/10/15/sql-server-storage-engine-data-pages-and-data-rows/

Aim is to avoid this Scenario First requirement is: Don’t make things worse

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

Social Make sure you tweet on #sqlsat702 or #sqlsatmalaysia Don’t forget to thank Sponsors, Volunteers and Speakers!

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