+ All Categories
Home > Technology > Admin High Availability

Admin High Availability

Date post: 14-Jun-2015
Category:
Upload: rsnarayanan
View: 841 times
Download: 0 times
Share this document with a friend
Popular Tags:
30
Transcript
Page 1: Admin High Availability
Page 2: Admin High Availability

Implementing High-Availability Solutions for the right problem with SQL Server 2008 Amit Bansal

CTOeDominer Systems P Ltd | Peopleware India

Page 3: Admin High Availability

Who is Amit Bansal?

CTO, eDominer Systems & Peopleware IndiaConducted more than 200 workshops on SQL Server & BI for top notch IT companies world wideMicrosoft MVP for SQL ServerMicrosoft Certified Trainer Advisory Council memberSpeaker at TechED India, TechED US & TechED EuropeTechnical Reviewer – MSL courses on SQL ServerSME – SQL Server 2008 certificationsUG Lead (Delhi NCR) – CulminisManager – www.WeTogether.in, www.DelhiDevs.com, www.BlogBoard.in

Page 4: Admin High Availability

Agenda? --- TODO

Intro to High-Availability/DRKey TermsAlways On Technologies

Overview, Planned / Unplanned downtimeWhen to useEnhancements in SQL Server 2008

Combining TechnologiesSumming it up

Page 5: Admin High Availability

What is Availability?

Availability is defined by an implicit or explicit application specific Service Level AgreementExample

The ordering system is considered available when orders can complete in less than one minute. The maximum downtime acceptable is five minutes per month.Downtime = the amount of time when the SLA is not metTypically uptime is tracked (i.e. 99.993%), which doesn’t include the “planned” downtime

The SLA should be used during design, deployment, and production monitoring phases of the application lifecycle

Page 6: Admin High Availability

Intro to Disaster Recovery

Processes and procedures designed to restore business operations due to a natural or human-induced disaster

Typically involves providing redundancy spanning multiple sites or across geographic regions

Page 7: Admin High Availability

Key Terms

SLA Metrics:Recovery Point Objective (RPO) = data loss

How much data can you lose?guided by criticality of application data

Recovery Time Objective (RTO) = downtimeHow much downtime can you tolerate?guided by availability requirements

Local High-Availability (Local HA)Site Disaster Recovery (Site DR)

Page 8: Admin High Availability

Always On TechnologiesSAN/RAIDBackup and RestoreLog ShippingDatabase MirroringFailover ClusteringReplication

Rolling Upgrades and PatchingOnline OperationsResource GovernorDatabase Snapshots

Unplanned Downtime

Planned Downtime

Page 9: Admin High Availability

Always On Availability ScenariosSystem Administration

Upgrades, Index rebuilds…

Logical Errors (User or Application)Incorrect data modifications, accidental changes…

Site DisasterHurricanes, fires…

Hardware FailuresMemory, network, disks…

Software FailuresBugs

Page 10: Admin High Availability

Categorizing Availability On Solutions

High Availability Requirement

Solution

System Administration Online management

Recovery from application or user errors

Logical recovery

Site disaster protection Database or storage mirroring

Database workload scale out with redundancy

Replication

Page 11: Admin High Availability

Online ManagementDowntime Scenarios

Applying a patch or upgradeMoving a table as part of system maintenanceDeploying a new version of an applicationRecovering from a corrupted data file

Always On SolutionsRolling Upgrades utilizing Database Mirroring, Log Shipping, or ReplicationFast recoveryOnline alter table, index create, index rebuildOnline granular restore

Page 12: Admin High Availability

Categorizing Availability On Solutions

High Availability Requirement

Solution

System Administration Online management

Recovery from application or user errors

Logical recovery

Site disaster protection Database or storage mirroring

Database workload scale out with redundancy

Replication

Page 13: Admin High Availability

Recovery from User or Application Errors

Downtime ScenariosA table is accidentally droppedAn application makes incorrect updates to dataA user possibly made unauthorized changes to data

Always On SolutionsView point in time snapshots of the system

Take database snapshots at intervalsLog ship to another site using restore delay/standby options Compare table to older version using tablediff utility

Track history of DML statements Use SQL Trace or customized replication

Page 14: Admin High Availability

Log Shipping

LogBackup

Log ShippingHow it works

PrimaryDB

SecondaryDB

Secondary InstancePrimary Instance

Transaction Log Backup

Transaction Log BackupTransaction Log Backup

Transaction Log BackupTransaction Log Backup

Transaction Log BackupTransaction Log Backup

Log Backup Copy

Transaction Log Backup

Update ordersset….

LogRestore

Page 15: Admin High Availability

SQL Server - Database Snapshots

HADB

V1

Select from orderswhere…

Update ordersset….

Dat

abas

e Fi

les

Inst

ance

V2

HADBSnapshot

Maintains the original snapshot view

of the database from the time of creation

Create database “HADB Snapshot” on ( filename=<files>)as snapshot of “HADB”

