Top Banner
Prevent Recovery Amnesia Forget The Backups
34
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Prevent Recovery Amnesia - Forget The Backups

Prevent Recovery AmnesiaForget The Backups

Page 2: Prevent Recovery Amnesia - Forget The Backups
Page 3: Prevent Recovery Amnesia - Forget The Backups

Recovery Objectives

Page 4: Prevent Recovery Amnesia - Forget The Backups

RTO

Amount of time which data or hardware is desired to be restored after data corruption or hardware failure

Usually referred to in 9’s

• 5 9’s = 99.999 % up time• Just over 5 minutes of allowable downtime per year (means

maintenance)

• 4 9s = 52.5 minutes

• 3 9s = 8.75 hrs

• 5 9s between 9-5 different than 5 9s 24/7

Page 5: Prevent Recovery Amnesia - Forget The Backups

RPO

Point in time that data can be restored from.• Minutes

• Hours

• Days

• Weeks

Basically – How much work can be lost?

Page 6: Prevent Recovery Amnesia - Forget The Backups

SLA

RPO & RTO together = Service Level Agreement

• Need to know for each database you are responsible for

• Press business managers / owners for business driven decisions on what acceptable values are

• MUST consider the business implications of downtime and data loss

Page 7: Prevent Recovery Amnesia - Forget The Backups

Recovery Strategy

Page 8: Prevent Recovery Amnesia - Forget The Backups

Recovery Strategy

Backups are worthless• If can’t restore to meet business requirements

Most critical of DBA duties

Practice, practice, practice

Practice different scenarios• Point in time

• Corrupt page

Don’t forget the Keys!

Page 9: Prevent Recovery Amnesia - Forget The Backups

Keys & Offsite Storage

Backup certificates and keys• First thing done on any server

• If lost, data could be too

Keys to backup• Service Master Key

• Database Master Key

• Symmetric, Asymmetric & Certificates

Offsite storage• Necessary evil

• Mitigate the risks

Page 10: Prevent Recovery Amnesia - Forget The Backups

Backup Models

Page 11: Prevent Recovery Amnesia - Forget The Backups

Simple

No log backupAuto reclaims

Changes since most recent backup unprotected

Only recover to end of backup

Page 12: Prevent Recovery Amnesia - Forget The Backups

Full

Requires log backups

No work lost due to lost or damaged data file

Restore to an arbitrary point in time

Normally no loss of data, but slight risk

Page 13: Prevent Recovery Amnesia - Forget The Backups

Bulk Logged

Special purpose

Reduce log space

No point in time recovery supported

Temporary use for bulk operations

Page 14: Prevent Recovery Amnesia - Forget The Backups

Demo

Log • Growth

• Free space

Page 15: Prevent Recovery Amnesia - Forget The Backups

Backup Scope

Page 16: Prevent Recovery Amnesia - Forget The Backups

Database

• Entire database

• Includes• Schema

• Data contents

• Transaction log to restore from scratch

• Simplest way to restore

• Lot of disk space

• Lot of time

Page 17: Prevent Recovery Amnesia - Forget The Backups

Partial

Alternative to database backups for VLDB

Good for read-only data

Includes• Primary filegroup

• All read/write filegroups

• Specified read-only filegroups

Page 18: Prevent Recovery Amnesia - Forget The Backups

File

Individual files and / or filegroups

Compliment partial backups

Usually included in complex backup models

Page 19: Prevent Recovery Amnesia - Forget The Backups

Backup Types

Page 20: Prevent Recovery Amnesia - Forget The Backups

Full

All data within the backup scope

Entire contents of files and filegroups

Does not truncate transaction log• Simple recovery model only

Base for other backup types

Page 21: Prevent Recovery Amnesia - Forget The Backups

Differential

Only what changed since last full backup

Faster

Must restore full backup first

Page 22: Prevent Recovery Amnesia - Forget The Backups

Log

Transaction log

Must have full backup first

Not an option with simple recovery mode

Truncates log by writing committed transaction to disk

Page 23: Prevent Recovery Amnesia - Forget The Backups

Tail Log

Captures log records not yet backed up

Keeps log chain intact

Required to recover to latest point in time

Not all scenarios require

Page 24: Prevent Recovery Amnesia - Forget The Backups

Demo

Restore• Point in time

Page 25: Prevent Recovery Amnesia - Forget The Backups

Compression

Page 26: Prevent Recovery Amnesia - Forget The Backups

Compression

Saves space & I/O

Heavy impact on CPU

Set at server level• Time of backup

Compression ratio• Msdb.dbo.backupset

• Backup_size / compressed_backup_size

Page 27: Prevent Recovery Amnesia - Forget The Backups

Encryption

Page 28: Prevent Recovery Amnesia - Forget The Backups

Encryption

New for SQL 2014

Encrypt while backing up

Requires Database Master Key• Certificate

• Asymmetric key (EKM only)

If using TDE • Use different certificates & keys to increase security

Page 29: Prevent Recovery Amnesia - Forget The Backups

More for 2014

Page 30: Prevent Recovery Amnesia - Forget The Backups

New backup Features

SQL Server Backup to URL• SQL 2012 SP1 CU2

• T-SQL, PowerShell, SMO

• 2014 adds SSMS

SQL Server Managed Backup to Windows Azure• Database or Instance level

• Recommended for SQL Server instance on Azure VMs

Encryption for Backups

Page 31: Prevent Recovery Amnesia - Forget The Backups

Backup Myths

Page 32: Prevent Recovery Amnesia - Forget The Backups

Myths

Backup operations cause blocking

Concurrent transaction backup can’t be done when full/differential in progress

Backups always test page checksums

Backups read through the buffer pool

Full or differential backups clear the log

Backups perform consistency checks

If the backup works, so will the restore

Page 33: Prevent Recovery Amnesia - Forget The Backups

Myths

Tail of log backups are always possible

Use snapshots instead of backups

Log backups are the size of the log

Cannot backup a corrupt database

Log backups always clear the log

No need to backup the system databases

Always plan a good backup strategy

Always plan a good recovery strategy!

Page 34: Prevent Recovery Amnesia - Forget The Backups

Keep In Touch

• @CBELLDBA

[email protected]

• www.WaterOxConsulting.com