Expand-DbaDbLogFile View Source Claudio Silva (@ClaudioESSilva) Windows, Linux, macOS Synopsis Grows transaction log files using calculated increment sizes to prevent excessive Virtual Log File (VLF) fragmentation.
Description This function intelligently grows transaction log files to target sizes while minimizing Virtual Log File (VLF) fragmentation. It calculates optimal increment sizes based on your SQL Server version and target log size, then grows the log in controlled chunks instead of letting autogrowth create excessive VLFs.
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-DbaDefaultPath View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Retrieves default file paths for SQL Server data, log, backup, and error log directories
Description Retrieves the default directory paths that SQL Server uses for new database files, transaction logs, backups, and error logs. This information is essential for capacity planning, automated database provisioning, and understanding where SQL Server will place files when no explicit path is specified. The function uses multiple fallback methods to determine these paths, including server properties, system queries, and examining existing system databases when standard properties are unavailable.
Chrissy LeMaire (@cl), netnerds.net | Jakob Bindslet
Get-DbaDiskSpace View Source Chrissy LeMaire (@cl), netnerds.net , Jakob Bindslet Windows, Linux, macOS Synopsis Retrieves disk space and filesystem details from SQL Server host systems for capacity monitoring and performance analysis.
Description Queries Windows disk volumes on SQL Server systems using WMI to gather critical storage information for database administration. Returns comprehensive disk details including capacity, free space, filesystem type, and optional fragmentation analysis.
Essential for SQL Server capacity planning, this function helps DBAs monitor disk space before growth limits impact database operations.
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.
Measure-DbaDiskSpaceRequirement View Source Pollus Brodeur (@pollusb) Windows, Linux, macOS Synopsis Calculates disk space requirements for database migration between SQL Server instances
Description Analyzes database files on source and destination instances to calculate space requirements before migration. Shows file size differences, mount points, and identifies potential overwrites when copying databases between SQL Server instances.
The function compares data and log files from the source database against existing files on the destination, accounting for scenarios where files exist only on source, only on destination, or on both sides.