Digging Out From Corruption Eddie Wuerch, MCM - Principal, Database Performance - Salesforce Marketing Cloud Data protection and loss recovery with SQL.

Slides:



Advertisements
Similar presentations
Recovery CPSC 356 Database Ellen Walker Hiram College (Includes figures from Database Systems by Connolly & Begg, © Addison Wesley 2002)
Advertisements

Module 7 Restoring SQL Server 2008 R2 Databases. Module Overview Understanding the Restore Process Restoring Databases Working with Point-in-time Recovery.
FlareCo Ltd ALTER DATABASE AdventureWorks SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS Slide 1.
©2006 ITT Educational Services Inc. Course Name: IT390 Business Database Administration Unit 5 Slide 1 IT390 Business Database Administration Unit 5 :
Vinod Kumar Technology Evangelist | Microsoft
SQL Server Data Protection and High Availability Anil Desai.
Microsoft SQL Server Administration for SAP Database Backup and Restore.
Week 9 – Chapter 8 SQL 710 Methods to Backup Databases
Module 7: Restoring Databases. Overview SQL Server Recovery Process Preparing to Restore a Database Restoring Backups Restoring Databases from Different.
Backup and Recovery (2) Oracle 10g CAP364 1 Hebah ElGibreen.
Backup and Recovery Part 1.
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
Database Configuration and Maintenance Database Configuration and Maintenance Exam / 30.
Presented by Joseph Galvan & Stacy Kemp BACKUPS.  Using database backups, a database administrator (DBA’s) can restore from the last backup or to a specific.
Using RMAN to Perform Recovery
Building Highly Available Systems with SQL Server™ 2005 Vineet Gupta Evangelist – Data and Integration Microsoft Corp.
SQL Server 2008 Implementation and Maintenance Chapter 7: Performing Backups and Restores.
Chapter 11: Designing a Data Recovery Solution for a Database MCITP Administrator: Microsoft SQL Server 2005 Database Server Infrastructure Design Study.
It is one of the techniques to create a stand by server. Introduced in SQL 2000,enhanced in It is a High Availability as well as Disaster recovery.
15 Copyright © 2005, Oracle. All rights reserved. Performing Database Backups.
Sofia, Bulgaria | 9-10 October SQL Server 2005 High Availability for developers Vladimir Tchalkov Crossroad Ltd. Vladimir Tchalkov Crossroad Ltd.
16 Copyright © 2007, Oracle. All rights reserved. Performing Database Recovery.
DATABASE MIRRORING  Mirroring is mainly implemented for increasing the database availability.  Is configured on a Database level.  Mainly involves two.
Architecture Rajesh. Components of Database Engine.
Rajib Kundu Agenda Definitions Failover Cluster Database Snapshots Log shipping Database Mirroring.
IT 456 Seminar 5 Dr Jeffrey A Robinson. Overview of Course Week 1 – Introduction Week 2 – Installation of SQL and management Tools Week 3 - Creating and.
Backup and Recovery Overview Supinfo Oracle Lab. 6.
Module 16: Performing Ongoing Database Maintenance
MS SQL by: Bryan Bankhead CIS 407. General Concepts  Backing up and Restoring databases and transaction logs is a way that SQL Server provides protection.
Week 7 : Chapter 7 Agenda SQL 710 Maintenance Plan:
1 Chapter Overview Understanding Data Restoration Issues Understanding the Types of Database Backups Understanding the Restoration Process.
Connect with life Vinod Kumar Technology Evangelist - Microsoft
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 |
Log Shipping, Mirroring, Replication and Clustering Which should I use? That depends on a few questions we must ask the user. We will go over these questions.
Backing Up and Restoring Databases Advanced Database Dr. AlaaEddin Almabhouh.
Strategies for Working with Texas-sized Databases Robert L Davis Database Engineer
SQL Server High Availability Introduction to SQL Server high availability solutions.
AGENDA 1.Importance of backups and backup strategy 2.Full DB backup and Restore 3.Filegroup Backup and restore 4.File Backup and Restore 5.Page restore.
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.
Jeremy Kingry, eBECS | ADVANCED SQL SERVER FOR ADMINS AND ANALYSTS.
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.
Database recovery contd…
Partial Database Availability
Database Administration
You Inherited a Database Now What?
A Day in the Life of a Row Eddie Wuerch, mcm
Database Corruption Advanced Recovery Techniques|
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
Database Administration for the Non-DBA
Database Corruption Advanced Recovery Techniques
Understanding and Handling Database Corruption
Back Up and Restore? Piece of Cake!
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.
Database Corruption Advanced Recovery Techniques
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
Advanced Recovery Techniques
Disaster Recovery Done Dirt Cheap Founder Curnutt Data Solutions
Backup & Recovery.
Presentation transcript:

