Class DatabasesAndFilesSchema.DatabaseMirroring
- Namespace
- LinqToDB.Tools.DataProvider.SqlServer.Schemas
- Assembly
- linq2db.Tools.dll
sys.database_mirroring (Transact-SQL)
Applies to: √ SQL Server (all supported versions)
Contains one row for each database in the instance of SQL Server. If the database is not ONLINE or database mirroring is not enabled, the values of all columns except database_id will be NULL.
To see the row for a database other than master or tempdb, you must either be the database owner or have at least ALTER ANY DATABASE or VIEW ANY DATABASE server-level permission or CREATE DATABASE permission in the master database. To see non-NULL values on a mirror database, you must be a member of the sysadmin fixed server role.
note
If a database does not participate in mirroring, all columns prefixed with 'mirroring_' are NULL.
[Table(Schema = "sys", Name = "database_mirroring", IsView = true)]
public class DatabasesAndFilesSchema.DatabaseMirroring
- Inheritance
-
DatabasesAndFilesSchema.DatabaseMirroring
- Extension Methods
Properties
DatabaseID
ID of the database. Is unique within an instance of SQL Server.
[Column("database_id")]
[NotNull]
public int DatabaseID { get; set; }
Property Value
MirroringConnectionTimeout
Mirroring connection time out in seconds. This is the number of seconds to wait for a reply from a partner or witness before considering them unavailable. The default time-out value is 10 seconds.
NULL = Database is inaccessible or is not mirrored.
[Column("mirroring_connection_timeout")]
[Nullable]
public int? MirroringConnectionTimeout { get; set; }
Property Value
- int?
MirroringEndOfLogLsn
The local end-of-log that has been flushed to disk. This is comparable to the hardened LSN from the mirror server (see the mirroring_failover_lsn column).
[Column("mirroring_end_of_log_lsn")]
[Nullable]
public decimal? MirroringEndOfLogLsn { get; set; }
Property Value
MirroringFailoverLsn
Log sequence number (LSN) of the latest transaction log record that is guaranteed to be hardened to disk on both partners. After a failover, the mirroring_failover_lsn is used by the partners as the point of reconciliation at which the new mirror server begins to synchronize the new mirror database with the new principal database.
[Column("mirroring_failover_lsn")]
[Nullable]
public decimal? MirroringFailoverLsn { get; set; }
Property Value
MirroringGuid
ID of the mirroring partnership.
NULL= Database is inaccessible or is not mirrored.
Note: If the database does not participate in mirroring, all columns prefixed with 'mirroring_' are NULL.
[Column("mirroring_guid")]
[Nullable]
public Guid? MirroringGuid { get; set; }
Property Value
- Guid?
MirroringPartnerInstance
The instance name and computer name for the other partner. Clients require this information to connect to the partner if it becomes the principal server.
NULL = Database is inaccessible or is not mirrored.
[Column("mirroring_partner_instance")]
[Nullable]
public string? MirroringPartnerInstance { get; set; }
Property Value
MirroringPartnerName
Server name of the database mirroring partner.
NULL = Database is inaccessible or is not mirrored.
[Column("mirroring_partner_name")]
[Nullable]
public string? MirroringPartnerName { get; set; }
Property Value
MirroringRedoQueue
Maximum amount of log to be redone on the mirror. If mirroring_redo_queue_type is set to UNLIMITED, which is the default setting, this column is NULL. If the database is not online, this column is also NULL.
Otherwise, this column contains the maximum amount of log in megabytes. When the maximum is reached, the log is temporarily stalled on the principal as the mirror server catches up. This feature limits failover time.
For more information, see Estimate the Interruption of Service During Role Switching (Database Mirroring).
[Column("mirroring_redo_queue")]
[Nullable]
public int? MirroringRedoQueue { get; set; }
Property Value
- int?
MirroringRedoQueueType
UNLIMITED indicates that mirroring will not inhibit the redo queue. This is the default setting.
MB for maximum size of the redo queue in mega bytes. Note that if the queue size was specified as kilobytes or gigabytes, the Database Engine converts the value into megabytes.
If the database is not online, this column is NULL.
[Column("mirroring_redo_queue_type")]
[Nullable]
public string? MirroringRedoQueueType { get; set; }
Property Value
MirroringReplicationLsn
The maximum LSN that replication can send.
[Column("mirroring_replication_lsn")]
[Nullable]
public decimal? MirroringReplicationLsn { get; set; }
Property Value
MirroringRole
Current role of the local database plays in the database mirroring session.
1 = Principal
2 = Mirror
NULL = Database is inaccessible or is not mirrored.
[Column("mirroring_role")]
[Nullable]
public byte? MirroringRole { get; set; }
Property Value
- byte?
MirroringRoleDesc
Description of the role the local database plays in mirroring, can be one of:
PRINCIPAL
MIRROR
[Column("mirroring_role_desc")]
[Nullable]
public string? MirroringRoleDesc { get; set; }
Property Value
MirroringRoleSequence
The number of times that mirroring partners have switched the principal and mirror roles due to a failover or forced service.
NULL = Database is inaccessible or is not mirrored.
[Column("mirroring_role_sequence")]
[Nullable]
public int? MirroringRoleSequence { get; set; }
Property Value
- int?
MirroringSafetyLevel
Safety setting for updates on the mirror database:
0 = Unknown state
1 = Off [asynchronous]
2 = Full [synchronous]
NULL = Database is inaccessible or is not mirrored.
[Column("mirroring_safety_level")]
[Nullable]
public byte? MirroringSafetyLevel { get; set; }
Property Value
- byte?
MirroringSafetyLevelDesc
Transaction safety setting for the updates on the mirror database, can be one of:
UNKNOWN
OFF
FULL
NULL
[Column("mirroring_safety_level_desc")]
[Nullable]
public string? MirroringSafetyLevelDesc { get; set; }
Property Value
MirroringSafetySequence
Update the sequence number for changes to transaction safety level.
NULL = Database is inaccessible or is not mirrored.
[Column("mirroring_safety_sequence")]
[Nullable]
public int? MirroringSafetySequence { get; set; }
Property Value
- int?
MirroringState
State of the mirror database and of the database mirroring session.
0 = Suspended
1 = Disconnected from the other partner
2 = Synchronizing
3 = Pending Failover
4 = Synchronized
5 = The partners are not synchronized. Failover is not possible now.
6 = The partners are synchronized. Failover is potentially possible. For information about the requirements for failover see, Database Mirroring Operating Modes.
NULL = Database is inaccessible or is not mirrored.
[Column("mirroring_state")]
[Nullable]
public byte? MirroringState { get; set; }
Property Value
- byte?
MirroringStateDesc
Description of the state of the mirror database and of the database mirroring session, can be one of:
DISCONNECTED
SYNCHRONIZED
SYNCHRONIZING
PENDING_FAILOVER
SUSPENDED
UNSYNCHRONIZED
SYNCHRONIZED
NULL
For more information, see Mirroring States (SQL Server).
[Column("mirroring_state_desc")]
[Nullable]
public string? MirroringStateDesc { get; set; }
Property Value
MirroringWitnessName
Server name of the database mirroring witness.
NULL = No witness exists.
[Column("mirroring_witness_name")]
[Nullable]
public string? MirroringWitnessName { get; set; }
Property Value
MirroringWitnessState
State of the witness in the database mirroring session of the database, can be one of:
0 = Unknown
1 = Connected
2 = Disconnected
NULL = No witness exists, the database is not online, or the database is not mirrored.
[Column("mirroring_witness_state")]
[Nullable]
public byte? MirroringWitnessState { get; set; }
Property Value
- byte?
MirroringWitnessStateDesc
Description of state, can be one of:
UNKNOWN
CONNECTED
DISCONNECTED
NULL
[Column("mirroring_witness_state_desc")]
[Nullable]
public string? MirroringWitnessStateDesc { get; set; }