Photo by Pixabay on Pexels.com Here's a quick one for today and is an issue that had me stumped for a while. It's not one that I'd come across before and there isn't really all that much out there on the internet about it. The Issue as I Saw It So, what was the issue?... Continue Reading →
Managing Agent Jobs on Availability Group Servers
As always, the scripts in this post can also be found on our Git Hub repo, https://github.com/SQLUndercover/UndercoverToolbox/blob/master/CatagoryControlledAgentJobs.sql Agent jobs, they can be a right pain to manage when you're running availability groups. The problem is that they're just not AG aware, this means that if you failover our AG, more often than not you're going... Continue Reading →
Finding the Primary Replica of an Availability Group
This is going to be a bit of a quick post but one about something that I see coming up time and time again on SQL Undercover's search terms. How do I find an availability group's primary server? A while back, Adrian put together a bunch of queries for Always On Availability Groups, 7 ways... Continue Reading →
Availability Groups and Redo Latency, Data Committed on a Primary isn’t Visible on a Synchronous Secondary
If you're running availability groups it may seem like a great idea to offload your read only reporting workloads to a secondary. There are a couple of ways that you could do that, you could use read only routing or simply just point those reports directly at a read only secondary (read only routing is... Continue Reading →
To use ALTER DATABASE, the database must be in a writable state in which a checkpoint can be executed. – when moving files on an Availability Group secondary.
Here's a little error that I stumbled across the other day when trying to migrate the data files of an Availability Group secondary node onto a nice new SAN. I started off by running the following command against the secondary server. ALTER DATABASE SQLUndercover MODIFY FILE (NAME = 'AG01', FILENAME = 'E:\DATA\AG01.mdf') There's nothing wrong... Continue Reading →
Is Your Availability Group ‘REALLY’ Ready To Failover?
You know what it's like, you need to fail your AG over but is it safe to fail over? Perhaps you've clicked on 'failover' for the AG and there's a little green tick and no data loss reported... Or maybe you've checked out sys.dm_hadr_database_replica_cluster_states and 'is_failover_ready' is reporting a 1. So, you're cool to failover,... Continue Reading →
Availability Groups: When Your Synchronous Secondary isn’t Synchronous
During a recent DR scenario I came across a slight misinterpretation in how availability groups with replicas in synchronous commit behave. How An Availability Group With A Synchronous Secondary Should Behave Under Normal Circumstances Normally, if we've got a secondary replica in synchronous commit mode, our primary can't commit any transactions until that transaction has... Continue Reading →
‘Object Reference Not Set to an Instance of an Object’ When Failing Over an Availability Group Using SSMS <= 17.5
Here's a quickie that I've just stumbled across. I've just tried to initiate a manual failover of an availability group and received the following error. After a spot of head scratching and thinking that there was something wrong with my AG setup, it turns out that there's a bug in SSMS. I was running SSMS... Continue Reading →
TempDB Filling Up On Secondary Replicas
Have you ever had an issue where TempDB was filling up on your secondary replicas? Do those secondaries happen to be read only replicas? When I have an issue with tempdb filling up the first thing that I usually do is try to figure out exactly what the space has been allocated to. You can... Continue Reading →
UNDERCOVER TOOLBOX: sp_WhatsMyAG
Here's a quick one for you. If you happen to be managing SQL Servers with a large number of databases and availability groups, it can sometimes be difficult to keep track of which database belongs to which availability group. sp_WhatsMyAG will tell you just that. You can either provide it with the database name and... Continue Reading →