.NET Daily

How To Solve: SQL Server detected a logical consistency-based I/O error: invalid protection option.

Introduction

Darius

Darius

Darius Dumitrescu is a creative Senior CMS Consultant with in depth .NET knowledge, focused on Web Development and Architecture Design.


LATEST POSTS

How to Deliver Accurate Project Status Reports 21st April, 2018

JIRA Workflow for Web Development Example: Simple and Effective 17th April, 2018

SQL

How To Solve: SQL Server detected a logical consistency-based I/O error: invalid protection option.

Posted on .

If you happen to receive the logical consistency-based I/O error, then your database probably ended up in an unusable state.
SQL Server provide some options to repair it but it does that with the risk of potentially losing data.
The syntax that I used to repair it is the following:

ALTER DATABASE MyBrokenDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
BEGIN TRANSACTION;
DBCC CHECKDB ('MyBrokenDB ', REPAIR_ALLOW_DATA_LOSS);
ALTER DATABASE MyBrokenDB SET MULTI_USER;

In my particular case, it worked without breaking anything.
By the way, try to execute the entire script block at once. I tried first the DBCC CHECKDB statement but then I got some back and forth exceptions about MULTI_USER/SINGLE_USER modes.
You can read more about the DBCC CHECKDB options here.

Darius

Darius

Darius Dumitrescu is a creative Senior CMS Consultant with in depth .NET knowledge, focused on Web Development and Architecture Design.

There are no comments.

View Comments (0) ...
Navigation

Privacy Preference Center