Dat

abas

e Pa

ges

Page 16: Admin High Availability

Tablediff command line utility

usage: tablediff -- Source Options -- -sourceserver Source Host -sourcedatabase Source Database -sourceschema Source Schema Name -sourcetable Source Table or View -sourceuser Source Login -sourcepassword Source Password -sourcelocked Lock the source table/view durring tablediff -- Destination Options -- -destinationserver Destination Host -destinationdatabase Destination Database -destinationschema Destination Schema Name -destinationtable Destination Table or View -destinationuserDestination Login -destinationpassword Destination Password -destinationlocked Lock the destination table/view durring tablediff -- Misc Options -- -t Timeout -c Column Level Diff -f Generate Fix SQL (You may also specify a file name and path) -q Quick Row Count -et Specify a table to put the errors into -dt Drop the error table if it exists -o Output file -b Number of bytes to read for blob data types (Default 8000) -strict Strict compare of source and destination schema -rc Number of retries -ri Retry interval

Tablediff identifies the data differences between two tablesTables must have same schema but can be on different serversUse the –f option to generate a SQL Server script to fix the out of sync destination versionThe diff algorithm uses an efficient hash technique

\Program Files\Microsoft SQL Server\90\COM\tablediff.exe

Page 17: Admin High Availability

Categorizing Availability On Solutions

High Availability Requirement

Solution

System Administration Online management

Recovery from application or user errors

Logical recovery

Site disaster protection Database or storage mirroring

Database workload scale out with redundancy

Replication

Page 18: Admin High Availability

Site Disaster ProtectionDowntime Scenarios

Earthquake, fire, or flood causes datacenter outageAlways On Solutions

Database Mirroring to a secondary siteOptimized solution - allows very fast failover times to the secondary siteOptionally add log shipping for additional site protection

Third party geo-clustering solutions for data center storage level redundancy

Find SQL Server Always On reviewed solutions at the Microsoft Always On website: www.microsoft.com/SQL/AlwaysOn

Page 19: Admin High Availability

Database MirroringSynchronous mode

MirrorPrincipal

Witness

Log

Application

SQL Server SQL Server

2

2

4

51

Data DataLog

3>2 >3

Mirror is always redoing—it remains currentCommit

Page 20: Admin High Availability

Database Mirroring – trade offs

Hot-standby+ Fastest failover (best RTO)

Synchronous+ No data loss (RPO=0)- Performance impact for commit

Limited to one mirror per databasePerformance impact increases with number of mirrored databasesNo read access to mirror

Page 21: Admin High Availability

Automatic Page Repair in DB MirroringNameTitleCompany

demo

Page 22: Admin High Availability

Categorizing Availability On Solutions

High Availability Requirement

Solution

System Administration Online management

Recovery from application or user errors

Logical recovery

Site disaster protection Database or storage mirroring

Database workload scale out with redundancy

Replication

Page 23: Admin High Availability

Database Scale Out with Redundancy

ScenarioReal time reporting on one or more secondary servers that can also be used for disaster recoveryTier of identical databases for scaling out applications which are partitioned by site

SolutionsTransactional Replication Peer to Peer Replication

Page 24: Admin High Availability

Database Scale Out with Redundancy

New Jersey

Transactional ReplicationReporting + Redundancy

Peer to Peer ReplicationScale Out* + Redundancy

New York

Boston

SeattleTokyo

Shanghai

England

*Application data modifications must be partitioned by site to prevent conflicts

Page 25: Admin High Availability

Peer-to-Peer Replication – Enhancements in SQL Server 2008

demo

Page 26: Admin High Availability

Combining TechnologiesFailover Clustering

Local server redundancy

Database MirroringPrimary disaster site for databases

Log ShippingAdditional disaster sites for databasesApp/user error recovery

ReplicationDatabase reporting and read scale out with redundancy

Always On Partner SolutionsHighest hardware reliability

Database MirroringHot Standby

Warm Standby

App/User Error Recovery

Log Shipping

Log Shipping With Restore Delay

ProductionDatabase

Replication

DatabaseScale OutFor QueriesFailover Clustering

Page 27: Admin High Availability

Summary - Unplanned DowntimeRedundancy Stack

Application

•Replication

Query (Logical)

•Failover Clustering

SQL Server Instance

•Database Mirroring

•Log Shipping

•Backup and Restore

Log/Database (Physical)

•SAN/RAID

Hardware

Page 28: Admin High Availability

धन्यवा�दઆભા�ર ধন্য�বা�দ

ਧੰ�ਨਵਾ�ਦ

ଧନ୍ୟ�ବା�ଦ

நன்றி�

ధన్య�వాదాలు� ಧನ್ಯ�ವಾ�ದಗಳು

നി�ങ്ങള്‍‌ക്ക്� നിന്ദി�

Page 29: Admin High Availability

question & answer

Page 30: Admin High Availability

© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS,

IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.


Recommended