Get-DbaDbFile View Source Stuart Moore (@napalmgram), stuart-moore.com Windows, Linux, macOS Synopsis Retrieves comprehensive database file information including size, growth, I/O statistics, and storage details.
Description Retrieves detailed information about database files (data and log files) from SQL Server instances using direct T-SQL queries for optimal performance. This function provides comprehensive file metadata including current size, used space, growth settings, I/O statistics, and volume free space information that DBAs need for capacity planning, performance analysis, and storage management.
Get-DbaDbFileGroup View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS Synopsis Retrieves filegroup configuration and storage details from SQL Server databases
Description Retrieves detailed filegroup information from one or more databases, including filegroup type, size, and configuration details. This function helps DBAs analyze database storage organization, plan storage capacity, and document database structure for compliance or migration planning. Returns filegroup objects that can be filtered by database or specific filegroup names, making it useful for targeted storage analysis and troubleshooting performance issues related to data distribution.
Get-DbaDbFileGrowth View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Retrieves database file auto-growth settings and maximum size limits
Description Retrieves auto-growth configuration for data and log files across SQL Server databases, including growth type (percentage or fixed MB), growth increment values, and maximum size limits. This function helps DBAs quickly identify databases with problematic growth settings like percentage-based growth on large files, unlimited growth configurations, or insufficient growth increments that could cause performance issues during auto-growth events.
Chrissy LeMaire (@cl), netnerds.net | Andreas Jordan (@JordanOrdix), ordix.de
Get-DbaDbFileMapping View Source Chrissy LeMaire (@cl), netnerds.net , Andreas Jordan (@JordanOrdix), ordix.de Windows, Linux, macOS Synopsis Creates file mapping hashtable from existing database for use in restore operations
Description Extracts the logical-to-physical file name mappings from an existing database and returns them in a hashtable format compatible with Restore-DbaDatabase. This eliminates the need to manually specify file paths when restoring databases to different servers or locations. The function reads both data files and log files from the database’s file groups and creates a complete mapping that preserves the original file structure during restore operations.
Get-DbaDbLogSpace View Source Jess Pomfret, JessPomfret.com Windows, Linux, macOS Synopsis Retrieves transaction log space usage and capacity information from SQL Server databases.
Description Collects detailed transaction log metrics including total size, used space percentage, and used space in bytes for databases across SQL Server instances. Uses the sys.dm_db_log_space_usage DMV on SQL Server 2012+ or DBCC SQLPERF(logspace) on older versions.
Essential for proactive log space monitoring to prevent unexpected transaction log growth, identify databases approaching log capacity limits, and plan log file sizing.
Get-DbaFile View Source Brandon Abshire, netnerds.net Windows, Linux, macOS Synopsis Enumerates files and directories on remote SQL Server instances using xp_dirtree
Description Searches directories on SQL Server machines remotely without requiring direct file system access or RDP connections. Uses the xp_dirtree extended stored procedure to return file listings that can be filtered by extension and searched recursively to specified depths. Defaults to the instance’s data directory but accepts additional paths for comprehensive file system exploration.
Invoke-DbaBalanceDataFiles View Source Sander Stad (@sqlstad), sqlstad.nl Windows, Linux, macOS Synopsis Re-balance data between data files
Description When you have a large database with a single data file and add another file, SQL Server will only use the new file until it’s about the same size.
You may want to balance the data between all the data files.
The function will check the server version and edition to see if the it allows for online index rebuilds.
Move-DbaDbFile View Source Claudio Silva (@claudioessilva), claudioeesilva.eu Windows, Linux, macOS Synopsis Relocates database files to different drives or folders while maintaining database integrity.
Description Relocates database data and log files to new locations on the same SQL Server instance. The function takes the database offline, copies files to the new location, updates the database metadata with ALTER DATABASE commands, and brings the database back online.
This is typically used when you need to move databases to faster storage, free up disk space, or reorganize your file layout without restoring from backup.
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.
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.