Thor Logo dbatools

FileGroup

New-DbaDbFileGroup

Adam Lancaster, github.com/lancasteradam

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.

Read more

Remove-DbaDbFileGroup

Adam Lancaster, github.com/lancasteradam

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.

Read more