SQLTeam.com | Weblogs | Forums

Database trouble in sql server


#1

I have .mdf on SQL Server 2008 R2, I work in it almost every day. Today my database hasn't opened without any reason. I appealed to help to my friend-programmer, but he said, that which problem can't be solved by usual methods.


#2

How are you "opening" the database?

As a first step I would try checking database consistency on that database

DBCC CHECKDB (YourDatabaseName) 
    WITH NO_INFOMSGS, EXTENDED_LOGICAL_CHECKS, DATA_PURITY	-- , ALL_ERRORMSGS 

If there are errors comment IN the ALL_ERRORMSGS parameter and post the error messages here.

If there are any errors you need to plan to Find & Fix the problem, otherwise it will occur again. Database corruption is most frequently caused by hardware fault - e.g. memory, disk or disk-controller.

if you are in a hurry to have this solved then restore from your last good backup (and run the CHECKDB on that to prove that that backup was "good").


#3

The first thing to do is to look into the main SQL error log. There should be messages there with more details about the problem.


#5

There are multiple reasons why this could happen.
Either a restart of the SQL Server (which is not the case), something in the log was not properly processed, or a real failure in the database (logical or physical corruption) of data. I would say run that command, and look in the Event Viewer for logs coming from MSSQLSERVER source.