Thor Logo dbatools

Database

Measure-DbaBackupThroughput

Chrissy LeMaire (@cl), netnerds.net

Measure-DbaBackupThroughput View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Calculates backup throughput statistics from msdb backup history to analyze backup performance. Description Analyzes backup history records from the msdb database to calculate detailed throughput statistics including average, minimum, and maximum backup speeds measured in megabytes per second. This function helps DBAs identify performance patterns, troubleshoot slow backups, and optimize backup strategies by examining historical backup performance data.

Read more

Measure-DbaDiskSpaceRequirement

Pollus Brodeur (@pollusb)

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.

Read more

Mount-DbaDatabase

Chrissy LeMaire (@cl), netnerds.net

Mount-DbaDatabase View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Attaches detached database files to a SQL Server instance Description Attaches detached database files (.mdf, .ldf, .ndf) back to a SQL Server instance, making the database available for use again. When database files exist on disk but the database is not registered in the SQL Server instance, this command reconnects them using the SQL Server Management Objects (SMO) AttachDatabase method.

Read more

Move-DbaDbFile

Claudio Silva (@claudioessilva), claudioeesilva.eu

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.

Read more

New-DbaDatabase

Matthew Darwin (@evoDBA, naturalselectiondba.wordpress.com) | Chrissy LeMaire (@cl)

New-DbaDatabase View Source Matthew Darwin (@evoDBA, naturalselectiondba.wordpress.com) , Chrissy LeMaire (@cl) Windows, Linux, macOS Synopsis Creates new SQL Server databases with customizable file layout and growth settings Description Creates new databases on SQL Server instances with full control over file placement, sizing, and growth settings. Rather than using T-SQL CREATE DATABASE statements manually, this function provides a structured approach to database creation with built-in best practices. The function automatically configures growth settings to use fixed MB increments instead of percentage-based growth, which prevents runaway autogrowth issues in production environments.

Read more

New-DbaDbDataGeneratorConfig

Sander Stad (@sqlstad, sqlstad.nl)

New-DbaDbDataGeneratorConfig View Source Sander Stad (@sqlstad, sqlstad.nl) Windows, Linux, macOS Synopsis Creates JSON configuration files for generating realistic test data in SQL Server database tables Description Analyzes database table structures and generates JSON configuration files that define how to populate each column with realistic fake data. The function examines column names, data types, constraints, and relationships to intelligently map appropriate data generation rules using the Bogus library. Column names matching common patterns (like “Address”, “Email”, “Phone”) automatically get contextually appropriate fake data types, while other columns get sensible defaults based on their SQL data types.

Read more

New-DbaDbSchema

Adam Lancaster, github.com/lancasteradam

New-DbaDbSchema View Source Adam Lancaster, github.com/lancasteradam Windows, Linux, macOS Synopsis Creates new database schemas with specified ownership for organizing objects and implementing security boundaries. Description Creates new database schemas within SQL Server databases, allowing you to organize database objects into logical groups and implement security boundaries. Schemas provide a way to separate tables, views, procedures, and other objects by ownership or function, which is essential for multi-tenant applications, security models, and organized database development.

Read more

New-DbaDbSnapshot

Simone Bizzotto (@niphold)

New-DbaDbSnapshot View Source Simone Bizzotto (@niphold) Windows, Linux, macOS Synopsis Creates database snapshots for point-in-time recovery and testing scenarios Description Creates read-only database snapshots that capture the state of a database at a specific moment in time. Snapshots provide a fast way to revert databases to a previous state without restoring from backup files, making them ideal for pre-maintenance snapshots, testing scenarios, or quick rollback points. The function automatically generates snapshot file names with timestamps and handles the underlying file structure creation.

Read more

New-DbaDbSynonym

Mikey Bronowski (@MikeyBronowski), bronowski.it

New-DbaDbSynonym View Source Mikey Bronowski (@MikeyBronowski), bronowski.it Windows, Linux, macOS Synopsis Creates database synonyms to provide alternate names for tables, views, procedures, and other database objects. Description Creates database synonyms that serve as alternate names or aliases for database objects like tables, views, stored procedures, and functions. Synonyms simplify object references by providing shorter names, hiding complex schema structures, or creating abstraction layers for applications. You can create synonyms that reference objects in the same database, different databases, or even on linked servers, making cross-database and cross-server object access more manageable for applications and users.

Read more

New-DbaDbUser

Frank Henninger (@osiris687) | Andreas Jordan (@JordanOrdix), ordix.de

New-DbaDbUser View Source Frank Henninger (@osiris687) , Andreas Jordan (@JordanOrdix), ordix.de Windows, Linux, macOS Synopsis Creates database users with support for SQL logins, contained users, and Azure AD authentication. Description Creates database users across one or more databases, supporting multiple authentication types including traditional SQL login mapping, contained users with passwords, and Azure Active Directory external provider authentication. This command handles the common DBA task of provisioning database access without requiring manual T-SQL scripts for each database.

Read more
Page 5 of 8