Top 5 TIPS TO KEEP Always on AGs humming and users happy

Slides:



Advertisements
Similar presentations
Implementing SQLServer AlwaysON Sarabpreet Singh Anand SQL Server – MVP SQLServerGeeks.com (VP)
Advertisements

Mecanismos de alta disponibilidad con Microsoft SQL Server 2008 Por: ISC Lenin López Fernández de Lara.
0 SQL Server AlwaysOn – SharePoint 2013 High Availability and Disaster Recovery Sal Bawany, Solutions Architect
Database Optimization & Maintenance Tim Richard ECM Training Conference#dbwestECM Agenda SQL Configuration OnBase DB Planning Backups Integrity.
Administering Microsoft SQL Server 2012 Databases.
Virtual techdays INDIA │ September 2011 High Availability - A Story from Past to Future Balmukund Lakhani │ Technical Lead – SQL Support, Microsoft.
SQL Server 2012 Always On Premier Field Engineer Microsoft Corporation Lisa Gardner
SharePoint Business Continuity Management with SQL Server AlwaysOn
Chapter 10 : Designing a SQL Server 2005 Solution for High Availability MCITP Administrator: Microsoft SQL Server 2005 Database Server Infrastructure Design.
Architecting Availability Groups
Maintaining a Mirrored Database Tips and Tricks by Paul G. Hiles.
SQLintersection Session SQL37 SQL Server 2012 Availability Groups Aaron Bertrand
Speaker Name 00/00/2013. Solution Requirements.
Alwayson Availability Groups
Architecting Availability Groups An analysis of Microsoft SQL Server Always-On Availability Group architectures 1.
Log Shipping, Mirroring, Replication and Clustering Which should I use? That depends on a few questions we must ask the user. We will go over these questions.
Narasimha Reddy Gopu Jisha J. Agenda Introduction to AlwaysOn * AlwaysOn Availability Groups (AG) & Listener * AlwaysOn Failover * AlwaysOn Active Secondaries.
SQL Server 2014 AlwaysOn Step-by-Step SQL Server 2014 AlwaysOn Step-by-Step A hands on look at implementing AlwaysOn in SQL Server 2014.
Putting Your Head in the Cloud Working with SQL Azure David Postlethwaite 19/09/2015David Postlethwaite.
SQL Server High Availability Introduction to SQL Server high availability solutions.
SQL Advanced Monitoring Using DMV, Extended Events and Service Broker Javier Villegas – DBA | MCP | MCTS.
All the things you need to know before setting up AlwaysOn Michael Steineke SQL & BI Solution Lead Enterprise Architect Concurrency, Inc.
Windows Server Failover Clustering (WSFC) with SQL Server.
Architecting Availability Groups An analysis of Microsoft SQL Server Always-On Availability Group architectures 1.
You Inherited a Database Now What? What you should immediately check and start monitoring for. Tim Radney, Senior DBA for a top 40 US Bank President of.
AlwaysOn In SQL Server 2012 Fadi Abdulwahab – SharePoint Administrator - 4/2013
Architecting Availability Groups An analysis of Microsoft SQL Server Always-On Availability Group architectures 1.
SQL 2012 – Always On Deep Dive Bob Duffy Database Architect Prodata SQL Centre of Excellence 11 th April 2013.
ALWAYSON AVAILABILITY GROUPS Replicas, Listeners & Quorums, Oh My! Kevin Howell SQL Saturday #517 Philadelphia, June 2016.
Architecting Enterprise Workloads on AWS Mike Pfeiffer.
Backups for Azure SQL Databases and SQL Server instances running on Azure Virtual Machines Session on backup to Azure feature (manual and managed) in SQL.
Sponsors.
Business Continuity for Virtual SQL Servers
You Inherited a Database Now What?
Automated Restore Script Output for Ola Hallengren’s Maintenance Solution 1) Start SQL Services on Local 2) Connect to Azure AlwaysOn 3) Delete all maintenance.
Troubleshooting Tools
SQL Replication for RCSQL 4.5
Architecting Availability Groups
ALWAYSON AVAILABILITY GROUPS
Disaster Recovery Where to Begin
AlwaysOn Mirroring, Clustering
Always On Multi-Site Patterns
Designing Database Solutions for SQL Server
Always On Availability Groups
Deploying and Configuring SSIS Packages
Contained DB? Did it do something wrong?
Always On : Multi-site patterns
AlwaysOn Availability Groups 101
Introduction to Clustering
Disaster Recovery Where to Begin
Architecting Availability Groups
How to keep your database servers out of the news Matt Gordon
Re-Indexing - The quest of ultimate automation
What’s new in SQL Server 2016 Availability Groups
Always On : Multi-site patterns
Example of a page header
SYED SAJID WASIM SQL SERVER ALWAYS ON Step by Step.
SQL Server on Linux: High Availability And Disaster Recovery
AlwaysOn Availability Groups
You Inherited a Database Now What?
High Availability/Disaster Recovery Solution
Distributed Availability Groups
Speaker info Matt Gordon Architect
Top 5 TIPS TO KEEP Always on AGs humming and users happy
04 | Always On High Availability
Sql Saturday Philadelphia
Top 5 TIPS TO KEEP Always on AGs humming and users happy
SQL AlwaysOn Availability Groups
Designing Database Solutions for SQL Server
The DBA Quit and now you’re it:
Presentation transcript:

