Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 SQL Server 6.5 \ SQL Server 7.0
 Database marked suspect

Author  Topic 

HollyMax
Starting Member

7 Posts

Posted - 2007-02-07 : 04:37:31
can anyone tell me how to run the sp_resetstatus command. It's mentioned everywhere, but I haven't seen anywhere where the starting point is. I'm fairly desperate at this stage to get a problem fixed in a medical database.

HollyMax

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-02-07 : 04:44:20
Here is what our good old friend BOL says:

quote:
Microsoft® SQL Server™ 2000 returns error 1105 and sets the status column of sysdatabases to suspect if SQL Server is unable to complete recovery on a database because the disk drive no longer has any free space. Follow these steps to resolve the problem:

Execute sp_resetstatus.


Use ALTER DATABASE to add a data file or log file to the database.


Stop and restart SQL Server.
With the extra space provided by the new data file or log file, SQL Server should be able to complete recovery of the database.

Free disk space and rerun recovery.
sp_resetstatus turns off the suspect flag on a database, but leaves all other database options intact.



Caution Use sp_resetstatus only when directed by your primary support provider or as recommended in Troubleshooting. Otherwise, you might damage your database.


Because this procedure modifies the system tables, the system administrator must enable updates to the system tables before creating this procedure. To enable updates, use this procedure:

USE master
GO
sp_configure 'allow updates', 1
GO
RECONFIGURE WITH OVERRIDE
GO

After the procedure is created, immediately disable updates to the system tables:

sp_configure 'allow updates', 0
GO
RECONFIGURE WITH OVERRIDE
GO

sp_resetstatus can be executed only by the system administrator. Always shut down SQL Server immediately after executing this procedure.

The syntax is:

sp_resetstatus database_name

This example turns off the suspect flag on the PRODUCTION database.

sp_resetstatus PRODUCTION

Here is the result set:

Database 'PRODUCTION' status reset!
WARNING: You must reboot SQL Server prior to accessing this database!


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-02-07 : 05:20:39
Hi HollyMax, welcome to SQL Team!

You've posted in a "legacy database" forum for SQL 6.5 / 7.0

In case it makes a difference to advise folk give: What version are you using?

Kristen
Go to Top of Page

HollyMax
Starting Member

7 Posts

Posted - 2007-02-07 : 05:24:20
Hello Kirsten it's sql 2000 enterprise that comes with windows 2003 sbs premium.

HollyMax
Go to Top of Page

HollyMax
Starting Member

7 Posts

Posted - 2007-02-07 : 05:27:51
thanks harsh_athalye. seen plenty of these articles. Where exactly do you run this sp_resetstaus command from. I don't do SQL, it's a medical database that their software support apparently don't know how to fix.
If I can't reset the status I will have to restore from a backup and loose any data in between.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-02-07 : 05:54:46
Continued over at http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=78726
Go to Top of Page
   

- Advertisement -