Thor Logo dbatools

DatabaseFile

Find-DbaOrphanedFile

Sander Stad (@sqlstad), sqlstad.nl

Find-DbaOrphanedFile View Source Sander Stad (@sqlstad), sqlstad.nl Windows, Linux, macOS Synopsis Identifies database files on disk that are not attached to any SQL Server database instance Description Scans filesystem directories for database files (.mdf, .ldf, .ndf) that exist on disk but are not currently attached to the SQL Server instance. This is essential for cleanup operations after database drops, detaches, or failed restores that leave behind orphaned files consuming disk space.

Read more