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.
Stephen Bennett, sqlnotesfromtheunderground.wordpress.com
Find-DbaDatabase View Source Stephen Bennett, sqlnotesfromtheunderground.wordpress.com Windows, Linux, macOS Synopsis Searches multiple SQL Server instances for databases matching name, owner, or Service Broker GUID patterns
Description Performs database discovery and inventory across multiple SQL Server instances by searching for databases that match specific criteria. You can search by database name (using regex patterns), database owner, or Service Broker GUID to locate databases across environments.
This is particularly useful for tracking databases across development, test, and production environments, finding databases by ownership for security audits, or identifying databases with matching Service Broker GUIDs.
Find-DbaDbGrowthEvent View Source Aaron Nelson Windows, Linux, macOS Synopsis Retrieves database auto-growth and auto-shrink events from the SQL Server Default Trace
Description Queries the SQL Server Default Trace to identify when database files have automatically grown or shrunk, providing detailed timing and size change information essential for performance troubleshooting and capacity planning. This function helps DBAs investigate unexpected performance slowdowns caused by auto-growth events, analyze storage growth patterns to optimize initial file sizing, and track which applications or processes are triggering unplanned database expansions.
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.
Get-DbaDatabase View Source Garry Bargsley (@gbargsley), blog.garrybargsley.com , Klaas Vandenberghe (@PowerDbaKlaas) , Simone Bizzotto (@niphlod) Windows, Linux, macOS Synopsis Retrieves database objects and metadata from SQL Server instances with advanced filtering and usage analytics.
Description Retrieves detailed database information from one or more SQL Server instances, returning rich database objects instead of basic metadata queries.
This command provides comprehensive filtering options for database status, access type, recovery model, backup history, and encryption status, making it essential for database inventory, compliance auditing, and maintenance planning.
Get-DbaDbAssembly View Source Garry Bargsley (@gbargsley), blog.garrybargsley.com Windows, Linux, macOS Synopsis Retrieves CLR assemblies registered in SQL Server databases for security auditing and inventory management.
Description Retrieves detailed information about Common Language Runtime (CLR) assemblies that have been registered in SQL Server databases. This function helps DBAs audit custom .NET assemblies for security compliance, track assembly versions, and identify potentially unsafe or unauthorized code deployed to their SQL Server instances.
Get-DbaDbCompatibility View Source Garry Bargsley, blog.garrybargsley.com Windows, Linux, macOS Synopsis Retrieves database compatibility levels from SQL Server instances for upgrade planning and compliance auditing.
Description Returns the current compatibility level setting for each database, which determines what SQL Server language features and behaviors are available to that database. This is essential when planning SQL Server upgrades, as databases often retain older compatibility levels even after the instance is upgraded. The function helps identify which databases may need compatibility level updates to take advantage of newer SQL Server features or to maintain vendor application support requirements.
Get-DbaDbCompression View Source Jess Pomfret (@jpomfret), jesspomfret.com Windows, Linux, macOS Synopsis Retrieves compression settings, sizes, and row counts for tables and indexes across SQL Server databases.
Description This function analyzes data compression usage across your SQL Server databases by examining tables, indexes, and their physical partitions. It returns detailed information including current compression type (None, Row, Page, Columnstore), space usage, and row counts for each object. This is essential for compression optimization analysis, identifying candidates for compression to save storage space, and generating compliance reports on compression usage across your database environment.
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.