eG Monitoring
 

Measures reported by MsSqlMirorStatTest

Database mirroring is a solution for increasing the availability of a SQL Server database. Mirroring is implemented on a per-database basis and works only with databases that use the full recovery model.

Database mirroring maintains two copies of a single database that must reside on different server instances of SQL Server Database Engine. Typically, these server instances reside on computers in different locations. Starting database mirroring on a database, initiates a relationship, known as a database mirroring session, between these server instances.

One server instance serves the database to clients (the principal server). The other instance acts as a hot or warm standby server (the mirror server), depending on the configuration and state of the mirroring session. When a database mirroring session is synchronized, database mirroring provides a hot standby server that supports rapid failover without a loss of data from committed transactions. A Witness is an optional instance of SQL Server that enables the mirror server to recognize when to initiate an automatic failover. Unlike the two failover partners, the witness does not serve the database. Supporting automatic failover is the only role of the witness.

When the session is not synchronized, the mirror server is typically available as a warm standby server (with possible data loss).

It is hence evident that to prevent any data loss during failover, a database mirroring session should be in the synchronized state and a Witness should be up and running. If one or both the aforesaid conditions are not fulfilled, data loss is bound to occur. This is why, administrators should continuously track the state of every database mirroring session and witness on a SQL server instance. This is where the MsSqlMirorStatTest helps.

For each database on a SQL server instance on which database mirroring is enabled, this test reports the current status of the mirroring session of that database, reveals what role that database plays in the mirroring session, and the current state of the witness. This way, administrators are promptly alerted when any mirroring session or witness switches to an abnormal state.

The measures made by this test are as follows:

Measurement Description Measurement Unit Interpretation
mirrorStat Indicates the mirroring state of this database mirroring session. Number The values that this measure can report and their corresponding numeric values are as follows:

Measure Value Numeric Value
Synchronized 0
Synchronizing 1
Suspended 2
DISCONNECTED 3
Pending Failover 4

Note:

By default, this measure reports the Measure Values listed in the table above to indicate the current status of a database mirroring session. In the graph of this measure however, the same is represented using the numeric equivalents only.
mirrorRoleStat Indicates the role that is currently played by this database in the mirroring session. Number The values that this measure can report and their corresponding numeric values are as follows:

Measure Value Numeric Value
PRINCIPAL 1
MIRROR 2

Note:

By default, this measure reports the Measure Values listed in the table above to indicate the database role. In the graph of this measure however, the same is represented using the numeric equivalents only.
mirrorWitnesStat Indicates the current state of the witness in the database mirroring session. Number The values that this measure can report and their corresponding numeric values are as follows:

Measure Value Numeric Value
No witness exists 0
Connected 1
Unknown 2
Disconnected 3

Note:

By default, this measure reports the Measure Values listed in the table above to indicate the state of the witness. In the graph of this measure however, the same is represented using the numeric equivalents only.