Digging Out From Corruption Eddie Wuerch, MCM - Principal, Database Performance - Salesforce Marketing Cloud Data protection and loss recovery with SQL Server

I am a DBA I am a steward of my company’s data Data loss can close my company Data loss can ruin my career Data loss shall not occur

Hi, I’m Eddie! And I’m a DBA. Over 15 years SQL Server Microsoft Certified Master Salesforce Marketing Cloud ◦Trillions of rows … 10+ billion tx/day … PBs data & indexes… ◦…24x7, no downtimes

What is “Corruption”? Logical Corruption DELETE dbo.BigTable A bazillion rows affected.

What is “Corruption”? Physical Corruption SELECT id,… dbo.BigTable Error 824

Corruption LOGICAL – HUMAN ERROR Incorrect data mods Detection is up to you Manually fix data/restore DB PHYSICAL – DAMAGED MEDIA File damage Incomplete writes SQL Errors: 823, 824, 825 DBCC CHECKDB Discreet restore options AG Auto-repair (!!)

Physical Corruption- Detection CHECKSUM Page Verification ◦Always use this. Every database. Agent alerts: 823, 824, 825 msdb.dbo.suspect_pages Detection on page access. Corruption may lie dormant for a long time

823/824/825 - DON’T PANIC DBCC CHECKDB ◦Get used to this BEFORE disaster ◦Run without repair opts ◦Let it complete ◦Your problem may fixed by dropping an index ◦Investigate performance techniques

Preparation A backup never saved anybody’s job. The restore did. Plan for the restore, not the backup

The Restore Strategy RPO & RTO: What are your goals? Layers of disaster / layers of recovery ◦Disk, Server, Network, Datacenter… Time = money ◦Lower downtime = higher cost of equipment and labor ◦Higher RPO/RTO = higher potential cost of fines, loss of business, refunds, etc. ◦RPO/RTO determined by cost

Backup Options Full Backup Database, Filegroup, File All recovery models Differential Database, Filegroup, File All recovery models Transaction log Database only Not available in SIMPLE recovery mode

The Full Database Backup Restore an entire database Begin a point-in-time restore Begin point of a FG/file/page restore (pull 8kb from last week’s backup, place it in running database) Does NOT break the log chain

The Full Backup File(s) Contains every allocated page Plus enough tx log to bring DB consistent Tx log will not be cleared during full backup (space planning)

Differential Backups All changed extents since last Full backup Plus enough tx log for consistency Can save lots of time on restores

Log Backups Changes since last log backup Sequential record of all changes Can be taken after loss of data file(s), if log file is available (Full Recovery Model only) N/A for Simple Recovery Model

The Transaction Log One file per DB is enough Write-ahead logging Both redo and undo tracked ACID

The Transaction Log Recovery Model vs. Logging Model Crash recovery

Bulk-Logged Recovery Model Full recovery model, with exceptions: ◦Minimally-logged transactions (ML) only record allocations ◦Log can’t redo – CHECKPOINT on commit (ouch!) Log backups of ML transactions include all changed data pages

The Log Chain Each log backup = changes since last log backup The sequential collection of restorable transaction log backups = log chain Starts with a full backup Is not tied to the most recent full backup

BACKUP… MIRROR TO Enterprise Edition only Specify additional copies of backup file(s) Up to 3 mirrors Works with Full, Diff, and Log backups

Restore Options Entire database in one operation Partial (Ent.Ed.) ◦Restore PRIMARY FG, bring DB online ◦Restore additional FGs, bring online one-by-one (partitioning bonus) Corruption Fixes (Online if Ent.Ed.): ◦Restore damaged files ◦Repair damaged pages

Restore Options BACKUP LOG … TO DISK = ' V:\Logs\... ' MIRROR TO DISK = ‘ W:\Logs\... '

Restore Options

Demo Disk corruption – non-clustered index Disk corruption – clustered index Lost data file Physical Corruption: detection and different restore/repair types (Let’s break stuff!)

Snapshots …are not backups.

Snapshots SQL, SAN, etc – generally the same Point-in-time image Copy-on-Write Only changed pages in snapshot (pre-change) Are not backups

Snapshots #DEVCONNECTIONS

Document, Practice, Drill, Repeat At restore time: panic, anguish, and unhappy executives Crises don’t honor vacation schedules or work hours Script, automate, document

Stick around for the raffle! Then join us at the afterparty at Champps Americana Thanks for attending! Please fill out the survey. Download these slides and scripts at SQLSaturday.com