Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Availability Group Best Practice Checks #196

Closed
JamesFerebee opened this issue Oct 31, 2022 · 2 comments
Closed

Availability Group Best Practice Checks #196

JamesFerebee opened this issue Oct 31, 2022 · 2 comments
Labels
enhancement wave 2 - complete consider this issue for next wave of fixes

Comments

@JamesFerebee
Copy link
Contributor

JamesFerebee commented Oct 31, 2022

Add Best Practices report section to:

  1. Check if hadr endpoint is enabled/running. If not, flag it.
  2. Report if any databases in an AG are showing unhealthy. If so, flag it. (see AG dashboard for reference)
@PiJoCoder PiJoCoder added enhancement wave 2 - complete consider this issue for next wave of fixes labels Oct 31, 2022
@PiJoCoder
Copy link
Collaborator

PiJoCoder commented Feb 21, 2023

Possibly query to use:

SELECT dc.database_name, d.synchronization_health_desc, d.synchronization_state_desc, d.database_state_desc 
FROM sys.dm_hadr_database_replica_states d 
JOIN sys.availability_databases_cluster dc 
  ON d.group_database_id = dc.group_database_id AND d.is_local = 1

@PiJoCoder
Copy link
Collaborator

PiJoCoder commented Feb 22, 2023

SELECT group_name, 
  operational_state_desc, 
  connected_state_desc, 
  synchronization_health_desc
FROM tbl_hadr_ag_replica_states
WHERE operational_state_desc <> 'ONLINE'

SELECT 
  name as AG_Name, 
  synchronization_health_desc 
FROM tbl_hadr_ag_states
WHERE synchronization_health_desc  <> 'HEALTHY'

SELECT 
  name as HADR_Endpoint, 
  type_desc, 
  state_desc 
FROM tbl_hadr_endpoints_principals
WHERE state_desc <> 'STARTED'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement wave 2 - complete consider this issue for next wave of fixes
Projects
None yet
Development

No branches or pull requests

2 participants