perkins

Sql database flagged as suspect

5 posts in this topic

We run SQL on a Win2K server. The database for an OOB product began to be flagged as 'suspect' a few days ago. The first couple of times we were able to stop/start MSSQL and the database would come back up. Today it wouldn't. In an attempt to repair the problem, I detatched the db. When I attempt to re-attach, I was getting the following message 

error 5101: Device activation error. The physical file name 'C:\%path to db%\db_log.LDF ' may be incorrect. Then I get db Attach failed.

I resolved this by creating a new DB of the same name, stopping SQL and replacing the MDF with the corrupt file. I'm now back to 'suspect' on the DB in Enterprise Manager.

When I run DBCC CHECKDB ('dbname', REPAIR_REBUILD) I get the response below:

Server: Msg 945, Level 14, State 2, Line 1
Database 'dbname' cannot be opened due to inaccessible files or insufficient memory or disk space.  See the SQL Server errorlog for details.

Any ideas?

1 person likes this

Share this post


Link to post
Share on other sites



If you have no reliable backups, I would create a new database and start copying tables and any other objects as fast as you can, before it dies permanently. If the data is inaccessible  then can try the tool SQL Server Recovery Toolbox. It is possible you will be able to help. http://www.oemailrecovery.com/sql_repair.html


Also try this. This probably won't work, but it forces the suspect flag off.
You will first need to turn on update for systables. So run his

                   USE Master
                   Go
                   EXEC sp_configure 'allow updates' , 1
                   Go
                   Reconfigure
                   Go

Then run the following code:

                   update sysdatabases
                   set status = status & ~256
                   where name = 'MySuspectDatabase'


If that doesn't fix it.  You will want to start copying all
the objects to a new db as ACPerkins has suggested.  You will
want to place the db in emergency mode. First so run this:

                   update sysdatabases
                   set status = status | -32768
                   where name = 'MioSuspectDatabase'

Then use dts, Select into's and whatever else to get the objects from
the suspect DB to a new one.  Dont forget to undo the allow updates option:

                   EXEC sp_configure 'allow updates' , 1
                   Go
                   Reconfigure
                   Go

1 person likes this

Share this post


Link to post
Share on other sites

Thank you all for your advice! The issue has been resolved.
 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now