sql server 2012 always on

23
SQL Server 2012 Always On Premier Field Engineer Microsoft Corporation Lisa Gardner http://blogs.msdn.com/sqlga rdner

Upload: bevis-solomon

Post on 31-Dec-2015

61 views

Category:

Documents


0 download

DESCRIPTION

SQL Server 2012 Always On. Lisa Gardner. Premier Field Engineer. Microsoft Corporation. http://blogs.msdn.com/sqlgardner. High Availability Outcome Options. Understanding of High Availability Options in SQL Server 2012 Benefits of AlwaysOn HA design patterns utilizing AlwaysOn. Agenda. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: SQL Server 2012 Always On

SQL Server 2012 Always On

Premier Field Engineer

Microsoft Corporation

Lisa Gardner

http://blogs.msdn.com/sqlgardner

Page 2: SQL Server 2012 Always On

High Availability OutcomeOptions

Understanding of High Availability Options in SQL Server 2012Benefits of AlwaysOn HA design patterns utilizing AlwaysOn

Page 3: SQL Server 2012 Always On

Agenda

High Availability OptionsAlwaysOn DemoReadable SecondariesReadable Secondaries DemoAlwaysOn Design Patterns

Page 4: SQL Server 2012 Always On

High Availability Options

Pre-SQL Server 2012What's New in SQL Server Failover Clustering?SQL Server 2012 AlwaysOn

Page 5: SQL Server 2012 Always On

Pre-SQL Server 2012 High Availability Options

Backup/RestoreWindows/SQL Server Failover ClusteringLog ShippingDatabase MirroringThird Party

SAN Replication

Page 6: SQL Server 2012 Always On

AlwaysOn Technologies – Managed by WSFC

WSFC

AGFCI

Page 7: SQL Server 2012 Always On

What’s New in SQL Server Failover Clustering?

AlwaysOn Failover Cluster Instance provides instance level failoverKey SQL Server 2012 Clustering Enhancements

Multi-site geo-clustering across subnetsFlexible Failover PolicyImproved system diagnosticsSupport for network attached storage(NAS) user SMBSupport for TempDB on local drive (SSD)

Page 8: SQL Server 2012 Always On

Flexible Failover Policy (SQL Server 2012)

Control over when automatic failover should be initiatedConfigurable options eliminate false failoverImproved logging for better diagnosticsNew Cluster Properties

HealthCheckTimeoutFailureConditionLevel

Page 9: SQL Server 2012 Always On

Failure Condition Levels

0 – No Automatic Failover or restart

Service is down

1 – Failover or restart on server down

No response from sp_server_diagnostics

2 – Failover or restart on server unresponsive

System errors3 – Failover or restart on critical SQL Server errors

Resource errors4 – Failover or restart on moderate SQL Server errors

Query Processing errors5 – Failover or restart on any qualified failure conditions

Page 10: SQL Server 2012 Always On

Always On Availability Groups

Allows a group of databases to failover as a logical unitUtilizes Windows Failover Cluster to report healthDefines a primary instance and up to four secondary instancesProvides automatic client redirection

Page 11: SQL Server 2012 Always On

AlwaysOn Concepts

Availability GroupAvailability ReplicaAvailability DatabaseAvailability Group Listener

Page 12: SQL Server 2012 Always On

SQL Server High Availability Options RecapHigh Availability and Disaster Recovery SQL Server Solution

Potential Data Loss

(RPO)

Potential Recovery

Time (RTO)

Automatic Failover

Readable Secondaries (1)

AlwaysOn Availability Group – synchronous-commit

Zero Seconds Yes(4) 0-2

AlwaysOn Availability Group – asyncronous-commit

Seconds Minutes No 0-4

AlwaysOn Failover Cluster Instance

NA(5) Seconds-to

minutes

Yes NA

Database Mirroring(2) – High-safety(sync + witness)

Zero Seconds Yes NA

Database Mirroring(2) – High Performance (async)

Seconds(6) Minutes(6) No NA

Logshipping Minutes(6) Minutes-to-

hours(6)

No Not during a restore

Backup Copy Restore(3) Hours(6) Hours-to-days(6)

No Not During a restore

Page 13: SQL Server 2012 Always On

DemonstrationCreating an Availability Group

Page 14: SQL Server 2012 Always On

Readable Secondaries

Mirrored copy of data on secondary serverActive Secondary servers provide off-loading functionality

Reading of data for reportingBackupsDBCC

Connect via Instance name

Page 15: SQL Server 2012 Always On

Active Secondary – Readable Routing

Allows for application to specify read Intent on ConnectionApplicationIntent – A New Connection PropertyConnect via listener

Read-Only RoutingOptimized for automatic routing of read only applicationsRoutes must be create created manually

Page 16: SQL Server 2012 Always On

Readable Secondary – Data Latency

Secondary reads are behind primaryLog is first hardened and then applied

Redo thread is asynchronous and runs in the backgroundLatency (typically seconds) can be larger for log intensive operations like bulk import or index create/rebuildSync Replica minimizes latency due to network issues

Page 17: SQL Server 2012 Always On

DemonstrationLeveraging Active Secondaries

Page 18: SQL Server 2012 Always On

Query Performance on Secondary

SQL Server Uses Cost based optimizerRelies on object Statistics

If statistics are missing SQL Server creates and persistsAuto-stat on readable secondary will require updates?

Page 19: SQL Server 2012 Always On

Active Secondary : Enabling Backup on Secondary

Backups can be done on any replicaMust be able to communicate with primaryLog backups done on all replicas form a single log chainSend all backups to a single UNC pathDatabase Recovery advisor makes restores simple

Must include backups from other instances manually

Differential Backups are not supportedCopy-Only backups are the only type

I have a 4 part blog series on this topic for more details

Page 20: SQL Server 2012 Always On

AlwaysOn Troubleshooting

AlwaysOn DashboardSp_server_diagnosticsCatalog Views Examples

Sys.availability_groupsSys.availability_replicas

DMV are named sys.dm_hadr*New Performance Monitor Counter Objects

SQLServer:Database ReplicaSQLServer:Availability Replica

New Information Logged to the System Event Logs

Page 21: SQL Server 2012 Always On

AlwaysOn Design Patterns

White Board/Flip Discussion

Page 22: SQL Server 2012 Always On

Questions?

Page 23: SQL Server 2012 Always On

Conclusion

AlwaysOn provides many High Availability OptionsEnables Multi Site Failover with minimal effortAllows maintenance and read activity to be distributed