Thor Logo dbatools

Log

Get-DbaDbFile

Stuart Moore (@napalmgram), stuart-moore.com

Get-DbaDbFile View Source Stuart Moore (@napalmgram), stuart-moore.com Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs 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.

Read more

Get-DbaDbFileGrowth

Chrissy LeMaire (@cl), netnerds.net

Get-DbaDbFileGrowth View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs 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.

Read more

Get-DbaDbFileMapping

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 On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs 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.

Read more

Get-DbaDbLogSpace

Jess Pomfret, JessPomfret.com

Get-DbaDbLogSpace View Source Jess Pomfret, JessPomfret.com Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs 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.

Read more

Get-DbaDefaultPath

Chrissy LeMaire (@cl), netnerds.net

Get-DbaDefaultPath View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs 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.

Read more

Read-DbaTransactionLog

Stuart Moore (@napalmgram), stuart-moore.com

Read-DbaTransactionLog View Source Stuart Moore (@napalmgram), stuart-moore.com Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs Synopsis Retrieves raw transaction log records from a database using fn_dblog for forensic analysis and troubleshooting Description Uses SQL Server’s built-in fn_dblog function to extract raw transaction log records from a live database, returning detailed information about every transaction in the format used by the SQL Server logging subsystem.

Read more

Set-DbaDbFileGrowth

Chrissy LeMaire (@cl), netnerds.net

Set-DbaDbFileGrowth View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs 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.

Read more