SQL Server 2012 - AlwaysOn

João Loureiro

About João Loureiro

• SQL Server Senior Support Escalation Engineer (3rd tier support level) • Bridge between frontline support and SQL product group • SQL Server Denali TAP Escalation Engineer (part of SQL Server Beta program) • Blog: http://blogs.msdn.com/joaol (joaol@microsoft.com) • Engaged on Service Packs, hot fixes and new product releases.

SQL Server High Availability Retrospective
• SQL Server High Availability Today
– Enterprise customers are being successful
• Dell, HP, Bwin, ServiceU, CareGroup, BigHammer

– but
• Solutions fragmented • Lack important flexibility points

• Initiated holistic review of SQL HA and DR
– Looked at customer scenarios (RTO and RPO requirements, Local HA and DR) – Enterprise blockers – Mission Critical Needs (online ops, patching, planned and unplanned maintenance) – Failover requirements and hardware usage – Future needs

Mission Critical High Availability Solution Meets mission critical high availability SLA Integrated Flexible Efficient .

AlwaysOn Availability Groups • AlwaysOn Availability Groups is a new feature that enhances and combines database mirroring and log shipping capabilities Flexible  Multi-database failover  Multiple secondaries  Total of 4 secondaries  2 synchronous secondaries  1 automatic failover pair Integrated        Application failover using virtual name Configuration Wizard Dashboard System Center Integration Rich diagnostic infrastructure File-stream replication Replication publisher failover Efficient   Active Secondary Readable Secondary  Backup from Secondary  Synchronous and asynchronous data movement  Built in compression and encryption  Automatic and manual failover  Flexible failover policy  Automatic Page Repair  Automation using power-shell .

A Flexible Solution • AlwaysOn provides the flexibility of different HA configurations A A A A A A A Direct attached storage local. regional and geo target Shared Storage. regional and geo secondaries Synchronous Data Movement Asynchcronous Data Movement .

Mission Critical Requirements Zero data loss is critical for the business Fast application recovery during planned and unplanned downtime Redundancy across 3 datacenters Application databases and dependencies failover together .

demo Deploy using AlwaysOn Availability Groups .

Application Failover • Availability Groups Listener allow applications to failover seamlessly to any secondary – Application reconnects using a virtual name after a failover to a secondary ServerA HR DB HR DB ServerB HR DB ServerC AG_HR HR_VNN Primary Primary Secondary Secondary Secondary Application retry during failover Connect to new primary once -server HR_Listener.failover is complete catalog HRDB and the listener is online .

like jobs are not contained and has to be managed .What about Server Objects? • Introducing Contained Databases or CDB’s • – Unit of application programmability in Denali A DB which establishes a boundary between application and server • CDB can be part of an availability group and can failover across replicas • Authentication information moves with the CDB • CDBs sever the user–login relationship • • Windows users no longer need matching logins Users with passwords replace SQL logins • Limitation Other objects.

Failover coordination. Primary health detection.Availability Group Architecture Windows Server Failover Cluster Database Active Log Synchronization Database Active Log Synchronization Availability Group uses Windows Server Failover Cluster (WSFC) for WSFC Common Microsoft Availability Platform • • • • • Inter-node health detection. Distributed change notifications . Distributed data store for settings and state.

AlwaysOn Active Secondary • IT efficiency and cost-effectiveness is critical for businesses • Idle hardware is not an option anymore AlwaysOn Active Secondary enables efficient utilization of high availability hardware resources thereby improving overall IT efficiency • Active Secondary can be utilized for • Balancing read-only workloads • Offloading Backup Operations .

exe InstanceB DB1 DB2 DB1 DB2 Reports Reports • Readable secondary allow offloading read queries to secondary • Close to real-time data.exe InstanceA Primary Secondary Secondary Primary SQLservr.Active Secondary – Making Secondary Readable SQLservr. latency of log synchronization impact data freshness .

Read-Only Client Connectivity • Read-Only client connection behavior determined by Availability Replica Option+ ApplicationIntent Property • ApplicationIntent is a connection property • Replica option determines whether a replica is enabled for read access when in a secondary role • Read-Only Routing enables redirection of client connection to new secondary on role change • Enable seamless redirection of application connection across replicas without manual intervention .

e.Read Workload Impact • Concurrency and Blocking – REDO can get blocked by reporting workload – REDO thread and read workload can deadlock • Solution • • • • • – Internally map read workload to non blocking isolation levels (no application changes required) Read Uncommitted  Snapshot Isolation Read Committed  Snapshot Isolation Repeatable Read  Snapshot Isolation Serializable  Snapshot Isolation Ignore all locking hints – Never choose REDO as deadlock victim • Result – Blocking and deadlock between Reporting workload (i. . Query) and REDO thread is eliminated – No issues with DML (INSERT/DELETE/UPDATE) as it is not allowed – Will incur additional cost of row versioning.

