I am getting this error when trying to connect the database engine (Sql Server 2008) using SSMS. any ideas to solve this problem? Thanks!
TITLE: Connect to Server
Cannot connect to "ServerName".
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
The operating system returned error 21(The device is not ready.) to SQL Server during a read at offset 0x00000000238000 in file 'E:\Databases\MSSQL10.MSSQLSERVER\MSSQL\DATA\master.mdf'. Additional messages in the SQL Server error log and system event log may provide more detail. This is a severe system-level error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online. (Microsoft SQL Server, Error: 823)
As the error message says, it sounds like master is not OK. You need to run a DBCC CHECKDB on master (run it on all of your databases to be sure). If you're lucky, it's a minor issue, or a problem with your I/O subsystem that is presenting itself as database corruption.
As CHECKDB author Paul Randal says, 99% of CHECKDB issues are caused by problems with your I/O subsystem, so making sure that you diagnose and solve the I/O subsystem issues should be your #1 priority right now.
For more info...
Look through your event log. It's basically saying
'I was half way through reading the data for the master database when the disk decided to tell me that it wasn't ready'.
This 'severe system-level error condition' bit isn't joking.
It's pretty likely though that you will see something in the error log at that time that tells you why that drive isn't being reliable.
answered Oct 26, 2009 at 11:22 AM
Matt Whitfield ♦♦