Skip to content

Commit 19ae50c

Browse files
authored
Merge pull request MicrosoftDocs#4858 from pmasl/patch-164
Update sys-dm-hadr-database-replica-states-transact-sql.md
2 parents 247ceaa + b83051b commit 19ae50c

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

docs/relational-databases/system-dynamic-management-views/sys-dm-hadr-database-replica-states-transact-sql.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "sys.dm_hadr_database_replica_states (Transact-SQL) | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/08/2017"
4+
ms.date: "02/11/2018"
55
ms.prod: "sql-non-specified"
66
ms.prod_service: "database-engine"
77
ms.service: ""
@@ -44,14 +44,14 @@ ms.workload: "On Demand"
4444
|**replica_id**|**uniqueidentifier**|Identifier of the availability replica within the availability group.|
4545
|**group_database_id**|**uniqueidentifier**|Identifier of the database within the availability group. This identifier is identical on every replica to which this database is joined.|
4646
|**is_local**|**bit**|Whether the availability database is local, one of:<br /><br /> 0 = The database is not local to the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] instance.<br /><br /> 1 = The database is local to the server instance.|
47-
|**is_primary_replica**|**bit**|Returns 1 if the replica is primary, or 0 if it is a secondary replica. Applicable to SQL Server 2014 and above.|
48-
|**synchronization_state**|**tinyint**|Data-movement state, one of the following values.<br /><br /> 0 = Not synchronizing. For a primary database, indicates that the database is not ready to synchronize its transaction log with the corresponding secondary databases. For a secondary database, indicates that the database has not started log synchronization because of a connection issue, is being suspended, or is going through transition states during startup or a role switch.<br /><br /> 1 = Synchronizing. For a primary database, indicates that the database is ready to accept a scan request from a secondary database. For a secondary database, indicates that active data movement is occurring for the database.<br /><br /> 2 = Synchronized. A primary database shows SYNCHRONIZED in place of SYNCHRONIZING. A synchronous-commit secondary database shows synchronized when the local cache says the database is failover ready and is synchronizing.<br /><br /> 3 = Reverting. Indicates the phase in the undo process when a secondary database is actively getting pages from the primary database. **Caution:** When a database on a secondary replica is in the REVERTING state, forcing failover to the secondary replica leaves the database in a state in which it cannot be started as a primary database. Either the database will need to reconnect as a secondary database, or you will need to apply new log records from a log backup.<br /><br /> 4 = Initializing. Indicates the phase of undo when the transaction log required for a secondary database to catch up to the undo LSN is being shipped and hardened on a secondary replica. **Caution:** When a database on a secondary replica is in the INITIALIZING state, forcing failover to the secondary replica leaves the database in a state in which it be started as a primary database. Either the database will need to reconnect as a secondary database, or you will need to apply new log records from a log backup.|
47+
|**is_primary_replica**|**bit**|Returns 1 if the replica is primary, or 0 if it is a secondary replica.<br /><br />**Applies to:** [!INCLUDE[ssSQL14](../../includes/sssql14-md.md)] through [!INCLUDE[ssCurrent](../../includes/sscurrent-md.md)].|
48+
|**synchronization_state**|**tinyint**|Data-movement state, one of the following values.<br /><br /> 0 = Not synchronizing. For a primary database, indicates that the database is not ready to synchronize its transaction log with the corresponding secondary databases. For a secondary database, indicates that the database has not started log synchronization because of a connection issue, is being suspended, or is going through transition states during startup or a role switch.<br /><br /> 1 = Synchronizing. For a primary database, indicates that the database is ready to accept a scan request from a secondary database. For a secondary database, indicates that active data movement is occurring for the database.<br /><br /> 2 = Synchronized. A primary database shows SYNCHRONIZED in place of SYNCHRONIZING. A synchronous-commit secondary database shows synchronized when the local cache says the database is failover ready and is synchronizing.<br /><br /> 3 = Reverting. Indicates the phase in the undo process when a secondary database is actively getting pages from the primary database.<br />**Caution:** When a database on a secondary replica is in the REVERTING state, forcing failover to the secondary replica leaves the database in a state in which it cannot be started as a primary database. Either the database will need to reconnect as a secondary database, or you will need to apply new log records from a log backup.<br /><br /> 4 = Initializing. Indicates the phase of undo when the transaction log required for a secondary database to catch up to the undo LSN is being shipped and hardened on a secondary replica.<br />**Caution:** When a database on a secondary replica is in the INITIALIZING state, forcing failover to the secondary replica leaves the database in a state in which it be started as a primary database. Either the database will need to reconnect as a secondary database, or you will need to apply new log records from a log backup.|
4949
|**synchronization_state_desc**|**nvarchar(60)**|Description of the data-movement state, one of:<br /><br /> NOT SYNCHRONIZING<br /><br /> SYNCHRONIZING<br /><br /> SYNCHRONIZED<br /><br /> REVERTING<br /><br /> INITIALIZING|
5050
|**is_commit_participant**|**bit**|0 = Transaction commit is not synchronized with respect to this database.<br /><br /> 1 = Transaction commit is synchronized with respect to this database.<br /><br /> For a database on an asynchronous-commit availability replica, this value is always 0.<br /><br /> For a database on a synchronous-commit availability replica, this value is accurate only on the primary database.|
5151
|**synchronization_health**|**tinyint**|Reflects the intersection of the synchronization state of a database that is joined to the availability group on the availability replica and the availability mode of the availability replica (synchronous-commit or asynchronous-commit mode), one of the following values.<br /><br /> 0 = Not healthy. The **synchronization_state** of the database is 0 (NOT SYNCHRONIZING).<br /><br /> 1 = Partially healthy. A database on a synchronous-commit availability replica is considered partially healthy if **synchronization_state** is 1 (SYNCHRONIZING).<br /><br /> 2 = Healthy. A database on an synchronous-commit availability replica is considered healthy if **synchronization_state** is 2 (SYNCHRONIZED), and a database on an asynchronous-commit availability replica is considered healthy if **synchronization_state** is 1 (SYNCHRONIZING).|
5252
|**synchronization_health_desc**|**nvarchar(60)**|Description of the **synchronization_health** of the availability database.<br /><br /> NOT_HEALTHY<br /><br /> PARTIALLY_HEALTHY<br /><br /> HEALTHY|
5353
|**database_state**|**tinyint**|0 = Online<br /><br /> 1 = Restoring<br /><br /> 2 = Recovering<br /><br /> 3 = Recovery pending<br /><br /> 4 = Suspect<br /><br /> 5 = Emergency<br /><br /> 6 = Offline<br /><br /> **Note:** Same as **state** column in sys.databases.|
54-
|**database_state_desc**|**nvarchar(60)**|Description of the **database_state** of the availability replica.<br /><br /> ONLINE<br /><br /> RESTORING<br /><br /> RECOVERING<br /><br /> RECOVERY_PENDING<br /><br /> SUSPECT<br /><br /> EMERGENCY<br /><br /> OFFLINE<br /><br /> **Note:** Same as **state** column in sys.databases.|
54+
|**database_state_desc**|**nvarchar(60)**|Description of the **database_state** of the availability replica.<br /><br /> ONLINE<br /><br /> RESTORING<br /><br /> RECOVERING<br /><br /> RECOVERY_PENDING<br /><br /> SUSPECT<br /><br /> EMERGENCY<br /><br /> OFFLINE<br /><br /> **Note:** Same as **state_desc** column in sys.databases.|
5555
|**is_suspended**|**bit**|Database state, one of:<br /><br /> 0 = Resumed<br /><br /> 1 = Suspended|
5656
|**suspend_reason**|**tinyint**|If the database is suspended, the reason for the suspended state, one of:<br /><br /> 0 = User action<br /><br /> 1 = Suspend from partner<br /><br /> 2 = Redo<br /><br /> 3 = Capture<br /><br /> 4 = Apply<br /><br /> 5 = Restart<br /><br /> 6 = Undo<br /><br /> 7 = Revalidation<br /><br /> 8 = Error in the calculation of the secondary-replica synchronization point|
5757
|**suspend_reason_desc**|**nvarchar(60)**|Description of the database suspended state reason, one of:<br /><br /> SUSPEND_FROM_USER = A user manually suspended data movement<br /><br /> SUSPEND_FROM_PARTNER = The database replica is suspended after a forced failover<br /><br /> SUSPEND_FROM_REDO = An error occurred during the redo phase<br /><br /> SUSPEND_FROM_APPLY = An error occurred when writing the log to file (see error log)<br /><br /> SUSPEND_FROM_CAPTURE = An error occurred while capturing log on the primary replica<br /><br /> SUSPEND_FROM_RESTART = The database replica was suspended before the database was restarted (see error log)<br /><br /> SUSPEND_FROM_UNDO = An error occurred during the undo phase (see error log)<br /><br /> SUSPEND_FROM_REVALIDATION = Log change mismatch is detected on reconnection (see error log)<br /><br /> SUSPEND_FROM_XRF_UPDATE = Unable to find the common log point (see error log)|
@@ -74,7 +74,7 @@ ms.workload: "On Demand"
7474
|**last_commit_lsn**|**Numeric(25,0)**|Actual log sequence number corresponding to the last commit record in the transaction log.<br /><br /> On the primary database, this corresponds to the last commit record processed. Rows for secondary databases show the log sequence number that the secondary replica has sent to the primary replica.<br /><br /> On the secondary replica, this is the last commit record that was redone.|
7575
|**last_commit_time**|**datetime**|Time corresponding to the last commit record.<br /><br /> On the secondary database, this time is the same as on the primary database.<br /><br /> On the primary replica, each secondary database row displays the time that the secondary replica that hosts that secondary database has reported back to the primary replica. The difference in time between the primary-database row and a given secondary-database row represents approximately the recovery time objective (RPO), assuming that the redo process is caught up and that the progress has been reported back to the primary replica by the secondary replica.|
7676
|**low_water_mark_for_ghosts**|**bigint**|A monotonically increasing number for the database indicating a low water mark used by ghost cleanup on the primary database. If this number is not increasing over time, it implies that ghost cleanup might not happen. To decide which ghost rows to clean up, the primary replica uses the minimum value of this column for this database across all availability replicas (including the primary replica).|
77-
|**secondary_lag_seconds**|**bigint**|The number of seconds that the secondary replica is behind the primary replica during synchronization.|
77+
|**secondary_lag_seconds**|**bigint**|The number of seconds that the secondary replica is behind the primary replica during synchronization.<br /><br />**Applies to:** [!INCLUDE[ssSQL15](../../includes/sssql15-md.md)] through [!INCLUDE[ssCurrent](../../includes/sscurrent-md.md)].|
7878

7979
## <a name="LSNcolumns"></a> Understanding the LSN Column Values
8080
The values of the **end_of_log_lsn**, **last_hardened_lsn**, **last_received_lsn**, **last_sent_lsn**, **recovery_lsn**, and **truncation_lsn** columns are not actual log sequence numbers (LSNs). Rather each of these values reflects a log-block ID padded with zeroes.

0 commit comments

Comments
 (0)