A SQL Server database marked SUSPECT can't be opened normally, and the fix depends on one non-negotiable condition: do not detach, drop, or restart-troubleshoot the database until you've preserved a copy of its data and log files. If you have a verified backup and a low tolerance for risk, restoring it is the fastest reliable repair. If the data matters more than uptime, follow the file-preservation and emergency-mode steps below, then validate integrity before returning the database to service.
This guide covers Microsoft SQL Server, where "suspect mode" is a specific, named state. It's a general procedure, not a substitute for vendor support on a production system you can't afford to lose. The behavior described is stable across supported SQL Server versions; exact error text varies, and any file paths, database names, and backup schedules below are placeholders you must adapt.
What "Suspect Mode" Actually Means in SQL Server
When SQL Server restarts, it runs crash recovery on each database: it rolls forward committed transactions from the log and rolls back uncommitted ones. If that process fails badly enough that the database can't be brought online consistently, SQL Server marks it SUSPECT and refuses ordinary access. The database appears in Object Explorer with "(Suspect)" appended, and queries against it fail.
The state is a symptom, not a diagnosis. Common underlying causes include:
Missing or moved files. A data or log file was deleted, renamed, or lives on a drive that didn't come back after a reboot. This is the most common cause in practice, and also the easiest to fix. Storage failure. Bad sectors, a failing disk, or a corrupted file system left pages or log records unreadable. Abrupt shutdown during writes. Power loss or a hard reset can leave the log in a state recovery can't resolve if the storage also lost buffered writes. Corruption in the boot page or allocation structures. Damage to page 9 (the boot page in the primary data file) or to system allocation pages can prevent the database from opening at all. A full or unavailable log drive. If the transaction log can't be accessed during recovery, the database can be flagged suspect.
Why this matters: SUSPECT is not a slow degradation you can wait out. The database will not repair itself on the next restart in most cases, and repeated restarts with damaged files can make recovery harder. Your first moves should be diagnostic and protective, not destructive.
One useful distinction: SUSPECT differs from RECOVERY_PENDING (SQL Server can't get exclusive access yet, often transient) and from a database that is simply OFFLINE or in EMERGENCY mode by administrative choice. Confirm the actual state before acting. Query sys.databases and look at the state_desc column rather than trusting the GUI alone.
Before You Touch Anything: Prerequisites and Safety
Meet these prerequisites before running repair commands.
1: Stop application traffic to the instance if the suspect database serves a live application. Writes and reconnects create noise and can trigger automatic actions you didn't intend. 2: Locate the physical files. Run a query against sys.master_files to get the current physical_name for each file of the suspect database. You need these paths regardless of the repair route. 3: Copy the data (.mdf/.ndf) and log (.ldf) files to separate storage using an OS-level copy while SQL Server is stopped or the database is offline. This is your safety net. A file copy is not a backup in the transactionally consistent sense, but it preserves the raw material for forensic recovery if repair goes wrong. 4: Confirm your backup situation. Find the most recent full backup and the chain of differential and log backups. A restore is almost always safer than in-place repair. 5: Note the recovery model, compatibility level, and any features (replication, mirroring, availability groups, Change Data Capture) attached to the database, because repair interacts with them. 6: Check free disk space on both the data and log drives. Emergency-mode repair can grow the log.
Success check for this phase: you have file paths recorded, an off-box copy of the files, and a clear statement of whether a usable backup exists. If you can't produce that copy, stop and get help before proceeding.
If the database is part of an Availability Group or is replicated, do not run repair independently on a secondary. Remove it from the availability group first or handle it per your topology's documented procedure, because repair can break the synchronization contract.
Step 1: Rule Out the Cheap Causes First
Start with reversible checks before any repair.
Check that the files exist and are accessible. Compare the physical_name values from sys.master_files against the actual file system. If a file was moved during storage maintenance, the database will be suspect even though the data is intact.
If a file was moved, point SQL Server at the new location. Take the database offline, use ALTER DATABASE ... MODIFY FILE (NAME = logical_name, FILENAME = 'new_path'), then bring it back online. If the database refuses to go offline because it's suspect, you can set it OFFLINE with ALTER DATABASE ... SET OFFLINE WITH ROLLBACK IMMEDIATE and then modify the file path. Expect an error if permissions are wrong; check that the SQL Server service account can read and write the new location.
Check the SQL Server error log for the specific messages around the moment the database went suspect. Errors about operating system access, torn pages, or log corruption tell you which route to take. A missing-file message points to the path fix; a page checksum error points toward corruption repair.
Check disk health with the storage vendor's tools. Repairing a database on a failing disk is wasted work.
Success check: if the cause was a moved or missing file and the path fix works, the database comes online cleanly, and you're done. If it stays suspect or refuses to come online, continue.
Step 2: Try a Clean Restart and an Explicit Online Attempt
A limited number of suspect states clear when SQL Server gets a clean recovery attempt, especially if the original trigger was a transient storage or access problem.
1: Fix any confirmed storage or permission issue. 2: Restart the SQL Server service (or the instance) once. 3: Attempt ALTER DATABASE [YourDb] SET ONLINE. 4: Check sys.databases.state_desc again.
If the database returns to ONLINE, immediately run a consistency check (covered below) before letting applications use it. Don't assume the problem is gone just because the state changed.
Don't loop this step. One or two clean attempts after fixing a confirmed cause is reasonable; repeatedly forcing a damaged database online risks making recovery harder.
Step 3: Set the Database to EMERGENCY Mode
If the database is still suspect, the standard next move is EMERGENCY mode, which lets a sysadmin read from the database even though it's marked suspect. This is the step that turns "can't touch it" into "can inspect it."
Consider SINGLE_USER alongside it if you need exclusive access while you work:
What to expect: the database state changes to EMERGENCY, read access is available to members of the sysadmin role, and the log is not rebuilt at this point. The database remains read-only for practical purposes; writes are blocked.
Success check: SELECT state_desc FROM sys.databases WHERE name = 'YourDb' returns EMERGENCY, and DBCC CHECKDB can connect to the database.
Caveat: EMERGENCY mode is not a repair. It's an access mode that buys you the ability to run diagnostics and export data. Don't leave a production database in EMERGENCY mode longer than the repair window, and don't treat "it's readable" as "it's fixed."
Step 4: Decide Between Data Export and In-Place Repair
With the database in EMERGENCY mode, you have two broad routes, and the choice is a genuine trade-off rather than a matter of preference.
Export route. Read data out of the emergency-mode database and load it into a new, clean database. This preserves the rows you can read, avoids trusting corrupt structures, and gives you a database with a fresh, healthy file layout. The cost is time, scripting, and the fact that objects like indexes, constraints, triggers, and permissions must be recreated from scripts you may not have. If the corruption is widespread, some rows may be unreadable and export will fail on those tables.
In-place repair route. Run DBCC CHECKDB with a repair option to fix the corruption where it is. This keeps the database and its objects intact and is far faster when the damage is limited. The cost is risk: repair can delete data it can't recover, and it can leave the database structurally odd in ways that cause problems later. It also requires the database to be in single-user mode.
My recommendation for a database whose data you can't reproduce: export the readable data first, then attempt in-place repair on a copy if you want to try to salvage more. For a database with a recent, verified backup, skip both and restore. Restoring is the smallest risk available, and in-place repair should be a last resort, not a first instinct.
Step 5: Run DBCC CHECKDB to Diagnose
Whether you export or repair, get a diagnostic read first. With the database in EMERGENCY and single-user mode:
Reading the output matters more than running the command. Look for:
The minimum repair level suggested. The output typically names repair_allow_data_loss or repair_rebuild. That suggestion is a floor, not a mandate. repair_rebuild only rebuilds indexes and is the safest option; repair_allow_data_loss can remove rows and pages. Which allocation structures and pages are affected. Corruption confined to a nonclustered index is usually repairable by rebuilding that index. Corruption in a clustered index or heap affects the table's data directly and is much more serious. Messages about consistency errors in system tables. Corruption in the system catalog is a different category and often means the database is beyond practical in-place repair.
If the output shows errors only in indexes, you have a reasonable repair path. If it shows widespread data-page errors or catalog errors, weigh export more heavily.
CHECKDB on a large database takes time and can consume substantial tempdb and log space. Budget for both, and run it during a window where you can let it finish.
Step 6: Repair With the Minimum Necessary Option
When you've decided to repair in place, use the least aggressive option that addresses the reported errors.
If the errors require data loss repair and you've accepted that (after exporting what you can), the option is:
Understand what REPAIR_ALLOW_DATA_LOSS does before running it. It can deallocate pages it can't repair, which means the rows on those pages are gone. It does not report every row it removes in a convenient list. There's no undo. This is why the file copy and the export come first.
A safer variant for targeted problems: if CHECKDB identifies a specific corrupt nonclustered index, rebuild just that index rather than repairing the whole database. Similarly, if a single table's data pages are damaged but CHECKDB reports the rest is clean, you can sometimes drop and recreate the affected object from a known-good source.
After repair, the database should be set back to multi-user:
Success check: rerun DBCC CHECKDB and confirm it completes with no consistency errors. A repair that "works" but leaves CHECKDB reporting errors isn't finished. Document what repair removed so downstream consumers know data may be missing.
Step 7: Recover Data When Repair Isn't Enough
If repair fails, or if CHECKDB reports catalog damage, your options narrow.
Export from EMERGENCY mode. Use SELECT ... INTO or a client tool to copy readable tables into a new database. Script out schema objects separately. Expect failures on the damaged tables; isolate them and export around them.
DBCC CHECKTABLE per table to identify salvageable tables, then export those.
Third-party recovery tools exist for severe corruption, and they can sometimes extract data from files SQL Server won't open. Evaluate them against a copy of the files, never the originals, and understand that results vary. Don't assume a tool will recover everything.
Restore from backup if the export route is incomplete and you have a backup older than the corruption. You'll lose the transactions since that backup, but you'll get a structurally clean database. Consider restoring the backup with WITH NORECOVERY and applying log backups if the log chain is intact, and consider a point-in-time restore if the corruption has a known timestamp.
The stop condition here is real: if the data is business-critical, the corruption is in the system catalog or clustered structures, and your backups are missing or unverified, stop improvising. Engage Microsoft support or a specialist recovery vendor with a copy of the files. Continued in-place repair attempts on a database you can't replace can turn a recoverable situation into an unrecoverable one.
Step 8: Validate and Prevent a Repeat
Getting the database online isn't the finish line. Before handing it back:
1: Run DBCC CHECKDB to completion with no errors. 2: Run DBCC CHECKALLOC and DBCC CHECKTABLE on the largest, most critical tables if the full check is clean but you want targeted confidence. 3: Spot-check row counts against pre-incident baselines where you have them. 4: Test application logins and key queries. 5: Confirm backups run successfully and take a fresh full backup immediately.
For prevention, the highest-value changes are unglamorous:
Verify backups by restoring them. A backup that has never been restored is a hypothesis, not a safety net. Schedule restore tests. Run regular consistency checks during low-traffic windows so corruption is found before it becomes suspect mode. Fix storage problems before they cascade. Monitor disk health and error logs. Keep data and log files on reliable, separate volumes and confirm they survive reboots. Document file locations so a moved-file suspect state is a five-minute fix rather than an outage.
The pattern to internalize: suspect mode is usually a storage or file-path problem wearing a database costume. Check the boring causes first, preserve the files, prefer restore over repair, and treat in-place repair as the tool of last resort for data you can't otherwise recover.
Frequently Asked Questions
Can a suspect database repair itself after a restart?
Rarely, and only when the cause was transient access to otherwise intact files. In most cases the database stays suspect until you intervene. A single clean restart after fixing a confirmed file or permission issue is reasonable; repeated forced restarts are not.
Does REPAIR_ALLOW_DATA_LOSS always delete data?
No. It only removes structures it cannot repair, so a database with minor corruption may lose nothing. The name is a warning about the capability, not a guarantee of loss. You can't know in advance how much will be removed, which is why exporting readable data first is the prudent move.
Is it safe to detach a suspect database?
Detaching a suspect database is risky and generally not recommended as a first step. It removes the database from the instance's metadata without fixing anything, and reattaching a damaged database can fail or worsen the state. Work with EMERGENCY mode and file copies instead.
How long should repair take?
It depends on database size, the number and location of corrupt pages, and storage speed. Small databases can finish in minutes; multi-terabyte databases can take hours. CHECKDB runtime scales with database size, and repair with data loss can add substantial time. Plan a window rather than assuming a quick fix.