A mirrored SQL Server database stops serving correctly when the mirror session breaks, leaving the principal in a SUSPENDED or DISCONNECTED state and the mirror no longer receiving log. Fixing it means restoring communication, resuming the session, and then repairing the data on the mirror side if the transaction logs have fallen too far out of sync. The single most important condition: you must decide quickly whether the principal is healthy but disconnected, or whether a real data divergence has occurred. The first case is a resume operation; the second is a restore-and-rejoin operation. Mixing them up is how people convert a recoverable outage into a full re-seed. This guide walks the ordered checks and actions, from cheapest to most invasive.
Establish the failure mode before touching anything
Database mirroring in SQL Server (the classic, non-Always On feature configured through ALTER DATABASE ... SET PARTNER) operates as a log-shipping session with two roles: principal and mirror. A witness can provide automatic failover. The health states you will see include SYNCHRONIZED, SYNCHRONIZING, SUSPENDED, DISCONNECTED, and PENDING_FAILOVER. "Fix" means different things in each.
Run these first, on both instances, and record the output before changing state:
Then check the SQL Server error log on both sides and the database mirroring event log entries. Typical signatures:
Partner timeout errors (1418 / 1443 class) and "The mirroring connection to ... has timed out" messages usually indicate network, firewall, DNS, or endpoint trouble, not data corruption. "The remote server instance ... has not been configured to accept connections" points at endpoint configuration or certificate mismatch. State SUSPENDED with SYNCHRONIZED or SYNCHRONIZING before the break usually means the log stream is intact and resume will work. State DISCONNECTED with a large gap in log growth on the principal means the mirror is far behind and may not catch up before the log truncates.
This diagnosis step is reversible. Everything after it has consequences.
Repair prerequisites and the short stop list
Have these ready before you act:
1: Login access with CONTROL SERVER on both instances, or an account with ALTER DATABASE rights plus endpoint permissions. 2: The instance names, port numbers, and endpoint names for both partners. 3: A known-good full backup and log backup chain of the principal, recent enough that a re-seed within your RTO is possible. 4: Free disk space on the mirror for a restore that may need to grow files. 5: Confirmation of the safety level: high safety (synchronous) versus high performance (asynchronous). Fixes differ, because async partners are allowed to lag and a resume may not need anything beyond restarting the session.
Stop and involve a database professional if any of the following is true: the principal reports suspect pages or corruption errors; you cannot produce a verified backup; the mirror has been disconnected long enough that the principal's log has truncated past the mirror's last LSN; or you are running a production system where a wrong DBCC or restore could destroy the only copy. Those are conditions where a controlled approach with vendor or DBA support beats improvising.
Step 1: Fix the transport layer, then resume the session
Most mirror outages are transport outages. Work from cheapest to most invasive.
1: Test TCP reachability between the two hosts on the mirroring port (the database mirroring endpoint listens on a specific port, often 5022). Use a simple connectivity check from each host to the other. 2: Confirm the endpoint exists and is started on both instances:
3: Confirm the service accounts can authenticate to each other. With Windows authentication endpoints, the SQL Server service accounts need rights to each other's SPNs; with certificate-based endpoints, the certificate must be present and trusted on both sides. 4: Check firewall rules on both hosts and any intermediate network device. A change to a network ACL or a host-based firewall is a common cause of a session that was healthy yesterday. 5: Restart the endpoint if it is stopped. 6: Resume the session from the principal (and from the mirror if the principal command fails or if the mirror holds the current principal role):
Expected result: mirroring_state_desc moves to SYNCHRONIZING and then SYNCHRONIZED in synchronous mode. Success check: query sys.database_mirroring on both sides, confirm matching roles and a moving mirroring_end_of_log_lsn on the mirror, and verify the mirror's log is being applied by checking that mirroring_failover_lsn advances. If the state returns to SUSPENDED within a minute or two, the transport fix did not hold; treat the next section as the cause.
One important nuance: RESUME does not fix a broken log chain. If the mirror's last applied LSN is behind the principal's oldest available log record, the resume will fail or the mirror will not catch up. That's the data-divergence case.
Step 2: Repair a mirror that fell behind by restoring the log chain
In high-safety mode the principal holds log until the mirror confirms, so the mirror normally cannot fall too far behind. In high-performance (asynchronous) mode, the principal truncates log after its own backups without waiting for the mirror. If the mirror was down long enough that the required log is gone, it must be brought current with a tail-log backup then log restores.
Prerequisites: the principal is healthy, you have a recent full backup, and you can take a log backup of the principal now.
1: On the principal, take a tail-log backup if possible and a current full backup.
2: On the mirror instance, take the mirror database out of the mirroring partnership. This preserves the data but ends the session:
3: Restore the principal's full backup over the mirror database with NORECOVERY, then restore the tail-log backup with NORECOVERY, then any subsequent log backups in order with NORECOVERY. NORECOVERY is required; RESTORE WITH RECOVERY would put the mirror in a standalone state and block rejoin.
4: On the mirror, rejoin the session:
5: On the principal, confirm the pairing:
Expected result: mirroring enters SYNCHRONIZING and then SYNCHRONIZED. Success check: sys.database_mirroring shows matching roles, the mirror is no longer in RESTORING state as its terminal state, and the principal's mirroring_failover_lsn tracks the mirror's. If the mirror throws "The database is not configured for database mirroring," confirm the partnership was set on both sides and the endpoint is reachable.
Cost comparison is worth noting: this path restores from backup, which for a 1 TB database over a 10 Gbps link might take 15–30 minutes of transfer plus restore time, versus hours for a full re-seed on slower links. The tail-log backup is the key that makes the incremental path possible; without it, you fall back to the next section.
Step 3: Re-seed the mirror when the log chain is broken
If the mirror's last LSN is older than the principal's oldest available log record, no amount of RESUME will reconcile them. You must replace the mirror database with a fresh copy.
1: On the principal, take a full backup and one log backup. With high-performance mode, do this during a low-write window if possible to minimize the restore delta. 2: On the mirror, drop or overwrite the mirrored copy: ALTER DATABASE YourDb SET PARTNER OFF; then RESTORE DATABASE YourDb FROM DISK = ... WITH NORECOVERY, REPLACE; and apply the log backup with NORECOVERY. 3: Rejoin as in Step 2. 4: Optionally, if the database is large and your SQL Server version supports it, use automatic seeding (introduced with Always On availability groups in SQL Server 2016; not part of classic mirroring). Classic mirroring does not have a seeding shortcut, so a physical restore is the supported route on that feature.
Realistic timing example: a 500 GB database over a 1 Gbps link with 400 MB/s restore throughput lands around 20–30 minutes of transfer plus restore; the same database over a 100 Mbps branch link can take many hours. This is why "fix the mirror" projects often turn into capacity and network discussions rather than DBA-only problems.
Step 4: Deal with role changes and failed-over partners
After a failover, the former principal becomes the mirror and vice versa. You cannot "resume" from the wrong host. Verify roles with sys.database_mirroring.mirroring_role_desc and issue RESUME from the current principal. A common failure is running RESUME on the old principal, which does nothing while the session stays suspended.
If the witness is offline and you are in high-safety mode with automatic failover configured, the session can still operate but automatic failover is unavailable. Restarting the witness and confirming it can reach both partners restores the failover capability. If the witness requires a reconfiguration, use ALTER DATABASE ... SET WITNESS = 'TCP://WitnessHost:7022' from the principal. Success check: mirroring_witness_state_desc shows CONNECTED on both partners.
Step 5: Verify the fix survived, and set guards against recurrence
A fixed session can silently degrade again. Confirm durability with these checks after 10–15 minutes of normal traffic:
mirroring_state_desc is SYNCHRONIZED (high safety) and remains so under write load. The mirror's redo queue is not growing unbounded; check sys.dm_database_mirroring_redo_queue on the mirror if available. Log truncation on the principal is not being held by the mirror beyond your expectations. Error logs on both instances are clean of partner timeout messages for one monitoring interval.
Then attack the causes rather than the symptoms: monitor for network packet loss and latency between the hosts; alert on mirroring_state_desc leaving SYNCHRONIZED; size the transaction log and the mirror's disk so a re-seed fits; and document the endpoint ports and certificate expiry dates. In classic mirroring, the feature is deprecated in modern SQL Server versions in favor of Always On availability groups, so part of "fixing" a mirrored database long-term is a migration plan; the repair steps above still apply while mirroring remains in use.
Quick-reference comparison of the repair paths
| Symptom | Likely cause | Cheapest first action | Escalation if it fails |
|---|---|---|---|
| SUSPENDED or DISCONNECTED, mirror catches up quickly on RESUME | Network blip, endpoint restart, firewall change | Fix transport, run SET PARTNER RESUME | Verify endpoint and certificates on both sides |
| SUSPENDED, mirror's LSN behind principal's log but within available range | Async lag or brief mirror outage | Tail-log backup, log restore to mirror, rejoin | Full re-seed if log is gone |
| DISCONNECTED with "log too far behind" or resume fails outright | Principal truncated past mirror LSN | Full backup restore to mirror, rejoin | Re-seed during maintenance window |
| Roles look wrong after failover | RESUME issued on wrong host | Query roles, RESUME from current principal | Reconfigure partner endpoints |
| Witness state not CONNECTED | Witness service stopped or unreachable | Restart witness, verify connectivity | Reconfigure witness endpoint |
Use the table as a triage map, not a replacement for the ordered checks; the state descriptors are your ground truth.
Why "just resume it" sometimes makes things worse
A resume on a mirror with a broken log chain either errors or, in some async configurations, leaves the mirror in a state that appears to be synchronizing while diverging. Never skip the LSN comparison because the state says SUSPENDED rather than DISCONNECTED; the labels describe connectivity, not data consistency. The second trap is restoring the mirror with RECOVERY, which makes it a standalone database and prevents rejoin; always finish with NORECOVERY until the partner is set. The third is taking the principal offline "to let the mirror catch up." For classic mirroring, the supported recovery is restore-based, and downtime rarely improves the outcome compared with a tail-log backup plus incremental restore.
What success actually looks like
A fixed mirrored database has three properties at once: matching roles on both partners, a mirror that is applying log (its end-of-log LSN advances), and a session state that stays SYNCHRONIZED under load. If any one is missing, the repair is incomplete. Document the final state with the sys.database_mirroring output, keep the tail-log and full backups used in the repair until the next successful verification cycle, and schedule a follow-up check in 24–48 hours, because mirror failures often recur from the same unaddressed network or certificate cause.