SELECT * FROM sys.dm_hadr_availability_replica_states;
SELECT * FROM sys.dm_hadr_database_replica_states;
Get-ClusterLog -Node MYSERVER -TimeSpan 15
Causes Powershell to generate Cluster.log for MYSERVER covering the last 15 minutesOpen Cluster.log in Notepad.
Useful search terms can be things like...
failoverCount
Process has
=== Nodes ===
permission
Connect to SQL Server
USE MASTER
GO
WHILE 1=1
BEGIN
PRINT CONVERT(VARCHAR(20), GETDATE(),120)
DECLARE @max INT;
SELECT @max = max_workers_count
FROM sys.dm_os_sys_info;
SELECT GETDATE() AS 'CurrentDate',
@max AS 'TotalThreads',
SUM(active_Workers_count) AS 'CurrentThreads',
@max - SUM(active_Workers_count) AS 'AvailableThreads',
SUM(runnable_tasks_count) AS 'WorkersWaitingForCpu',
SUM(work_queue_count) AS 'RequestWaitingForThreads'
--SUM(current_workers_count) AS 'AssociatedWorkers'
FROM sys.dm_os_Schedulers
WHERE STATUS = 'VISIBLE ONLINE';
WAIT FOR DELAY '0:0:15'
END
To view the quorum model...
SELECT cluster_name,
quorum_type_desc,
quorum_state_desc
FROM sys.dm_hadr_cluster;
To view the node votes...
SELECT member_name,
number_of_quorum_votes
FROM sys.dm_hadr_cluster_members;
This login account should have the following permssions.
(these are granted by default but may have been revoked)Alter Any Availability Group
Connect SQL
View server state
SELECT database_name, is_failover_ready
FROM sys.dm_hadr_database_replica_cluster_states
WHERE replica_id IN (SELECT replica_id
FROM sys.dm_hadr_availability_replica_states)
TODO
TODO
TODO
TODO
TODO
TODO
TODO