Top 5 TIPS TO KEEP Always on AGs humming and users happy Matt Gordon

Speaker info Matt Gordon Co-Founder FGE Professional Sports Analytics matt.gordon@finbargoeseast.com : @sqlatspeed www.sqlatspeed.com

About ME 15+ years of SQL Server experience Microsoft Data Platform MVP IDERA ACE Managed 24x7 datacenters Worked on development teams MCSE: Data Management and Analytics PASS Summit 2017 and 2018 speaker Leader of Lexington, KY (USA) PASS Local Group

How I picked my twitter handle and domain name

About you Who is responsible for administering an Always On AG? Who thinks they will be responsible for that in the near future? If you are responsible for an AG, is it in production? Do you have AGs only in production?

Today’s AGENDA Tip 0: Everybody On The Same Page Tip 1: Quorum Design Tip 2: Read-only Routing Lists Tip 3: Users and Logins Tip 4: Backup Strategies Tip 5: Maintenance Strategies

LIVE LOOK AT ON-CALL DBA’s FACE

EVERYBODY ON THE SAME PAGE Do not set up Availability Groups in a vacuum Collaboration with operations Collaboration with networking Service level agreements (SLA) drive design Legal consequences Corporate consequences

EVERYBODY ON THE SAME PAGE Customer needs should also be considered Business dependent Set expectations based on implementation and support costs

EVERYBODY ON THE SAME PAGE Processes are critical Defined Repeatable Testable Personnel are critical Best design hamstrung by lack of training Talent and training are key

Quorum votes: Your VOTE COUNTS! What is cluster quorum? How the cluster monitors its health Why is it important? Cluster will be set offline if quorum is absent Availability group listener is a cluster resource AG will be inaccessible if quorum is lost Who decides on the design? Should be collaborative between DBA and ops DBA should understand design

Quorum votes: Your VOTE COUNTS! Quorum Modes Node Majority Recommended if you have an odd number of voting nodes Node and File Share Majority Recommended if you have an even number of voting nodes and multi-site cluster Also recommended if you have an even number of voting nodes and no shared storage Node and Disk Majority Requires shared disk cluster resource Recommended for even number of nodes but no multi-site Disk Only

Read-only routing lists: distributing the workload What is a read-only routing list? Directs read-only connections to readable secondaries Configured per availability group node Not load-balancing mechanism until SQL Server 2016 What is required to setup a read-only routing list? AG must have a listener One or more replicas must be readable secondaries

Copy user logins: accessible and available data SQL Server security objects Users at database level Logins at instance level Users Will be a part of each replica database No additional setup required Logins Will need to be recreated for each instance Sp_help_revlogin makes this much easier

DEMO: Keeping logins consistent across AGs

Copy user logins: other options https://www.sqlskills.com/free-tools/ssms-availability-group-add-in Only works with SQL Server 2012/2014 at this time Will sync both logins and jobs https://sql2012alwaysonlogin.codeplex.com SSIS package to sync only logins to replicas

