Thor Logo dbatools

Detach

Dismount-DbaDatabase

Chrissy LeMaire (@cl), netnerds.net

Dismount-DbaDatabase View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Detaches one or more databases from a SQL Server instance with built-in safety checks and validation. Description Safely detaches databases from SQL Server instances while performing comprehensive validation checks before detachment. This function automatically validates that databases aren’t system databases, replicated, or have active snapshots, preventing common detachment failures. When databases are part of mirroring or Availability Groups, the -Force parameter allows automatic cleanup by breaking mirrors and removing databases from AGs before detaching.

Read more

Get-DbaDbDetachedFileInfo

Chrissy LeMaire (@cl), netnerds.net

Get-DbaDbDetachedFileInfo View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Reads detached SQL Server database files to extract metadata and file structure without attaching them. Description Analyzes detached MDF files to retrieve essential database metadata including name, SQL Server version, collation, and complete file structure. This lets you examine database files sitting in storage or archives without the risk of attaching them to a live instance. Perfect for migration planning when you need to verify compatibility before moving databases between SQL Server versions.

Read more