datetime century date into pad dynamic cursor money percent sp job isnumeric isdate over update
SQLUSA.com
SQL 2008 GRAND SLAM ON 49 CD
FREE TRIAL  CLICK HERE TO ORDER  SEARCH
SQL Server Training SQL 2005 Scripts SQL 2008 Articles
SQL JOBS News Format Developer
How to recover a database marked suspect?

A SQL Server database can become marked suspect for several reasons, therefore regular database backup is mandatory. Possible causes include:

1. Denial of access to a database resource by the operating system

2. Anti-virus/3rd party software blocking access

3. The hardware/network issue or corruption of database file(s)

Prior to resetting the status, the database file issue should be resolved. First check error logs and Event Viewer for related messages. If logs offer no help, then one way of resolution: create an empty database, copy over the damaged database files and restart the server. The (copied over) database may come up in the suspect mode.

The recovery methods below are last resort only. At minimum the server should be rebooted (Windows restart - hardboot), if possible at all, a database copy should be created. If backup files exist, point-in-time recovery is preferred to emergency repair.

The following script resets the status of the database and checks the database for integrity.

-- Check suspect state (status) of all databases

SELECT DBName=NAME, [Status]=state_desc

FROM master.sys.databases

WHERE state_desc='SUSPECT'
------------                      

-- SQL Server 2000/2005/2008 - Recover database suspect sql server

USE master;

GO

 

EXEC sp_resetstatus 'CopyOfAdventureWorks2008';

GO

USE CopyOfAdventureWorks2008;

 

DBCC CHECKDB WITH NO_INFOMSGS;

GO

 

The latest database marked suspect recovery process:

 

-- SQL Server 2005/2008

-- Recover database marked suspect sql serve

USE master;

GO

ALTER DATABASE CopyOfAdventureWorks2008 SET EMERGENCY

GO

ALTER DATABASE CopyOfAdventureWorks2008 SET SINGLE_USER

GO

DBCC CHECKDB (CopyOfAdventureWorks2008, REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS;

GO

 

USE CopyOfAdventureWorks2008;

 

DBCC CHECKDB WITH NO_INFOMSGS;

GO

In both cases save as much data as possible into a clean database. Perform troubleshooting to locate the problem source.

Related articles:

Missing device causes database to be marked suspect

FIX: A database is marked suspect when you open the database in SQL Server 2000 View products

Recommended actions for corrupt or suspect databases

 

Order SQL 2008 GRAND SLAM Today!
SQLUSA.com Home Page
SQL Server Training at www.sqlusa.com.
SQL Server 2008 Video Training at www.sqlusa.com.
SQL Server 2005 Training Videos at www.sqlusa.com.
Microsoft SQL Server 2000 Training Videos at www.sqlusa.com.
TOP PAY JOBS SEARCH PAGES
SQL DEVELOPER BUSINESS INTELLIGENCE SSRS SSIS SSAS OLAP
MICROSOFT ORACLE COGNOS SAP IBM GOOGLE FACEBOOK
HEALTHCARE OFFICE WEB SUPPORT COMPUTER FINANCE MEDIA
NURSE HOSPITAL THERAPIST PHYSICIAN PHARMACIST MEDICAL DRIVER
SALES MARKETING HOLLYWOOD MUSIC VIDEO SOCIAL MEDIA SOFTWARE
MBA AD-PR BIOTECH EDUCATION HR TRAVEL FOOD TECHNOLOGY
FEDERAL GOVERNMENT OFFSHORE GREEN CARD N DAKOTA COLLEGE SCHOOL REP
WORK-AT-HOME TELECOMMUTE OPENINGS HIRING MEDICAL-BILLING NURSING PART

FREE SS SQL / BI OLAP Short Videos on YOUTUBE.com

Microsoft Community Contributor 2011 Microsoft Community Contributor 2012

Search SQLUSA FREE SQL Server Articles & FREE T-SQL Scripts

JOIN US ON TWITTER

Copyright 2005-2012, SMI Corp. All Rights Reserved.

SQL Server 2012 is a program product of Microsoft Corporation.
SQL Server 2008 is a program product of Microsoft Corporation.
SQL Server 2005 is a program product of Microsoft Corporation.
SQL Server 2000 is a program product of Microsoft Corporation.