Download presentation
Presentation is loading. Please wait.
1
SQL Server 2012 AlwaysOn and SQLSentry
Kevin Kline Director of Engineering Services, SQL Sentry SQL Server MVP since 2004 Twitter, FB, LI: KEKline Blog:
2
SQLSentry Tooling Demo
Agenda The Basics of AlwaysOn SSMS Tooling Demo SQLSentry Tooling Demo The server: Know the Tools Use Traces and Query Plans Testing Harness Act on Query Performance Tips When to Use Temporary Tables? What’s Set-based Processing? The client: Connecting to Microsoft® SQL Server™ Handling NULLs Error Handling Transactions
3
The Basics Inherits from DBM: With WSFC: Sync / Async data protection
Automatic or manual failover Automatic page repair Compressed data stream TCP endpoints With WSFC: Does NOT require instances to be Failover Cluster Instances (FCIs) Does NOT require that servers start out as clustered if using standalone instances Database-level protection Built upon the foundation of database mirroring Requires a Windows Server Failover Cluster. Availability Groups (AGs) are what most people mean when they say “AlwaysOn”
4
What Does WSFC Mean for a DBA?
You need to know WSFC very thoroughly. Quorum matters. Nodes must be part of the same domain. (Different subnets are ok). WSFC validation is very important. AG feature doesn’t check like in setup for FCI It’s on YOU to check it. %windir%/Cluster/Reports Apply hotfixes per Windows version European PASS Conference 2008
5
I Know Mirroring. How’s This Different?
Enterprise Edition only. DB in full recovery mode only. Not a 1:1 ratio of principals to mirrors. Per AG: Up to 4 additional replicas, for a total of 5 Up to 3 synchronous replicas Up to 2 automatic failover pairs Multiple DBs in an AG will failover at the same time.*** Easily span subnets. Replicas usable for read-only access and backups. DB Rules: DB in full recovery mode only, with at least 1 full backup before creating AG. DB must be multi-user database in read-write mode. AUTO_CLOSE is disabled. Distributed transactions disabled. Special rules about all objects, including logins, residing within the database. Backups & Restores: Can do full and t-log backups on non-primary replicas using WITH COPY_ONLY Can’t restore DB participating in an AG w/o dropping it from the AG first Can set priority per replica: Priority is not a hard enforcement unless condition is checked Use sys.fn_hadr_backup_is_prefferred_replica if writing your own statements instead of using SSMS or Wizard Handled in maintenance plans European PASS Conference 2008
6
Availability Groups Fundamentals
First image = basic AG for high availability and disaster recovery Second image = Node and File Share Majority quorum model Third image = Node Majority quorum model ~~~ So why do AG’s use a WSFC? Two things: Listener and Quorum Listener abstracts the behind the scenes server/instance change just like an FCI: Has a clustered network name & IP address just like an FCI. Plan carefully, you might need a lot of them and they must be unique. Creates an object in AD (VCO) and DNS Applications can connect to Listener Quorum differs a lot from DBM, using the WSFC mechanism o
7
Flexible Failover Policy Levels
Failure Condition Level On server down. This is the least restrictive level. 1 On server unresponsive. 2 On critical server error. The default level. (1 and 2, plus internal errors). 3 On moderate server error. (1 – 3, plus other errors like stack dumps). 4 On any qualified failure conditions. (1 – 4, plus other errors like worker thread exhaustion and unresolvable deadlocks). 5 Failure Condition Level On server down. Specifies that an automatic failover is initiated when any of the following occurs: The SQL Server service is down. The lease of the availability group for connecting to the WSFC cluster expires because no ACK is received from the server instance. For more information, seeHow It Works: SQL Server AlwaysOn Lease Timeout. This is the least restrictive level. 1 On server unresponsive. Specifies that an automatic failover is initiated when any of the following occurs: The instance of SQL Server does not connect to cluster, and the user-specified health check timeout threshold of the availability group is exceeded. The availability replica is in failed state. 2 On critical server error. Specifies that an automatic failover is initiated on critical SQL Server internal errors, such as orphaned spinlocks, serious write-access violations, or too much dumping. This is the default level. 3 On moderate server error. Specifies that an automatic failover is initiated on moderate SQL Server internal errors, such as a persistent out-of-memory condition in the SQL Server internal resource pool. 4 On any qualified failure conditions. Specifies that an automatic failover is initiated on any qualified failure conditions, including: Exhaustion of SQL Engine worker-threads. Detection of an unsolvable deadlock. This is the most restrictive level. 5 Damaged databases and suspect databases? Nope, not detected by any failure-condition level. European PASS Conference 2008
8
AG Metadata SSMS (in demo) DMVs: Xevents
sys.availability_* sys.dm_hadr_* Xevents SP_server_diagnostics: checks the health_check_timeout value in 30 second intervals, by default.
9
MGB 2003 Additional Resources Plan Explorer Free: Twitter and #SQLHelp SQLCAT.com SQLSkills.com Community Sites: SQLPASS.org SQLServerCentral.com SQLBlog.com SQLTeam.com © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
10
SUMMARY SSMS, Traces, and Execution Plans Test Harness & Testing
Query Tuning Tips Temp tables Cursors & Loops NULL Error Handling Transactions Security isn’t an afterthought Change Management is risk management
11
Q & A Send questions to me at: kkline@sqlsentry.net
Twitter, Facebook, LinkedIn at KEKline Slides at IT Leadership content at THANK YOU!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.