demo Readable Secondary .

Active Secondary – Enabling Backup on Secondary R/W workload Secondary Backups Primary Secondary • Backups can be done on any replica of a Backups database • Backups on primary replica still works • Log backups done on all replicas form a single log chain Backups • Database Recovery Advisor makes restores simple .

cautions. and gotchas • Differential backups are not supported on secondary • Only Copy-only full backups are supported on secondary – The only distinction is the differential bitmap clearing • Advisable for backups to be stored centrally .Restrictions.

demo Backup from Secondary .

Key Enhancements • Fast instance failover through predictable database recovery time • Native support for multi-site clustering across subnets enable DR using failover cluster instances • Flexible Failover Policy • Eliminates false failover • Configurable failure condition levels • Better diagnostics • SMB support enables consolidation of more than 26 instances • Support TEMPDB on local drive .

Introduce Flexible Failover Policy Flexible Failover Policy provides administrators control over the conditions when an automatic failover should be initiated. Diagnostics Configurable options eliminate false failover Improved logging for better diagnostics .

Reducing Planned Downtime • Support for Windows Server Core • Reduce OS patching by as much as 50-60% • Support for rolling upgrade and patching of SQL Server for both Availability Groups and Failover Cluster Instance • Fast failover time for both Availability Groups and Failover Cluster Instances • New online operations supported • LOB Index • Adding of column with default .

A hotfix is available to let you configure a cluster node that does not have quorum votes in Windows Server 2008 and in Windows Server 2008 R2 – Supports configuring optimal quorum with non-automatic failover targets • All nodes should be in the same AD domain • To create WFSC cluster user running creation must have: • Domain account • Administrator on all machines • Have Create Computer objects and Read All Properties rights in AD • Detailed Article: http://technet.aspx .Windows Server Pre-Reqs • KB 976097 .microsoft.10).com/enus/library/cc731002(WS.Hotfix to add support for asymmetric storages to the Failover Cluster Management MMC snap-in for a failover cluster that is running Windows Server 2008 or Windows Server 2008 R2 – Supports SQL Server Failover Cluster Instances with AlwaysOn Availability Groups • KB 2494036 .

Select nodes to vote (KB 2494036) • 1 vote if node’s that host a replica that is currently: • 0 votes for rest of nodes – Primary (if primary is an FCI include all possible owner nodes for that FCI) – An auto failover target if the primary is also configured for auto failover 2. • Odd number of votes. add a witness by either: Select the quorum type: – Adding an additional witness node and use “Node Majority” – Using “Node and File Share Majority” with a protected file share (blog with details) • Re-evaluate and adjust quorum after manual failover outside automatic target .Quorum Configuration • Quorum: need majority of votes to operate and avoid split brain • Two-Steps process: 1. use “Node Majority” • Even number of votes.

demo Disaster Recovery .

New Topology A A A A Reports Backups Synchronous Data Movement Asynchcronous Data Movement .

com/en-us/sqlserver/gg490638(enus.microsoft.10) – RCO download (available soon) – Documentation – MSDN forums – Microsoft Connect – AlwaysOn Blog .Resources Links • “Denali” AlwaysOn Resource Center: http://msdn.MSDN.

“Apollo” Fast FILESTEAM Fast Full-Text Search Fast Spatial Performance DBC & OLTP Appliances/RAs Security & Manageability User-Defined Server Roles Contained Database Authentication Distributed Replay Audit Enhancements Management Pack for High Availability Backup Secondaries Default Schema for Windows Group Active Directory w/ SharePoint for SSRS Beyond Relational Microsoft Project “Juneau” Win32 Access to Database files FileTable Semantic Search Platform Full Globe Spatial Support DAC Enhancements ODBC for Linux Hybrid Applications with SQL Azure Web & Breadth PHP Driver Local DB Runtime UTF-16 Paging for result sets JDBC 4. Integrated Failover Detection Application Centric Failover Multiple Secondaries Readable Secondaries Online Operations HA for StreamInsight Windows Server Core Support Scalability & Performance Up to 15K Partitions/Table Column Store Index.0 driver Business Intelligence Unified Semantic Model Crescent EIM SSIS Server Data Quality In-memory BI for corporate Alerting Enhanced MDS MDS add-in for Excel Sysprep for AS Support for ARM processors PowerPivot Enhancements Reporting as SharePoint Shared Service .SQL Server 2012 Highlights High Availability SQL Server AlwaysOn Reliable.

Thank You .

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

Sign up to vote on this title
UsefulNot useful