Copy user logins: Best option https://dbatools.io @psdbatools on Twitter Copy-DbaLogin Copy-DbaAgentJob Examples: Copy-DbaLogin –Source <server> -Destination <server> Copy-DbaAgentJob –Source <server> -Destination <server> More examples found at https:/docs.dbatools.io Looks like SQL 2019 will have system databases in AGs so all of this may be moot

Regular transaction log backups: backups to help the database keep up Transaction log backup strategy Depends on database workload Important to regulate transaction log size “Do something, even if it’s wrong” Monitor your backups Improve recovery time Minimize use of storage resources Avoid the dreaded shrinking operations

Stagger index maintenance: slow down to speed up Regular index maintenance If you are not doing this, you should be Strategy depends on workload Reorganize operations may generate more log traffic and will take longer than rebuilds Especially for large, heavily fragmented indexes Effect on replicas Large operations can generate lots of log traffic Log data must be transported to/restored at replica

Stagger index maintenance: do’s and don’ts Staggering do’s and don’ts DO ensure that all large indexes are not being rebuilt at nearly the same time DO closely monitor the lag between primary and replicas when first implementing index maintenance DO NOT reorganize every index each day at the same time lest your network look like the picture

DEMO: checking ag replica lag

Stagger maintenance: checking ag replica lag select SYSDATETIME(), arcs.replica_server_name, drcs.database_name, drs.synchronization_state_desc, ars.synchronization_health_desc, CASE WHEN drcs.is_failover_ready=0 THEN 'Possible Data Loss' WHEN drcs.is_failover_ready=1 THEN 'No Data Loss' END as is_failover_ready, ISNULL(convert(varchar,drs.log_send_queue_size,113),'Is Current Primary') log_send_queue_size, ISNULL(convert(varchar,drs.last_sent_time,113),'Is Current Primary') last_sent_time, ISNULL(convert(varchar,drs.last_received_time,113),'Is Current Primary') last_received_time, drs.last_commit_lsn, drs.last_commit_time, drs.last_hardened_lsn, ISNULL(convert(varchar,drs.last_hardened_time,113),'Is Current Primary') last_hardened_time, ISNULL(convert(varchar,drs.last_sent_lsn,113),'Is Current Primary') last_sent_lsn, ISNULL(convert(varchar,drs.last_received_lsn,113),'Is Current Primary') last_received_lsn, ISNULL(convert(varchar,drs.redo_rate,113),'Is Current Primary') redo_rate, ISNULL(convert(varchar,drs.redo_queue_size,113),'Is Current Primary') redo_queue_size, ars.role_desc from sys.dm_hadr_availability_replica_states ars join sys.dm_hadr_database_replica_states drs on ars.replica_id = drs.replica_id join sys.dm_hadr_database_replica_cluster_states drcs on drs.group_database_id = drcs.group_database_id and drs.replica_id=drcs.replica_id join sys.dm_hadr_availability_replica_cluster_states arcs on drcs.replica_id=arcs.replica_id order by arcs.replica_server_name, drcs.database_name;

Stagger maintenance: SSMS 2017 AG Latency Reports New in SSMS 17.4 (released 12/7/17) Clicking “Collect Latency Data” on the AG dashboard starts the collection SQL Server Agent needs to be running on primary and at least one secondary What does it do? Creates Extended Event session that runs for 2 minutes Extracts data into temp tables for report result sets Drops the Extended Event session

Stagger maintenance: SSMS 2017 AG Latency Reports (primary) What do they show? Primary replica’s average commit time and average hardening time Statistics for commit duration, remote harden duration, time spent in compression, and send duration for log block

Stagger maintenance: SSMS 2017 AG Latency Reports (secondary) What do they show (continued)? Secondary replica’s send time Average time spent writing a log block (local flush), decompression time, receive time, send time Gotchas Only enabled for Windows Auth accounts with sysadmin Can only run one collection at a time Requires 2014 SP2, 2016 SP1, or 2017 RTM More info here: http://bit.ly/2DYORws

Questions?

Speaker info Matt Gordon Co-Founder FGE Professional Sports Analytics matt.gordon@finbargoeseast.com : @sqlatspeed www.sqlatspeed.com