Thor Logo dbatools

File

Add-DbaDbFile

the dbatools team + Claude

Add-DbaDbFile View Source the dbatools team + Claude Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs Synopsis Adds data files to existing filegroups in SQL Server databases. Description Adds new data files (.mdf or .ndf) to existing filegroups in SQL Server databases. This is essential after creating new filegroups (especially MemoryOptimizedDataFileGroup for In-Memory OLTP) because filegroups cannot store data until they contain at least one file.

Read more

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-DbaDbFileGroup

Patrick Flynn (@sqllensman)

Get-DbaDbFileGroup View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs 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.

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-DbaFile

Brandon Abshire, netnerds.net

Get-DbaFile View Source Brandon Abshire, netnerds.net Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs 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.

Read more

Invoke-DbaBalanceDataFiles

Sander Stad (@sqlstad), sqlstad.nl

Invoke-DbaBalanceDataFiles View Source Sander Stad (@sqlstad), sqlstad.nl Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs 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.

Read more

Move-DbaDbFile

Claudio Silva (@claudioessilva), claudioeesilva.eu

Move-DbaDbFile View Source Claudio Silva (@claudioessilva), claudioeesilva.eu Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs 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.

Read more

New-DbaDbFileGroup

Adam Lancaster, github.com/lancasteradam

New-DbaDbFileGroup View Source Adam Lancaster, github.com/lancasteradam Windows, Linux, macOS On this page: Synopsis · Description · Syntax · Examples · Parameters · Outputs 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.

Read more
← Previous
1 2
Next →
Page 1 of 2