sys.geo_replication_links (Azure SQL Database)

APPLIES TO: noSQL Server yesAzure SQL Database noAzure Synapse Analytics (SQL DW) noParallel Data Warehouse

Contains a row for each replication link between primary and secondary databases in a geo-replication partnership. This view resides in the logical master database.

Column name Data type Description
database_id int ID of the current database in the sys.databases view.
start_date datetimeoffset UTC time at a regional SQL Database datacenter when the database replication was initiated
modify_date datetimeoffset UTC time at regional SQL Database datacenter when the database geo-replication has completed. The new database is synchronized with the primary database as of this time. .
link_guid uniqueidentifier Unique ID of the geo-replication link.
partner_server sysname Name of the SQL Database server containing the geo-replicated database.
partner_database sysname Name of the geo-replicated database on the linked SQL Database server.
replication_state tinyint The state of geo-replication for this database, one of:.

0 = Pending. Creation of the active secondary database is scheduled but the necessary preparation steps are not yet completed.

1 = Seeding. The geo-replication target is being seeded but the two databases are not yet synchronized. Until seeding completes, you cannot connect to the secondary database. Removing secondary database from the primary will cancel the seeding operation.

2 = Catch-up. The secondary database is in a transactionally consistent state and is being constantly synchronized with the primary database.
replication_state_desc nvarchar(256) PENDING

SEEDING

CATCH_UP
role tinyint Geo-replication role, one of:

0 = Primary. The database_id refers to the primary database in the geo-replication partnership.

1 = Secondary. The database_id refers to the primary database in the geo-replication partnership.
role_desc nvarchar(256) PRIMARY

SECONDARY
secondary_allow_connections tinyint The secondary type, one of:

0 = No. The secondary database is not accessible until failover.

1 = ReadOnly. The secondary database is accessible only to client connections with ApplicationIntent=ReadOnly.

2 = All. The secondary database is accessible to any client connection.
secondary_allow_connections _desc nvarchar(256) No

All

Read-Only

Permissions

This view is only available in the master database to the server-level principal login.

Example

Show all databases with geo-replication links.

SELECT
     database_id  
   , start_date  
   , partner_server  
   , partner_database  
   , replication_state  
   , role_desc  
   , secondary_allow_connections_desc
FROM sys.geo_replication_links;  

See Also

ALTER DATABASE (Azure SQL Database)
sys.dm_geo_replication_link_status (Azure SQL Database)
sys.dm_operation_status (Azure SQL Database)