SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Database marked as suspect - bring online?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Dinky
Starting Member

37 Posts

Posted - 02/18/2008 :  09:28:12  Show Profile  Reply with Quote
We have a SQL Server 2000 database that user has reported that it's been 'marked as suspect'. How to get it back online.

Even though I myself for my machine can connect to that database server and make changes to the database.

I am new to sql server. Please advice.

sodeep
Flowing Fount of Yak Knowledge

USA
7173 Posts

Posted - 02/18/2008 :  09:44:30  Show Profile  Reply with Quote
Try sp_resetstatus but you have to restart the service. Google for sp_resetstatus for correct syntax
Go to Top of Page

sodeep
Flowing Fount of Yak Knowledge

USA
7173 Posts

Posted - 02/18/2008 :  09:46:06  Show Profile  Reply with Quote
EXEC sp_resetstatus 'DBname'
Go to Top of Page

rmiao
Flowing Fount of Yak Knowledge

USA
7266 Posts

Posted - 02/18/2008 :  13:12:29  Show Profile  Reply with Quote
That doesn't make db in working status, have to find out why db is in suspect and fix the problem.
Go to Top of Page

sodeep
Flowing Fount of Yak Knowledge

USA
7173 Posts

Posted - 02/18/2008 :  13:25:04  Show Profile  Reply with Quote
rmaio,Here is from Booksonline.

sp_resetstatus turns off the suspect flag on a database. This procedure updates the mode and status columns of the named database in sys.databases. The SQL Server error log should be consulted and all problems resolved before running this procedure. Stop and restart the instance of SQL Server after you execute sp_resetstatus.

A database can become suspect for several reasons. Possible causes include denial of access to a database resource by the operating system, and the unavailability or corruption of one or more database files.

Go to Top of Page

fsilber
Starting Member

USA
11 Posts

Posted - 02/18/2008 :  15:58:58  Show Profile  Reply with Quote
quote:
Originally posted by rmiao

That doesn't make db in working status, have to find out why db is in suspect and fix the problem.



Where do we learn how to fix the problem?

For example, due to a power outage I have torn pages. I ran DBCC CHECKDB ('my database') WITH ALL_ERRORMSGS, NO_INFOMSGS and it gave me a bunch of cryptic error messages suggesting that some rows had foreign keys that did not exist in the parent table. Most of the error messages were in terms of "object ids". I tried running CHECKDB in EMERGENCY MODE with REPAIR_ALLOW_DATA_LOSS -- though I was able to see the database in QueryAnalyzer it apparently did not delete the offending rows.

Do I need to identify the offending rows by hand? If so, how do I go about doing that?
Go to Top of Page

rmiao
Flowing Fount of Yak Knowledge

USA
7266 Posts

Posted - 02/18/2008 :  20:50:50  Show Profile  Reply with Quote
>> This procedure updates the mode and status columns of the named database in sys.databases.

It's true and that's what it does, but it doesn't fix the db. Period.

>> Where do we learn how to fix the problem?

No single solution. Check sql log and windows event logs to find out what caused db suspect and fix them.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000