Tag Archives | Availability Groups

Why is My Transaction Log Growing in My Availability Group? (Dear SQL DBA Episode 36)

A database transaction log is expanding, even though the DBA is running log backups and doesn’t see an open transaction? What’s going on with this Availability Group?

Links to timestamps in this 30 minute episode if you want to skip ahead

  • 00:49 What’s new @ SQL Workbooks
  • 03:22 Info on SQLPASS Summit 2017 Content Survey & a heads-up for aspiring precon speakers
  • 05:35 This week’s question about t-log growth

Subscribe to my YouTube channel, or check out the audio podcast to listen anywhere, anytime. Links from this episode are in this post below the video and in the YouTube description.

Links from this week’s episode

SQLPass Summit 2017 Content Survey (enter your email for a chance to win free registration): https://www.surveymonkey.com/r/KFS2ZJW

If you are interested in submitting a pre-conference session for SQLPASS Summit 2017, fill out the form on Wendy’s blog post here: http://www.pass.org/Community/PASSBlog/tabid/1476/entryid/839/Changes-to-the-PASS-Summit-2017-Program-Pre-Conference-Call-for-Interest-and-a-Community-Survey.aspx

Lazy log truncation (SQL Server PFE blog by Lisa Gardner) : https://blogs.msdn.microsoft.com/sql_pfe_blog/2013/06/27/lazy-log-truncation-clearing-of-sql-transaction-log-vlf-status-deferred

sys.dm_hadr_database_replica_states: https://docs.microsoft.com/sql/relational-databases/system-dynamic-management-views/sys-dm-hadr-database-replica-states-transact-sql

Chasing Ghost cleanup in Availability Groups (by Amit Banerjee): https://troubleshootingsql.com/2014/07/25/chasing-the-ghost-cleanup-in-an-availability-group/

3 Ways Availability Groups Beat Database Mirroring

photo-1429626037532-62a28ac3ccc7

SQL Server Availability Groups are growing up. SQL Server 2016 adds more features and improvements, and these include options to run SQL Server in different domains, or without a domain.

That brings Availability Groups closer to feature parity with Database Mirroring in SQL Server 2016.

The recent improvements caused me to think about the ways Availability Groups are better than Database Mirroring that aren’t listed as “big features”. (By “big features” I mean having more than one replica, having multiple databases fail over in a group, having multiple failover partners in SQL Server 2016, readable secondaries, having a basic load balancing concept in SQL Server 2016.) I think there’s a few.

1. The Listener is Way Better than Ye Olde Failover Partner Connection String

I’m a longtime fan of Database Mirroring. But troubleshooting connection failures with mirroring is a giant pain. Sometimes people find that their client is trying to connect to the mirror server periodically when there’s been no failover. And what happens if you need to fail over to the mirror, and then rebuild mirroring from scratch back to the original primary server?

There were ways to reduce the pain using DNS “friendly names” in Active Directory, but they weren’t perfect.

Availability Groups use a Listener resource in the Windows Failover Cluster instead. The client just needs to know the name of the listener, it doesn’t have to know the name of any failover partners.

There’s still complexity, particularly if you’re using multiple subnets. You need to make sure that your applications can use the right settings, and hopefully the right SQL Client providers — if you’re able to use .NET 4.6.1 or greater, it will automatically set important defaults for MultiSubnetFailover. Overall, I think it’s a big improvement.

2. Third Party Monitoring Tools are Better than Hacked Alerts

In theory, setting up alerts for Database Mirroring aren’t that hard. In practice, it’s kinda stinky. You need to find some scripts on Technet, wrestle with them for three hours, and you end up with a lot of WMI Alerts. Then you wander around in the Database Mirroring monitor for a while guessing at thresholds.

If you have more than one database in Database Mirroring, you end up with about 150 emails every time something hiccups. Or even thinks about hiccupping. It can be tricky to figure out what went wrong every time that happens.

With Availability Groups, it’s far more obvious that if you’re serious about monitoring, you should be buying a monitoring tool from a 3rd party provider. The more complex your topology, the more obvious it is. I actually think that’s a better story!

3. The AlwaysOn-Health XE Session is Better than… Nothing?

I really like the AlwaysOn-Health Extended Events session. Want to take a quick look and see when the last failover event was? Open it up! It has information on failovers and lots of critical events for AGs. You can gropu by event name and see the recent dates.

You could review state change with Database Mirroring, but you had to have the Database Mirroring Monitor tables or a trace event.

(Secret: I noticed that the AlwaysOn-Health XE Session also picks up failures for Database Mirroring, too. You could manually create your own session to do this for Mirroring, too.)

But Database Mirroring is Still a Valid Design for Some Environments!

I like a lot of things about Availability Groups. But I’m not saying they’re just “better than Database Mirroring.”

Version and licensing matters. If you’ve got SQL Server 2012 on Windows Server 2008R2, Availability Groups probably aren’t right for you. (We’ve had TONS of reliability and performance issues resolved with AGs in later versions of both clustering and SQL Server.)

Team size matters, too. If you don’t have a DBA or you have a single DBA, can you really gain expertise in Windows Failover Clustering as well as SQL Server Availability Groups? That takes a bunch of time, as does testing and managing upgrades, handling incidents, and deploying and tuning that custom monitoring.

For all its flaws, Database Mirroring is still easier to take care of in simpler scenarios for small teams. And for that reason, there’s still a place for it.