Class DatabaseMirroringSchema.DatabaseMirroringWitness
- Namespace
- LinqToDB.Tools.DataProvider.SqlServer.Schemas
- Assembly
- linq2db.Tools.dll
Database Mirroring Witness Catalog Views - sys.database_mirroring_witnesses
Applies to: √ SQL Server (all supported versions)
Contains a row for every witness role that a server plays in a database mirroring partnership.
In a database mirroring session, automatic failover requires a witness server. Ideally, the witness resides on a separate computer from both the principal and mirror servers. The witness does not serve the database. Instead, it monitors the status of the principal and mirror servers. If the principal server fails, the witness may initiate automatic failover to the mirror server.
[Table(Schema = "sys", Name = "database_mirroring_witnesses", IsView = true)]
public class DatabaseMirroringSchema.DatabaseMirroringWitness
- Inheritance
-
DatabaseMirroringSchema.DatabaseMirroringWitness
- Extension Methods
Properties
DatabaseName
Name of the two copies of the database in the database mirroring session.
[Column("database_name")]
[NotNull]
public string DatabaseName { get; set; }
Property Value
FamilyGuid
Identifier of the backup family for the database. Used for detecting matching restore states.
[Column("family_guid")]
[NotNull]
public Guid FamilyGuid { get; set; }
Property Value
IsSuspended
Database mirroring is suspended.
[Column("is_suspended")]
[Nullable]
public bool? IsSuspended { get; set; }
Property Value
- bool?
IsSuspendedSequenceNumber
Sequence number for setting is_suspended.
[Column("is_suspended_sequence_number")]
[NotNull]
public int IsSuspendedSequenceNumber { get; set; }
Property Value
MirrorServerName
Name of the partner server whose copy of the database is currently the mirror database.
[Column("mirror_server_name")]
[Nullable]
public string? MirrorServerName { get; set; }
Property Value
MirroringGuid
Identifier of the mirroring partnership.
[Column("mirroring_guid")]
[NotNull]
public Guid MirroringGuid { get; set; }
Property Value
PartnerSyncState
Synchronization state of the mirroring session:
5 = The partners are synchronized. Failover is potentially possible. For information about the requirements for failover see, Role Switching During a Database Mirroring Session (SQL Server).
6 = The partners are not synchronized. Failover is not possible now.
[Column("partner_sync_state")]
[Nullable]
public byte? PartnerSyncState { get; set; }
Property Value
- byte?
PartnerSyncStateDesc
Description of the synchronization state of the mirroring session:
SYNCHRONIZED
UNSYNCHRONIZED
[Column("partner_sync_state_desc")]
[Nullable]
public string? PartnerSyncStateDesc { get; set; }
Property Value
PrincipalServerName
Name of partner server whose copy of the database is currently the principal database.
[Column("principal_server_name")]
[Nullable]
public string? PrincipalServerName { get; set; }
Property Value
RoleSequenceNumber
Update sequence number for changes to principal/mirror roles played by the mirroring partners.
[Column("role_sequence_number")]
[NotNull]
public int RoleSequenceNumber { get; set; }
Property Value
SafetyLevel
Transaction safety setting for updates on the mirror database:
0 = Unknown state
1 = Off (asynchronous)
2 = Full (synchronous)
Using a witness for automatic failover requires full transaction safety, which is the default.
[Column("safety_level")]
[NotNull]
public byte SafetyLevel { get; set; }
Property Value
SafetyLevelDesc
Description of safety guarantee of updates on the mirror database:
UNKNOWN
OFF
FULL
[Column("safety_level_desc")]
[Nullable]
public string? SafetyLevelDesc { get; set; }
Property Value
SafetySequenceNumber
Update sequence number for changes to safety_level.
[Column("safety_sequence_number")]
[NotNull]
public int SafetySequenceNumber { get; set; }