How do I repair a "suspect" SQL 2005 database

1 replies
I have a SQl 2005 Server that had a fan problem and went into continuous reboot for a time. I have replaced the fan, but now when I bring it up and start SQL services I have a few databases marked as suspect. I am not a DB person, and our DB person is out of office for a few weeks. How do I repair these DB's so I can get this running again.

Thanks.
#2005 #database #repair #sql #suspect
  • Profile picture of the author Barrykiks4
    The first thing I would do is gracefully stop your SQL Server services -- Then make a copy of all the ldf/mdf files on the server. Also find the location of the backup files -- they should be name something like MyDBname_backup_200907220000.bak and rename the extension to something like .hold. That way they aren't wiped out by a maint plan if you have to go to restore.

    After that -- only bring back the SQL Server Service -- and not the Server Agent.

    Check if the database(s) are still marked suspect. If they are

    ALTER DATABASE [MyDBName]
    SET EMERGENCY
    GO
    EXEC sp_resetstatus 'your_db_name';
    GO
    DBCC DBRECOVER ('your_db_name')
    GO
    ALTER DATABASE [MyDBName]
    SET ONLINE
    GO

    If that doesn't work -- please post back and we can see what else we can do.

    For more information about "sp_resetstatus" go to:
    http://community.office365.com/en-us.../t/255789.aspx

    ALTER DATABASE SET Options (Transact-SQL)
    SQL Server Repair Toolbox -https://www.sqlserverrepairtoolbox.com/
    {{ DiscussionBoard.errors[10413612].message }}

Trending Topics