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.
Database Optimization & Maintenance Tim Richard ECM Training Conference#dbwestECM Agenda SQL Configuration OnBase DB Planning Backups Integrity.
Transaction log grows unexpectedly
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.
PPOUG, 05-OCT-01 Agenda RMAN Architecture Why Use RMAN? Implementation Decisions RMAN Oracle9i New Features.
Managing Multi-User Databases AIMS 3710 R. Nakatsu.
16 Copyright © 2007, Oracle. All rights reserved. Performing Database Recovery.
Rajib Kundu Agenda Definitions Failover Cluster Database Snapshots Log shipping Database Mirroring.
Improving Efficiency of I/O Bound Systems More Memory, Better Caching Newer and Faster Disk Drives Set Object Access (SETOBJACC) Reorganize (RGZPFM) w/
Backup and Recovery Overview Supinfo Oracle Lab. 6.
Module 16: Performing Ongoing Database Maintenance
IN-MEMORY OLTP By Manohar Punna SQL Server Geeks – Regional Mentor, Hyderabad Blogger, Speaker.
Week 7 : Chapter 7 Agenda SQL 710 Maintenance Plan:
Alwayson Availability Groups
SQLintersection Understanding Transaction Isolation Levels Randy Knight Wednesday, 3:45-5:00.
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ć.
6 Copyright © Oracle Corporation, All rights reserved. Backup and Recovery Overview.
Strategies for Working with Texas-sized Databases Robert L Davis Database Engineer
Putting Your Head in the Cloud Working with SQL Azure David Postlethwaite 19/09/2015David Postlethwaite.
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.
Database Administration
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 to SQL Server Management for the Non-DBA
Warner Chaves MCM / MVP / SQLTurbo.com / Pythian.com
Exchange OST Recovery Freeware Tool. Index Introduction What is OST File? Reasons for OST file corruption Possible ways to fix OST file corruption issue.
SQL Recovery Freeware is the top notch tool to recover damaged MS SQL database.
SQL Server May Let You Do It, But it Doesn’t Mean You Should
Making PowerShell Useful
RAID RAID Mukesh N Tekwani
Database Corruption Advanced Recovery Techniques
Understanding and Handling Database Corruption
Real world In-Memory OLTP
Making PowerShell Useful
Database Corruption Advanced Recovery Techniques
Making Your Emergency Toolkit
Schrödinger’s Backup Will your recovery work?
TechEd /24/2018 8:21 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
Database Corruption Advanced Recovery Techniques
Turbo-Charged Transaction Logs
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
Azure SQL DWH: Tips and Tricks for developers
You Inherited a Database Now What?
deleted data without backups?
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

Our awesome sponsors! Please visit the sponsor area in the break and interact with them. They are the reason we can hold this conference free of charge!

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

Our awesome sponsors! Please visit the sponsor area in the break and interact with them. They are the reason we can hold this conference free of charge!

Remember to thank the Wonderful Volunteers Thank you! Please complete the evaluation form handed out at the door, after the session. Your feedback will help us to improve future conferences and speakers will appreciate your feedback! Enjoy the conference! Remember to thank 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