Tag: Always On Availability Groups
-
Creating SQL Logins on an Availability Group (AG) Environment
In an Availability Group, the databases fail over. Your SQL logins do not. For Windows domain logins, the SID is owned by AD, so you just create the login on each replica and it syncs up. For SQL logins, the SID is generated inside SQL Server. If the SID differs between replicas, the database user…
-
How to Get the SQL Server IP Address
When troubleshooting connectivity, firewall rules, or unexpected routing, you often need one simple answer: which IP address and port did my session actually connect to? SQL Server can listen on multiple IPs (and listeners can resolve to multiple addresses), so the hostname in your connection string does not always tell you what you really hit.…
-
Script: Check AG Replica Role and Synchronization State
This script returns the current role, synchronization state, health status, and failover configuration for replicas participating in an Always On Availability Group. It is commonly used during failover validation, replica troubleshooting, and general high availability health checks. The Script Example Output The result set shows one row per replica in each Availability Group. Important columns…
-
Script: Check Always On Availability Group Latency
This script returns replication latency information for databases participating in an Always On Availability Group (AG). It shows how far each secondary database is behind the primary, the redo queue size, redo rate, and an estimated recovery completion time. It helps identify AG latency, redo backlog, and data movement delays between primary and secondary replicas.…