Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to:
Azure SQL Database
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 aren't yet completed.1 = Seeding. The geo-replication target is being seeded but the two databases aren't yet synchronized. Until seeding completes, you can't connect to the secondary database. Removing secondary database from the primary cancels the seeding operation.2 = Catch-up. The secondary database is in a transactionally consistent state and is being constantly synchronized with the primary database.4 = Suspended. This isn't an active continuous-copy relationship. This state usually indicates that the bandwidth available for the interlink is insufficient for the level of transaction activity on the primary database. However, the continuous-copy relationship is still intact. |
replication_state_desc |
nvarchar(256) | PENDINGSEEDINGCATCH_UPSUSPENDED |
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) | PRIMARYSECONDARY |
secondary_allow_connections |
tinyint | The secondary type, one of:0 = No. The secondary database isn't 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. |
percent_copied |
int | Seeding progress in percent. |
Permissions
This view is only available in the master database on the logical server to the server-level principal login. Results will only be returned for the server administrator, Microsoft Entra admin, or for a user with the dbmanager role.
Examples
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;