Error 822

Troubleshooting SQL Server

Troubleshooting

Error 822

Severity Level 21
Message Text

Could not start I/O for request %S_BLKIOPTR.

Explanation

Microsoft® SQL Server™ encountered an error while attempting to initiate a read or write request. This error can occur for any of the following reasons:

  • A database file is off-line.

  • A database file has been removed or renamed.

  • A database file is inaccessible for another reason (such as insufficient permissions).

The parameter in the error message refers to an internal structure and does not help determine which database file is involved. However, other error messages appearing in the error log just before error 822 usually indicate the file involved.

Action

Examine the availability and condition of the file involved using your standard operating-system procedures, and make sure the file is accessible.

Because error 822 marks the database as suspect, SQL Server cannot recover the database upon restarting. If you know that the database was marked suspect because the file was unavailable, you can reset the status of the database to allow recovery to continue.

Caution  Do not use these procedures if there are other errors in the error log, near the error 822 message, that suggest that the database might have been marked suspect for some other reason.

Reset the suspect status by executing sp_resetstatus. This is the safest method. After you execute sp_resetstatus, restart SQL Server.

Here are two examples of error 822 and the associated messages from the log. Examining the error messages that occurred just before error 822 usually helps determine the type of problem.

Device missing

In this example, the device C:\Mssql7\data\mydb_data.mdf did not exist when SQL Server started, causing access to the device to fail:

kernel   udopen: Operating system error 2(The system cannot find the file specified.) during the creation/opening of physical device C:\MSSQL7\data\mydb_Data.MDF.
kernel   FCB::Open failed: Could not open device C:\MSSQL7\data\mydb_Data.MDF for virtual device number (VDN) 1.
spid9    Device activation error. The physical file name 'C:\MSSQL7\data\mydb_Data.MDF' may be incorrect.

To correct an error like this, be sure that the virtual device appearing in the error message exists, and correct whatever error prevented SQL Server from finding it. For example, it might have been renamed or moved while SQL Server was not running.

If the virtual device no longer exists, you must restore from known clean backups. Merely creating an empty device with the correct name will not solve this problem.

Permission problems

Permission problems can occur if the device is on an NTFS partition.

In this example, the permissions on C:\Mssql7\Data\Mydb_DATA.Mdf were incorrect, so SQL Server could not access it:

kernel   udopen: Operating system error 2(The system cannot find the file specified.) during the creation/opening of physical device C:\MSSQL7\data\mydb_Data.MDF.
kernel: dopen: open "c:\mssql7\data\mydb_data.mdf", Permission denied
kernel   FCB::Open failed: Could not open device C:\MSSQL7\data\mydb_Data.MDF for virtual device number (VDN) 1.
spid9    Device activation error. The physical file name 'C:\MSSQL7\data\mydb_Data.MDF' may be incorrect.

To correct an error like this, change the object ownership for the device to Administrator, and be sure that the account under which SQL Server was started has read and write permissions on the object.

See Also

BEGIN TRANSACTION

CHECKPOINT

Errors 1 - 999

RECONFIGURE

Resetting the Suspect Status

Setting Configuration Options

Setting Database Options

SHUTDOWN

sp_configure

sp_dboption

UPDATE