1

I'm trying to detach a database and I'm getting this error :

SQL Server detected a logical consistency-based I/O error: incorrect pageid (expected 1:234; actual 0:0).
It occurred during a read of page (1:234) in database ID 5 at offset 0x000000001d4000 in file 'D:\Path\MyDB.mdf'.
Additional messages in the SQL Server error log or system event log may provide more detail.
This is a severe 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: 824)

What is the problem with this database file ? Other DBs are working well, only this one gives me this error.

1
  • Odds favor corruption due to IO hardware problem, could be transient or rare. What was the result of DBCC CHECKDB? What did you find in SQL Server Books Online? Often these kinds of problems require restoring from backup; be prepared to do that if necessary. – Mike Sherrill 'Cat Recall' Feb 15 '11 at 12:31
2

Torn page usually. Do you have backups? DBCC may be able to fix it though

The king of DBCC is Paul Randal: to avoid my copy/paste, read these from him

And search his site too for "logical consistency"

1
  • than you @gbn, I restored my DB by creating it again. – Al0NE Feb 16 '11 at 8:29
0

You're right, this is probably a severe bug in SQL Server. It is not possible to cause corruption using documented and supported T-SQL. To cause corruption you need

hardware problems OS-level file system problems (filter drivers, ...) Undocumented commands like DBCC WRITEPAGE A severe bug Can you single-step through the upgrade script? If not, try tracing it with SQL Profiler. Find the statement that first makes corruption appear.

Here is a simpler, less noisy command:

DBCC CHECKDB([AdventureWorks2012]) WITH NO_INFOMSGS, ALL_ERRORMSGS

You can also read this blog.

1
  • "It is not possible to cause corruption using documented and supported T-SQL" that's a very categorical statement – Stephen Morris - Mo64 Mar 26 at 8:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy