Search This Blog

Wednesday, April 21, 2010

Rebuild Log in SQL 2005 - DBCC REBUILD_LOG SQL Server detected a logical consistency-based I/O error

How do I rebuild log in SQL 2005

Error: 824, Severity: 24, State: 2
SQL Server detected a logical consistency-based I/O error: incorrect checksum (expected: 0xb28f8c1a; actual: 0xb37b1a45). It occurred during a read of page (2:0) in database ID 5 at offset 0000000000000000 in file 'D:\Log\TestRebuildLog.ldf'


Rebuild log should be the last option to use(not as first option) in case of log corruption provided we have tried all other recovery or corruption fix options before using this option. But however the same doesnt work in SQL 2005 or higher.

DBCC REBUILD_LOG gives a error message as

Msg 2526, Level 16, State 3, Line 1Incorrect DBCC statement.
Check the documentation for the correct DBCC syntax and options.

So the command to use would be as follows:
Command:
ALTER DATABASE TestRebuildLog REBUILD LOG ON (NAME=TestRebuildLog_Log,FILENAME='D:\Data\TestRebuildLog_Log.ldf')

6 comments:

m4g said...

u_r_da_best

ethiopia22 said...

you're my SQL savior man!!! thanks!

Roger Bremer said...

Hi, Ganesh...

This was the perfect answer! After three days of research, I'm glad to have found your article!

You rock!

--Rog--

Anonymous said...

You save my life broh, your'e my hero thanks

Mobe1969 said...

Utter legend! I knew how to do it in 2000 but had my first 2005+ DB I needed to do it on and the old way didn't work. This is so much easier than 2000!

Anonymous said...

I have searched many days and nothing worked until i stumbled on your article.
Thanks so so much.