| 437-991-3573 | Data Engineering Services
Resources Tools
Experts in Microsoft SQL Server on Windows, Linux, Containers | Clusters, Always On, FCI | Migrations, Cloud, Performance

Azure SQL Database Geo-Replication - Initiate a Failover using T-SQL
by BF (Principal Consultant; Architecture; Engineering)


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.