删除 SQL 服务器中的数据库不会删除 .mdf 和 .ldf 文件

Deleting a database in SQL Server does not delete the .mdf and .ldf files

当我在 SSMS 中创建数据库时,我将目标选择为 D: 驱动器。现在当我删除数据库时,删除数据库的.mdf.ldf文件仍然在D:驱动器上。为什么?

这是正常行为吗?我 运行 磁盘 space 不足,我需要删除我未使用的数据库,但 D: 驱动器的磁盘 space 仍然是一个问题,因为文件没有被正确删除。

我是否应该手动删除 .mdf.ldf 文件?

来自文档:

Dropping a database deletes the database from an instance of SQL Server and deletes the physical disk files used by the database. If the database or any one of its files is offline when it is dropped, the disk files are not deleted. These files can be deleted manually by using Windows Explorer. To remove a database from the current server without deleting the files from the file system, use sp_detach_db.

我怀疑数据库已脱机,因此文件未被删除。