sql-server - 尝试删除 SQL Server 数据库时出现错误 21

标签 sql-server

我在外部硬盘驱动器上有一个 SQL Server 数据库。我忘了分离数据库。我不再需要它了,但我无法将其删除或脱机。
当我尝试删除或使数据库脱机时,出现以下错误。

Msg 823, Level 24, State 2, Line 7

The operating system returned error 21(The device is not ready.) to SQL Server during a read at offset 0x00000000012000 in file 'E:\Kenya Air\Monet - Paulus.mdf'. Additional messages in the SQL Server error log and system event 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.


我曾尝试运行 DBCC CHECK,但出现相同的错误。

最佳答案

尝试使数据库脱机然后联机。

Alter database DatabaseName set offline

然后过一会再上线
Alter database DatabaseName set online

关于sql-server - 尝试删除 SQL Server 数据库时出现错误 21,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38542477/

相关文章:

sql-server - 如何在模式匹配中添加破折号

sql-server - SQL Server 2008 中表的 WITH (NOLOCK)

sql-server - SQL 2008 数据类型 - 使用哪些?

sql-server - 暂停 Azure 功能,直到 Entity Framework 进行更改

sql - 打开读取提交快照将如何影响使用 WITH(ROWLOCK、READPAST)的数据队列?

c# - [Win32Exception (0x80004005) : The system cannot find the file specified]

Javascript正则表达式最大小数(7,2)

c# - 在 ASP.NET 中从数据库动态创建 DIV

sql - 处理 SQL 中基于集合的操作