Users: 30k; Pages Per Session: 2.5p; Avg. Session Duration: 1:35mi
Explore Tools
{Featuring Microsoft Technologies + Enterprise Data + Cloud Computing}

Azure SQL Database Geo-Replication - Initiate a Failover using T-SQL
by BF (Senior MSSQL Operations - Enterprise, Cloud, Strategy)


Step 1: Connect to the Secondary Geo-Replicated Node using SQL Server Management Studio

Step 2: Open a New Query to the Master Database


Helper T-SQL:

#1.On your Primary Node User Database:

select * from [sys].[dm_geo_replication_link_status]

sys.dm_geo_replication_link_status (Azure SQL Database)

Contains a row for each replication link between primary and secondary databases in a geo-replication partnership. This includes both primary and secondary databases. If more than one continuous replication link exists for a given primary database, this table contains a row for each of the relationships. The view is created in all databases, including the logical master. However, querying this view in the logical master returns an empty set.

#2. On your Primary Node Master Database:

select * from [sys].[dm_operation_status]

sys.dm_operation_status (Azure SQL Database)

Returns information about operations performed on databases in a Azure SQL Database server.