Geeks With Blogs

News My Blog has been MOVED to https://mfreidge.wordpress.com

Michael Freidgeim's OLD Blog My Blog has been MOVED to https://mfreidge.wordpress.com

Below are a few links, that can help, if you need  Restore SQL Server Database from suspect

MyITforum.com : How to recover user databases from a “Suspectstatus(

 
You could also try detaching the DB, then do a single file attach only using
the db, dropping the log file. That solved the suspect issue for one of
our DBs. Somewhere in the SQL message logs it indicated that the LOG file
was corrupted
 
 

Here is the MSSQL command needed to attach an .mdf SQL database file with no .ldf file, enjoy!

sp_attach_single_file_db @dbname= 'databasename', @physname= 'C:\Users\Blake\Documents\Databases\databasefile.mdf'

 

Server: Msg 823, Level 24, State 6, Line 1

I/O error 2(The system cannot find the file specified.) detected during read at offset 0000000000000000 in file 'D:\OnePointDB\OnePointLog1.log'.

 
 
 
Run sp_resetstatus with the @dbname parameter. (ie : sp_resetstatus @dbname = "pubs")
 
 
USE Master
GO

-- Determine the original database status
SELECT [Name], DBID, Status
FROM master.dbo.sysdatabases
GO

-- Enable system changes
sp_configure 'allow updates',1
GO
RECONFIGURE WITH OVERRIDE
GO

-- Update the database status
UPDATE master.dbo.sysdatabases
SET Status = 24
WHERE [Name] = 'YourDatabaseName'
GO

-- Disable system changes
sp_configure 'allow updates',0
GO
RECONFIGURE WITH OVERRIDE
GO

-- Determine the final database status
SELECT [Name], DBID, Status
FROM master.dbo.sysdatabases
GO
 
 
Posted on Thursday, May 12, 2011 6:41 AM SQL Server | Back to top


Comments on this post: Restore SQL Server Database from suspect

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Michael Freidgeim | Powered by: GeeksWithBlogs.net