New-DbaDbFileGroup View Source Adam Lancaster, github.com/lancasteradam Windows, Linux, macOS Synopsis Creates new filegroups in SQL Server databases for custom data storage organization.
Description Creates a new filegroup for the specified database(s), supporting standard row data, FileStream, and memory-optimized storage types. This is useful when you need to separate table storage across different disk drives for performance optimization, implement compliance requirements, or organize data by department or function. The filegroup is created empty and requires adding data files with Add-DbaDbFile before it can store data.
New-DbaDirectory View Source Stuart Moore Windows, Linux, macOS Synopsis Creates directories on SQL Server machines using the SQL Server service account
Description Creates directories on local or remote SQL Server machines by executing the xp_create_subdir extended stored procedure. This is particularly useful when you need to create backup directories, log shipping paths, or database file locations where the SQL Server service account needs to have access. The function checks if the path already exists before attempting creation and returns the success status for each operation.
Remove-DbaDbFileGroup View Source Adam Lancaster, github.com/lancasteradam Windows, Linux, macOS Synopsis Removes empty filegroups from SQL Server databases.
Description Removes one or more filegroups from SQL Server databases after validating they contain no data files. This command is useful for cleaning up unused filegroups after moving data to different filegroups or during database reorganization projects. The function performs safety checks to ensure filegroups are empty before removal and provides detailed error messages if removal fails due to dependencies or constraints.
Set-DbaDbFileGroup View Source Adam Lancaster, github.com/lancasteradam Windows, Linux, macOS Synopsis Modifies filegroup properties including default designation, read-only status, and auto-grow behavior.
Description Modifies key properties of database filegroups including setting the default filegroup for new objects, changing read-only status for data archival, and configuring auto-grow behavior across all files in the filegroup. Use this when you need to restructure database storage layout, implement data archival strategies, or optimize file growth patterns.
Set-DbaDbFileGrowth View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Modifies auto-growth settings for database data and log files to use fixed-size increments instead of percentage-based growth.
Description Configures database file auto-growth settings using ALTER DATABASE statements to replace default percentage-based growth with fixed-size increments. This prevents unpredictable growth patterns that can cause performance issues and storage fragmentation as databases grow larger. Defaults to 64MB growth increments, which provides better control over file expansion and reduces the risk of exponential growth that can quickly consume available disk space.
Set-DbaDefaultPath View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Configures the default file paths for new databases and backups on SQL Server instances
Description Modifies the server-level default paths that SQL Server uses when creating new databases or performing backups without specifying explicit locations. This eliminates the need to manually specify file paths for routine database operations and ensures consistent placement of files across your environment.
The function validates that the specified path is accessible to the SQL Server service account before making changes.
Show-DbaInstanceFileSystem View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Displays a GUI tree view for browsing remote SQL Server file systems and returns the selected directory path
Description Similar to the remote file system popup you see when browsing a remote SQL Server in SQL Server Management Studio, this function allows you to traverse the remote SQL Server’s file structure. This replaces the need to manually type or guess directory paths when setting up backup locations, restore operations, or specifying data and log file paths.
Test-DbaDiskAlignment View Source Constantine Kokkinos (@mobileck), constantinekokkinos.com Windows, Linux, macOS Synopsis Tests disk partition alignment to identify I/O performance issues that can impact SQL Server.
Description Tests disk partition alignment by checking if partition starting offsets align properly with common stripe unit sizes (64KB, 128KB, 256KB, 512KB, 1024KB). Misaligned disk partitions can cause significant SQL Server I/O performance degradation, particularly on high-transaction systems.
The function connects to Windows computers via CIM and examines each disk partition’s starting offset.
Test-DbaDiskAllocation View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Validates disk allocation unit sizes against SQL Server best practice recommendations.
Description Examines all NTFS volumes on target servers to verify they are formatted with 64KB allocation units, which is the recommended cluster size for optimal SQL Server performance. When checking a single server, returns a simple true/false result. For multiple servers, returns detailed information including server name, disk details, and compliance status for each volume.
Test-DbaPath View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Tests if files or directories are accessible to the SQL Server service account.
Description Verifies file and directory accessibility from SQL Server’s perspective using the master.dbo.xp_fileexist extended stored procedure. This is essential before backup operations, restore tasks, or any SQL Server process that requires file system access. The function tests from the SQL Server service account’s security context, which may differ from your user account’s permissions.