Back From the Dead: How to Restore a SQL Server in 60 Minutes or Less*



Similar documents
DBA 101: Best Practices All DBAs Should Follow

Best Practices Every SQL Server DBA Must Know

SQL Server for Database Administrators Course Syllabus

ESSENTIAL SKILLS FOR SQL SERVER DBAS

Database Maintenance Essentials

Designing, Optimizing and Maintaining a Database Administrative Solution for Microsoft SQL Server 2008

Restoring SQL Server Database after Accidental Deletion of.mdf File. SQL Server /06/2016

Explain how to prepare the hardware and other resources necessary to install SQL Server. Install SQL Server. Manage and configure SQL Server.

MS Design, Optimize and Maintain Database for Microsoft SQL Server 2008

Maintaining a Microsoft SQL Server 2008 Database

Course Syllabus. Maintaining a Microsoft SQL Server 2005 Database. At Course Completion

Perforce Backup Strategy & Disaster Recovery at National Instruments

INSIDE. Preventing Data Loss. > Disaster Recovery Types and Categories. > Disaster Recovery Site Types. > Disaster Recovery Procedure Lists

Computer Visions Course Outline

Course Syllabus. At Course Completion

Missed Recovery Techniques for SQL Server By Rudy Panigas

Course. Overview. Length: 5 Day(s) Published: English. IT Professionals. Level: Type: Method: Delivery. Enroll now (CAL)

Implementing a Microsoft SQL Server 2005 Database

Backup and Recovery 1

Availability and Disaster Recovery: Basic Principles

General DBA Best Practices

Backups and Maintenance

Contingency Planning and Disaster Recovery

IDERA WHITEPAPER. The paper will cover the following ten areas: Monitoring Management. WRITTEN BY Greg Robidoux

MIRRORING: START TO FINISH. Ryan Adams Blog - Twitter

High Availability and Disaster Recovery Solutions for Perforce

Website Disaster Recovery

DB2 9 for LUW Advanced Database Recovery CL492; 4 days, Instructor-led

Backup and Recovery. What Backup, Recovery, and Disaster Recovery Mean to Your SQL Anywhere Databases


Creating A Highly Available Database Solution

Exam : Transition Your MCTS on SQL Server 2008 to MCSA: SQL Server 2012, Part 2. Title : The safer, easier way to help you pass any IT exams.

TABLE OF CONTENTS THE SHAREPOINT MVP GUIDE TO ACHIEVING HIGH AVAILABILITY FOR SHAREPOINT DATA. Introduction. Examining Third-Party Replication Models

How To Fix A Powerline From Disaster To Powerline

EMC Backup and Recovery for Microsoft SQL Server 2008 Enabled by EMC Celerra Unified Storage

Designing Database Solutions for Microsoft SQL Server 2012 MOC 20465

MS SQL Server DBA Training Course. Table of Contents

Veeam Backup and Replication Architecture and Deployment. Nelson Simao Systems Engineer

Mind Q Systems Private Limited

Microsoft SQL Database Administrator Certification

Backup and Data Management Best Practices

SQL Server 2012 Database Administration With AlwaysOn & Clustering Techniques

Yiwo Tech Development Co., Ltd. EaseUS Todo Backup. Reliable Backup & Recovery Solution. EaseUS Todo Backup Solution Guide. All Rights Reserved Page 1

Module 07. Log Shipping

Oracle Database 10g: Backup and Recovery 1-2

Availability Guide for Deploying SQL Server on VMware vsphere. August 2009

126 SW 148 th Street Suite C-100, #105 Seattle, WA Tel: Fax:

Administering and Managing Log Shipping

A SURVEY OF POPULAR CLUSTERING TECHNOLOGIES

Database Backup and Recovery Guide

Course 2788A: Designing High Availability Database Solutions Using Microsoft SQL Server 2005

EZManage SQL Pro. Quick guide for installation and implementation

Leveraging Virtualization for Disaster Recovery in Your Growing Business

SQL Server Storage: The Terabyte Level. Brent Ozar, Microsoft Certified Master, MVP Consultant & Trainer, SQLskills.com

How To Make Biztalk Highly Available

