Thursday, September 13, 2012

Database 'msdb' cannot be opened


Database 'msdb' cannot be opened
 


Sql Server 2008 retrieve this Error when opened
 
"Database 'msdb' cannot be opened. It has been marked SUSPECT by recovery. See the SQL Server errorlog for more information. (Microsoft SQL Server, Error: 926)"






I found 2 solution to solve it

Loggin with 'Sa' account

1st Slolution - (Not Worked With me)




 
1- open new Query

2 - Typing

2.1 EXEC sp_resetstatus 'DB_Name';
Details :(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. Also note that only logins having sysadmin priveleges can perform this )
 

2.2 ALTER DATABASE DB_Name SET EMERGENCY
Details :(Once the database is set to EMERGENCY mode it becomes a READ_ONLYcopy and only members of sysadmin fixed server roles have privileges to access it. )


2.3 DBCC checkdb('DB_Name')
Details :(Check the integrity among all the objects)

 

2.4 ALTER DATABASE DB_Name SET SINGLE_USER WITH ROLLBACK IMMEDIATE
 Details :(Set the database to single user mode)


2.5 DBCC CheckDB ('DB_Name', REPAIR_ALLOW_DATA_LOSS)
Details :(Repair the errors)2.6 ALTER DATABASE DB_Name SET MULTI_USER
Details :(Set the database to multi user mode, so that it can now be accessed by others) 

 
2nd Solution  (Worked with me)


1- open sql server Managment Studio
2- in  object Explorer --> the opened connection item --> rightclick --> Stop


2- open  Control Panel -->Administrative Tools-->Services
 
3- in Sql Server (MSSQLSERVER) item --> right click --> Stop

 

4- Open C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA

5- Move MSDBData.mdf & MSDBlog.ldf to any other place



6- then Copy this Files Agin from New Place and put it in older Place

 C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA

7-  in opened connection in object Explorer --> rightclick --> Start

 


 8- then Refresh DataBase .

9- then you can Detach the MSDB File



3 comments:

  1. Thank you. it solved my problem too.

    Thanks
    Kapil
    kapsiii.kaps@gmail.com

    ReplyDelete
  2. Thanks a lot Ellis, it's very helpful

    ReplyDelete
  3. I too faced the same situation but thanks to solution using whcih I was able to resolved the issue. Ypu can too. Go through:-http://en.mssqldatabaserepair.org/

    ReplyDelete