SQL Server:如何解決作業系統在檔案中位移,執行讀取期間傳回錯誤21(裝置未就緒)?

Winnie Lin 0 Reputation points
2023-03-24T02:05:02.7666667+00:00

在呼叫資料表及讀取資料庫屬性時顯示以下錯誤:

作業系統在檔案 '資料庫名稱.mdf' 中位移 0x00000000318000 執行 讀取 期間,傳回錯誤 21(裝置未就緒。)

檢查過硬碟、磁碟了,另外也有嘗試執行DBCC CHECKBOX命令,但要執行單一使用者模式時也會出現上述錯誤訊息。

我的作業系統為win10

1678841493177

333

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
11,448 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,631 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Seeya Xi-MSFT 16,461 Reputation points
    2023-03-24T07:15:30.8966667+00:00

    Hi @Winnie Lin,

    This is an English forum. In order for other members to be able to search for similar questions, it is recommended that you use English.

    檢查過硬碟、磁碟了,另外也有嘗試執行DBCC CHECKBOX命令,但要執行單一使用者模式時也會出現上述錯誤訊息。

    That should be a corrupted data file issue. Have you run DBCC CHECKDB?

    You can try to fix this error by checking the disk for errors and repairing them. You can also try to restore the database from a backup. Restoring backup files is always the best practice.

    If you don't have backup files, you may need to use the DBCC CHECKDB repair_allow_data_loss option for maximum data repair. Of course, this is not a recommended practice. Again, Restoring backup files is always the best practice.

    Best regards,

    Seeya


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.