Backup and Restore Back to Basics with SQL LiteSpeed

Recover a CounterPoint Database

UBGP008: Maximizing SQL Server Performance with Microsoft Dynamics GP. John Lowther

Working with SQL Server Agent Jobs

Version: Page 1 of 5

Destiny system backups white paper

Backup and Data Management Best Practices

$99.95 per user. SQL Server 2008/R2 Database Administration CourseId: 157 Skill level: Run Time: 47+ hours (272 videos)

Virtual Infrastructure Security

SQL Server Database Administrator s Guide

How To Manage A Database Server 2012

This article Includes:

If you have questions or need assistance, contact PCS Technical Services using the contact information on page 10.

Key Elements of a Successful Disaster Recovery Strategy: Virtual and Physical by Greg Shields, MS MVP & VMware vexpert

MySQL Enterprise Backup

SQL Server 2008 Designing, Optimizing, and Maintaining a Database Session 1

Disaster Recovery and Business Continuity What Every Executive Needs to Know

McAfee Endpoint Encryption Hot Backup Implementation

Blackboard Managed Hosting SM Disaster Recovery Planning Document

Backup and Recovery in MS SQL Server. Andrea Imrichová

Database Maintenance Guide

Backup, Restore and Options for SQL Server

SYSPRO Point of Sale: Architecture

Contents. SnapComms Data Protection Recommendations

Planning, Implementing and Managing SafeBoot Enterprise Systems

Module 14: Scalability and High Availability

SQL Server Solutions GETTING STARTED WITH. SQL Safe Backup

Redundancy Options. Presented By: Chris Williams

Understanding and Controlling Transaction Logs

Data Protection with IBM TotalStorage NAS and NSI Double- Take Data Replication Software

High Availability and Disaster Recovery for Exchange Servers Through a Mailbox Replication Approach

Database Administrator Certificate Capstone Project Evaluation Checklist

Upgrading Your SQL Server 2000 Database Administration (DBA) Skills to SQL Server 2008 DBA Skills Course 6317A: Three days; Instructor-Led

BounceBack Server Solution Reference Guide

Introduction. Setup of Exchange in a VM. VMware Infrastructure

Transcription:

Back From the Dead: How to Restore a SQL Server in 60 Minutes or Less* *Assuming You Plan for It Brad M. McGehee SQL Server MVP Director of DBA Education Red Gate Software www.bradmcgehee.com

So Many Ways Disasters Can Occur, and So Many Ways to Deal with Them There is no way I can cover every potential disaster scenario, unless I had several days to cover them all. Because of this, the focus of this session is very narrow, with an emphasis on one of the most common and simple ways to recover a server. I will be covering these assumptions as I proceed through the session.

My Assumptions About You You may be a part-time or full-time DBA. You may be a DBA Administrator or DBA Developer. You probably have less than 1-2 years experience working with SQL Server, but little experience restoring databases in the context of an emergency. You probably manage 10 or less SQL Server instances. Your databases are probably 100GB or smaller. You probably don t have a 24/7 uptime requirement.

What are We Going to Learn Today Planning for the Worst Different Ways to Recover a SQL Server Instance How to Prepare for Database Recovery Introducing our Sample Disaster Scenario Demo a Safe and Easy Way to Recover a SQL Server Instance (Although it Requires Planning)

What We Won t be Covering Today What we won t be talking about: Log Shipping Database Mirroring Failover Clustering or Virtual Server Failover All of these are good options, but more often than not in the real world, none of the above have been implemented for most SQL Server instances. The focus of this session is on how do you recover your instance when the above options have not been implemented, and all you have are backups.

Different Ways to Recover a SQL Server Instance Rebuild a new server from scratch. Rebuild a new server from an image. Cold backup SQL Server. (Not well prepared.) Warm backup SQL Server. (Well prepared & our assumption for our upcoming demo.) Use an existing SQL Server already in production. All of the above options are similar, but with minor variations that can affect how fast we can recover.

Planning for the Worst #1 As DBAs, it is our job to protect the organization s data. More specifically, this means: We realize that it is not if, but when, we will experience a problem that results in the loss of a database/server. We know how to properly backup databases. We know how to restore databases so that they can be back in production as quickly as possible, with the least amount of data loss possible. But the thing that keeps me up at night is will I know how to deal with all the different combinations of problems that I could potentially face?

Planning for the Worst #2 When databases go bad, there is often a cascading set of events that occur that often make the problem worse. Never forget this. As DBAs, we need to be prepared to deal with as many situations as possible. The only way to really prepare is to produce a carefully thought-out DR plan that covers as many contingencies as possible, and to practice them. A major goal of this session is to get you thinking about what should be added to your DR plan.

So How Do You Plan for the Worst? For the rest of this session, I am going to demonstrate a safe and easy way to recover a user database/server based on the scenario already stated. Keep in mind that this option assumes that you have done your homework and you are prepared to perform this task. If you are prepared, you will be up and running fast. If you are not prepared, you are setting yourself up for failure, a lot of stress, and unhappy users.

How to Prepare for Database Recovery #1 Planning has gone into deciding where databases should be moved in case of a database failure. Keep a spare server on hand (new hardware, cold, warm) Use existing servers Planning has gone into determining the best way to point your application at a new SQL Server name. Full, differential (if used), and transaction log backups are taken consistently, tested, stored away from the server immediately after being made, but are readily available when needed.

How to Prepare for Database Recovery #2 Scripts have been prepared to restore databases. Don t depend using SSMS for restoring. All database-related objects (the database ecosystem) have been scripted, kept up-to-date, documented, and are available. Security Jobs Linked Servers SSIS Packages All of the above has been documented so that they can be followed in a step-by-step.

How to Prepare for Database Recovery #3 Instant file initialization has been turned on for the servers to accept the restored databases. http://www.bradmcgehee.com/2010/07/instant-file-initialization-speeds-sql-server/ Backup compression should be used to make the backups & to speed the performance of restores. Folder structures are standardized for all SQL Servers so you don t have to worry about different file locations. If not, then ensure scripts can deal with this. Test your plan regularly to see if it works.

Assuming Planning Has Been Done Right We are now prepared for dealing with many (but of course not all) database recovery situations. So let s take a look at our database recovery example.

Introducing our Sample Disaster Scenario #1 A single SQL Server instance running on a server. Instance has system databases and only one user database. TDE is not being used. MDFs & LDFs reside on different arrays (local, DAS, SAN). SQL Server Agent jobs perform database backups and maintenance. Full backups are taken nightly. No differentials. Transaction log backups are taken every 15 minutes. Backups are moved immediately to other device.

Introducing our Sample Disaster Scenario #2 The array that holds the MDF files for the system and user database begins to fail, and major corruption begins to occur on the user database due to hardware failure. Application can t access data. At this point, there are two major possibilities: Database is not accessible at all, and a tail-log backup cannot be performed. Database is partially accessible, and a tail-log backup can be performed to recover transactions that occurred since the last transaction log backup. This is our assumption.

Introducing our Sample Disaster Scenario #3 We quickly realize that the existing hardware can t be fixed immediately and the user database must be moved to a new server as soon as possible to minimize down time. The key now, is how fast can we get the database up and running on new hardware. How fast this is possible is dependent on how well prepared you are for dealing with such disaster scenarios.

Demo Explain primary server setup Explain secondary server setup Script users and jobs on primary Perform full, log, and tail-log backups on primary Restore AdventureWorks database on secondary Restore users and jobs on secondary Test secondary is working and application can talk to it.

Take Aways From This Session As the DBA, it is your responsibility to consider all the potential disasters you might encounter (small to large). You must create a detailed and tested DR plan to ensure that you can recover a database as quickly as possible and with the least amount of data loss as possible. If you have not done so yet, then make this your first priority when you get back to work.

E-Books, Websites, Slides & More Free E-books on SQL Server: www.sqlservercentral.com/books http://www.sqlskills.com/blogs/paul/commo nsqlservermyths.pdf Check these websites out: www.sqlservercentral.com www.simple-talk.com Blogs: www.bradmcgehee.com www.twitter.com/bradmcgehee Contact me at: bradmcgehee@hotmail.com

"All the Red Gate products I used are a delight Doron Grinstein, Technical Director, Walt Disney

sponsored by