Greetings -
Can we monitor database replication using SQL Sentry, DPA, or something in Solarwinds Orion?
I did some quick searching and did not come up with anything yet.
Thanks!
Dave
Greetings -
Can we monitor database replication using SQL Sentry, DPA, or something in Solarwinds Orion?
I did some quick searching and did not come up with anything yet.
Thanks!
Dave
It's been a few years (and a different employer) since I have set this up but I set up a SAM template that did a SQL query that determined if the SQL instance was primary or backup. Similar to this sys.fn_hadr_is_primary_replica (Transact-SQL) - SQL Server | Microsoft Learn In the SAM template I remember the Statistics Value returning a 1 if the server was on primary and a 100 if it was on secondary. Using that info I was able to make a map using the old map maker and add the green/red icons from the SAM template to each server. The map was basically data center A and data center B and it showed green as primary and red as secondary and where the DB's were currently running. We had an Active/Active data center setup so they could be anywhere at any time based on load.
You should be able to do the same thing for replication.
What kind of replication are you doing? AGs, mirroring, other?
The simple answer is AGs.
SAM can do this with the SQL Experience component. I think the table was system state or something. I created a template to look up the AG status's. This table logs the replication state, master, etc. Works like a charm. I do not have access to upload this, but here are the relevant links in microsoft. You will need to add VIEW Server State permission or View Definition for some. I had this setup in older sql, but the azure sql and sql 2022 stuff looks very similar
SAM is underrated in this regard. I am fairly certain that one of the entities would also track status of the replication - pending, complete, failed. I would poke around to see which ones meet your needs. I was surprised at the level of detail that I could get once I noticed these tables and had access to them.
SQL Server User Experience Monitor - link the sql experience component information.
About monitoring SQL Server Availability Groups with DPA Does not specify replica status that I could see at any rate. Overall status would cover this though.
I think DPA might have this somewhere though. Found this old thread that you actually commented in!
Display DPA AG information in Orion - Forum - Database Performance Analyzer (DPA) - THWACK
SQL Sentry looks like it has similar
AG health is probably what you want, there's a windows event log for errors and then health can be done with powershell SAM or simmilar, perhaps just SQL SAM
You can use a SAM SQL monitor to query the SQL instance if there are any AG's that is failing. Use below query:
select g.name INTO #AGStatus from sys.dm_hadr_availability_group_states S inner join sys.availability_groups G on s.group_id=G.group_id Where synchronization_health<2 AND s.primary_recovery_health=1 IF (Select COUNT(name) from #AGStatus)>0 BEGIN Select count(*) as "Rowcount", t.FailingAG from( Select substring( ( Select ', '+ags.name AS [text()] From #AGStatus ags For XML PATH ('') ) , 2, 1000) [FailingAG] From #AGStatus ags) as t group by t.FailingAG END ELSE Select 0 AS "RowCount" Drop table #AGStatus
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 200,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process.