How to solve "The operating system returned error 21"

  • Starting point was a power break with open files etc. in windows.

    I really do not know where to start.

     

    TITLE: Microsoft SQL Server Management Studio

    ------------------------------

    Backup failed for Server 'DESKTOP-MB6NMGV\EDVARD'. (Microsoft.SqlServer.SmoExtended)

    For help, click: https://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=16.100.47021.0&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Backup+Server&LinkId=20476

    ------------------------------

    ADDITIONAL INFORMATION:

    An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

    ------------------------------

    The operating system returned error 21(Enheden er ikke klar.) to SQL Server during a read at offset 0x00000001102000 in file 'D:\Program Files\Microsoft SQL Server\MSSQL15.EDVARD\MSSQL\Data\UM_24_7.mdf'. Additional messages in the SQL Server error log and operating system error 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)

    For help, click: https://docs.microsoft.com/sql/relational-databases/errors-events/mssqlserver-823-database-engine-error

    ------------------------------

    BUTTONS:

    OK

    ------------------------------

  • Run a DBCC CHECKDB on the database, and see what it says is broken.

    DBCC CHECKDB (UM_24_7) WITH NO_INFOMSGS, ALL_ERRORMSGS, TABLERESULTS, DATAPURITY, EXTENDED_LOGICAL_CHECKS

    If nothing is returned then the error may be benign, otherwise find what the errors are and repair them.

    Fingers crossed you have good backups for the database.

  • I am quite good with backup's, thanks!

    The problem is a failing harddisk - I get a new one tomorrow.

     

    Best regards

     

    Edvard Korabæk

  • Yes, the windows system event viewer will tell you if there is a hard drive error in addition to the SQL logs.

    I hope you can afford a raid 10 one day!

    If there are no disk errors, DBCC checkdb is your first step.

     

     

     

    DBASupport

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply