Sql 2012 always on

31
SQL 2012 AlwaysOn Get TurnedOn with AlwaysOn! High Availability/Disaster Recovery Solution

Transcript of Sql 2012 always on

Page 1: Sql 2012 always on

SQL 2012 AlwaysOn

Get TurnedOn with AlwaysOn!

High Availability/Disaster Recovery Solution

Page 2: Sql 2012 always on

Dilip Nayak

DBA at CUDirect Corporation Expertise in performance

tuning/troubleshooting and high availability. 17 years of experience working as a .NET

developer, 6 years as SQL DBA. Active member of PASS, SQL Saturday and

anything SQL related.

Page 3: Sql 2012 always on

Mitch Bottel

• Sr SQL Server DBA – Sutter Health• Owner Innovative IT Consulting, Inc.• Idera ACE Alumni

• Advisors and Community Educators

• 12+ years in IT• Member Placer County Search and Rescue

Page 4: Sql 2012 always on

Agenda

Concepts of HA and DR SQL Failover Clustering Database Mirroring Log Shipping SQL 2012 AlwaysON Demo Q & A

Page 5: Sql 2012 always on

Definitions

High Availability minimize the probability of a failure more local in nature and generally tolerate smaller

amounts of data loss and downtime

Disaster Recovery restoring operational service after a failure a catastrophic event occurs and an extended

outage is necessary to get back and running

--Alan Hirt - Pro SQL Server 2008 Failover Clustering Book

Page 6: Sql 2012 always on

High Availability

Page 7: Sql 2012 always on

Why do we need another solution?

The current High Availability and Disaster Recovery Solutions from Microsoft are scattered.

High Availability /Disaster Recovery Solutions: Windows Failover Clustering Database Mirroring Log Shipping Database Replication

Page 8: Sql 2012 always on

SQL Failover Clustering

A failover cluster is a combination of two or more servers(nodes) connected to a shared storage.

clientApp Server

Node 1

Node 2

Database

Windows Server Failover Cluster

Page 9: Sql 2012 always on

SQL Failover Clustering Issues

Protects against hardware loss and not disk loss. Multi site cluster across data centers is tedious

using VLAN etc. Passive node is not used thus not achieving

maximum utilization of resources.

Page 10: Sql 2012 always on

Database Mirroring

App Server

Primary DB

Mirrored DBMirrored Server

Primary Server

Client

Primary Server Primary DB

Page 11: Sql 2012 always on

Database Mirroring Issues

Can have only one mirror. No multiple copies of data. Mirrored database is not readable, though snapshots

can be taken from the mirrored database. Maximum utilization of resources is not met.

Must be setup on each database individually. Per database failover, no automatic failover of

multiple databases. No sql logins/jobs are replicated to the mirrored

instance. Either synchronous or asynchronous mirroring is

supported but not both.

Page 12: Sql 2012 always on

Log Shipping

App Server

Primary DB

Secondary DBSecondary Server

Primary Server

Client

Primary Server Primary DB

Page 13: Sql 2012 always on

Log Shipping

App Server

Primary DB

Secondary DBSecondary Server

Primary Server

Client

Primary Server Primary DB

Page 14: Sql 2012 always on

Log Shipping Issues

Cannot have synchronized databases. Must be setup on each database individually. In case of failover, the connection string needs to

change to point it to the failover server. No logins/jobs are replicated to the mirrored

instance.

Page 15: Sql 2012 always on

What if we had all these features in a single solution? Protects against hardware loss. Protects against disk loss. Multiple copies of replicated databases. Readable mirrored databases thus maximizing

resources. Multiple database failover at once. No need to change the connection string in case

of failover, you can use the same abstract name. Failover can occur across datacenters without

extra effort.

Page 16: Sql 2012 always on

The answer is…….

SQL 2012 AlwaysOn

Page 17: Sql 2012 always on

Modes of SQL2012 AlwaysOn

1. AlwaysOn Failover Clustering Instance(FCI).

2. AlwaysOn Availability Groups.

Today we will discuss AlwaysOn Availability Groups.

Page 18: Sql 2012 always on

Rules

Page 19: Sql 2012 always on

Availability GroupsRequirements: Needs to have Windows failover cluster(WSFC). Supported in Enterprise Edition Only. Install individual SQL servers on each machines,

not cluster aware. All servers should be in a single windows cluster. Matching hardware not required. Database should have Full Recovery model with at

least one full successful backup. All nodes must be in the same AD domain.

Page 20: Sql 2012 always on

New Technology, New Vocabulary

Page 21: Sql 2012 always on

Availability Groups Vocabulary Availability Group:

Availability Replicas:

Availability Group Listener:

Page 22: Sql 2012 always on

Demo Architecture

Synchronous Commit

Asynchronous Commit

SANJOSE SANJOSE 2

NEWYORK

DR Site

Local Data Center

Page 23: Sql 2012 always on

Availability Groups Setup

VM1 VM2 VM3 VM4

Host Name CALIFORNIA SANJOSE SANJOSE2 NEWYORK

Server Type Domain Controller

SQL Server SQL Server SQL Server

OS W2k12 Server W2k12 Server W2k12 Server W2K12 Server

IP Address 192.168.81.1 192.168.81.2 192.168.81.3 192.168.81.4

Subnet Mask

255.255.255.0 255.255.255.0 255.255.255.0 255.255.255.0

Domain: SQL2012.DemosCluster Name: SQL2012AlwaysOn(192.168.81.10)Availability Group: SQLSatAGListener: SQLSatListener – 192.168.81.30

Page 24: Sql 2012 always on

Demo

Sync/Async Failover. Availability Groups Listener. Read-only routing. Readable secondary. Backup on secondary.

Page 25: Sql 2012 always on

Availability Groups Features

Synchronous Commit – up to 2 mirrored replicas. Asynchronous Commit – up to 4 mirrored replicas. Can have read-only secondary databases. SQL Logins can be failed over using contained

databases. Windows PowerShell is fully supported. Backups can occur on the replica databases. DBCC commands can be run on secondary. Flexible failover policy – sp_server_diagnostics. Quorum is very important.

Page 26: Sql 2012 always on

Just when things were going right!

Page 27: Sql 2012 always on

Some disadvantages Needs Enterprise Edition of SQL 2012. Needs Windows Cluster which in turn needs

Windows Enterprise. If read-only feature on replica is used, you

need to take care of extra licensing. System databases cannot be replicated- users

and jobs are not part of replication. Differential backups are not supported on

secondary. Deep understanding of WSFC and quorum.

Page 29: Sql 2012 always on

July 27th in Sacramento!

Looking for Speakers and Sponsors!

Come Attend!!

Help us spread the word!!

Page 30: Sql 2012 always on

Q & A

Page 31: Sql 2012 always on

Contact Information

Dilip Nayak Email: [email protected] Twitter: @d_nayak

Mitchell Bottel Email: [email protected] Twitter: @SacSQLDude