Download presentation
Presentation is loading. Please wait.
Published byMyron Simpson Modified over 8 years ago
1
SQL 2012 – Always On Deep Dive Bob Duffy Database Architect Prodata SQL Centre of Excellence 11 th April 2013
2
Speaker Bio – Bob Duffy 20 years in database sector, 250+ projects 20 years in database sector, 250+ projects Senior Consultant with Microsoft 2005-2008 Senior Consultant with Microsoft 2005-2008 One of about 25 MCA for SQL Server globally (aka SQL Ranger) One of about 25 MCA for SQL Server globally (aka SQL Ranger) SQL MCM on SQL 2005 and 2008 SQL MCM on SQL 2005 and 2008 SQL Server MVP 2009+ SQL Server MVP 2009+ SSAS Maestro SSAS Maestro Database/Solution Architect at Prodata SQL Centre of Excellence Database/Solution Architect at Prodata SQL Centre of Excellence Regular speaker for TechNet, MSDN, Users Groups, Irish and UK Technology Conferences Regular speaker for TechNet, MSDN, Users Groups, Irish and UK Technology Conferences
3
Agenda Typical HADR Requirements Typical HADR Requirements Always On Installation Always On Installation Migrating to Availability Groups Migrating to Availability Groups Planned Failover Planned Failover Automated Failover Automated Failover Active Secondary Replicas Active Secondary Replicas
4
Case Study – Dell DVD Store Enterprises Need to accept 24 x 7 transactions For High Availability Zero down time and data loss (automatic) SLA to cover storage failure “I see web site unavailable and you are fired” “Reporting” Near real time. No more than 1 minute behind With minimal impact on live transactions Disaster Recovery Have second data centre. No more than 30 mins down time and 5 minutes data loss Migration Any upgrade needs to be with no down time or data loss Performance We don’t want backups affecting live server
5
Typical HA/DR/Reporting Architecture DR Site
6
SQL 2012 Always On – Availability Groups DR Site Synchronous Asynchronous
7
Recap - Key Always On Features Up to three “secondary” replicas Can be Synchronous or Asynchronous Automatic and/or Manual Failover Fast Failover – similar to a Mirror You can do stuff on the Secondary's BackupReportingDBCC
8
Installation Always On relies on WSFC Always On is NOT a clustered install of SQL Does not need Shared Disk Windows 2008 Server+ EE needed Need to Enable sqlAlwaysOn service Via configuration manager Or via PowerShell Some Patches and QFE Recommended KB 976097 KB 2494036 Lots of others at http://msdn.microsoft.com/en- us/library/ff878487(v=sql.110).aspxhttp://msdn.microsoft.com/en- us/library/ff878487(v=sql.110).aspx
9
Installation Cluster + SqlAlwaysOn Feature
10
Migrating to Always On / Denali Any normal migration is possible: Backup / Restore Attach / Detach Mirroring Log Shipping Replication Might need some post migration tasks Compatibility Use of new features such as Containment
11
Migrating to Denali
12
Creating your First Availability Group
13
Failover to Secondary
14
Flexible Failover Policy Flexible Failover Policy provides administrators control over the conditions when an automatic failover should be initiated. DiagnosticsDiagnostics Configurable options eliminate false failover Improved logging for better diagnostics
15
New Failure Condition Levels LevelConditionExample 0No Automatic FailureMaintenance Mode 1Server DownInstance Not Started 2Server Hang No data from sp_server_diagnostics 3*System Unhealthy sp_server_diagnostics Return ‘system error’ stack dumps occurring 4Resource Unhealthy sp_server_diagnostics Return ‘resource error’ Low on Memory 5Failover or restart on any qualified failure conditions sp_server_diagnostics Return ‘query processing error’ 17884 Deadlock
16
Quorum Changes Required for automatic failover Built in feature of WSFC Replaces the concept of “witness” to avoid split brain Two recommended Steps 1. Select nodes to vote 2. Select the Quorum Type If Odd number use “Node Majority” If even number use “Node Majority plus File Share Witness” Requires QFE KB Requires QFE KB KB 2494036 to enable Voting May need to adjust quorum after failover outside automatic target May need to adjust quorum after failover outside automatic target
17
Automated Failover
18
Secondary Replica Features Failover Backup \ DBCC Reporting Queries AlwaysOn AutoStat Automatic Page Repair
19
Read Only Replicas
20
Secondary Replica – Active Log Sync Log Cache Secondary read is behind primary Log is first hardened and then applied Redo thread is asynchronous and runs in the background Latency (typically seconds) can be larger for log intensive operations like bulk import or index create/rebuild DB1 DB1 Log DB1 Log Capture Log Recieve DB1 Data Redo Thread Redo Pages DB1 Log DB1 Data Page Updated Log Harden Log Flush CommitCommit Acknowledge Commit Log Pool NetworkNetwork
21
Auto-Stats on Readable Secondary Query Optimization and Statistics SQL Server uses cost based optimizer that heavily relies on object statistics If statistics are missing, SQL Server automatically creates them and persists Auto-stat on readable secondary will require physical Changes Example: Table T1 (C1, C2, C3) Query on primary with predicate (C3 > 10). SQL Server auto-create the statistics, if needed, on column C3 on primary replica Won’t work on Readable Secondary as it will cause physical changes to the database. Similar issue if the statistical information is stale on the secondary replica. Solution Auto-create statistics on the secondary replica but persist them in TempDB Existing catalog views (e.g. sys.stats) show temporary statistics
22
Unplanned Disaster!
23
Questions ?
24
AlwaysOn Resources AlwaysOn Resources AlwaysOn Resource Center: http://msdn.microsoft.com/en- us/sqlserver/gg490638(en-us,MSDN.10) http://msdn.microsoft.com/en- us/sqlserver/gg490638(en-us,MSDN.10) http://msdn.microsoft.com/en- us/sqlserver/gg490638(en-us,MSDN.10)Documentation MSDN forums Microsoft Connect AlwaysOn Blog
25
Availability Groups and Failover Cluster Instance
26
Supportability Catalog Views Sys.availability_replicas (used to see if secondary allows READ) Sys.stats New column to indicate if the statistics is temporary DMVsSys.dm_hadr_database_replica_statesXevents REDO Blocked REDO Unblocked PerfMon REDO blocking
27
Thank You!
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.