Resources

Troubleshooting Techniques for Resolving Suspect Mode Issues

Troubleshooting Techniques for Resolving Suspect Mode Issues

Restore from the last good backup. Microsoft’s own guidance for a database that DBCC CHECKDB reports as corrupt is to restore, and the repair commands below are for the case where no usable backup exists. Before any command that writes to the database, copy the .mdf, .ndf and .ldf files somewhere else, because a repair cannot be undone once it commits.

Decision flow: restore from a healthy backup, or copy the files and repair through emergency mode, single-user mode and DBCC CHECKDB

Why did the database go suspect?

SQL Server marks a database SUSPECT when it starts recovery and cannot finish it. While the state lasts, you cannot connect to the database or run transactions against it.

  • A corrupted transaction log file
  • A restart or crash in the middle of a transaction
  • Not enough disk space or memory for recovery at startup
  • Abrupt shutdown, or power or hardware failure
  • A malicious attack
  • A problem during a transaction or a rollback

Check the SQL Server error log first, since it names the file or page that failed. And check free disk space (a full drive is the cheap cause).

Emergency mode steps

Run these in SQL Server Management Studio from a new query window, as a member of the sysadmin role. In emergency mode the database is read-only, logging is off, and only sysadmins can get in.

  1. Set the state: ALTER DATABASE dbName SET EMERGENCY;
  2. Check the damage without repairing: DBCC CHECKDB ('dbName') WITH NO_INFOMSGS; The last lines name the minimum repair level.
  3. Switch to single-user mode: ALTER DATABASE dbName SET SINGLE_USER WITH ROLLBACK IMMEDIATE; This rolls back open transactions, and every repair option requires single-user mode.
  4. Repair at the level CHECKDB asked for, usually DBCC CHECKDB ('dbName', REPAIR_ALLOW_DATA_LOSS);
  5. Return to normal use: ALTER DATABASE dbName SET MULTI_USER;
YouTube player

If REPAIR_ALLOW_DATA_LOSS succeeds in emergency mode, SQL Server sets the status to ONLINE on its own.

The emergency-mode version of that repair is the special one. It tries log-based recovery, and if the log is corrupt it rebuilds the log, which can cost transactional consistency. Run DBCC CHECKCONSTRAINTS afterwards and take a full backup straight away. The step order is the part people get wrong, since REPAIR_REBUILD repairs index-level problems and does not rebuild a damaged log.

Back up the files first

The MDF, NDF and LDF copies are your only way back from a repair that deallocates the wrong pages. A guide on repairing a corrupt SQL Server database without data loss goes deeper on the file copy side, and a plan from backup strategy basics keeps you from needing any of this twice.

Table of DBCC CHECKDB repair options: REPAIR_REBUILD, REPAIR_FAST and REPAIR_ALLOW_DATA_LOSS and what each one does

Manual repair or repair software

Manual repair costs nothing and keeps you in control. It works on the live files, and it gives up data when it has to. Repair software works on a copy of the damaged MDF and writes the result to a new database, so the original stays untouched. That is the real difference, more than any feature list. It also means you can try more than one approach on the same copy.

OptionWorks onData risk
DBCC CHECKDB repairThe damaged files themselvesPages or rows can be removed
Third-party repair toolA copy of the MDF, output saved separatelyDepends on the tool and the damage

Stellar Repair for MS SQL is one such tool, and the vendor’s SQL database recovery page describes it. Stellar says it supports databases created in SQL Server 2025, 2022, 2019, 2017, 2016, 2014 and earlier, and that the free trial scans and previews objects but needs a purchased license to save repaired data. The flow in its manual is: select the MDF, decide whether to include deleted records, click Repair, review the result, then save to a new or live database and attach it in Management Studio. If you want to read the product page before buying, it is at Stellar Repair for MS SQL.

If a clean backup exists, skip all of it and restore.

Bogdan Sandu

Stay sharp. Ship better code.

Every week: one curated article, one tool worth knowing, one tip you can use tomorrow. No noise, no padding.