Thor Logo dbatools

Startup

Copy-DbaStartupProcedure

Shawn Melton (@wsmelton), wsmelton.github.io

Copy-DbaStartupProcedure View Source Shawn Melton (@wsmelton), wsmelton.github.io Windows, Linux, macOS Synopsis Copies startup procedures from master database between SQL Server instances Description Migrates user-defined startup procedures stored in the master database from source to destination SQL Server instances. Startup procedures are stored procedures that automatically execute when SQL Server starts up, commonly used for server initialization tasks, custom monitoring setup, or configuration validation. This function identifies procedures flagged with the startup option using sp_procoption, copies their definitions to the destination master database, and configures them as startup procedures.

Read more

Disable-DbaStartupProcedure

Patrick Flynn (@sqllensman)

Disable-DbaStartupProcedure View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS Synopsis Removes stored procedures from SQL Server’s automatic startup execution list Description Prevents stored procedures from automatically executing when the SQL Server service starts by clearing their startup designation in the master database. This is essential when troubleshooting startup issues or removing procedures that were previously configured to run at service startup. Equivalent to running sp_procoption with @OptionValue = off, but provides object-based management with detailed status reporting.

Read more

Enable-DbaStartupProcedure

Patrick Flynn (@sqllensman)

Enable-DbaStartupProcedure View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS Synopsis Configures stored procedures in the master database to execute automatically when SQL Server service starts Description Marks stored procedures in the master database for automatic execution during SQL Server startup, eliminating the need to manually run initialization scripts after service restarts. This is essential for DBAs who need to ensure critical maintenance procedures, monitoring setup, or custom configurations are applied consistently every time the instance starts.

Read more

Get-DbaStartupParameter

Chrissy LeMaire (@cl), netnerds.net

Get-DbaStartupParameter View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Retrieves SQL Server startup parameters from the Windows service configuration Description Extracts and parses SQL Server startup parameters directly from the Windows service configuration using WMI. Returns detailed information about file paths (master database, transaction log, error log), trace flags, debug flags, and special startup modes like single-user or minimal start. Useful for troubleshooting startup issues, documenting server configurations, and verifying trace flag settings without connecting to SQL Server itself.

Read more

Get-DbaStartupProcedure

Patrick Flynn (@sqllensman)

Get-DbaStartupProcedure View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS Synopsis Retrieves stored procedures configured to run automatically when SQL Server starts up. Description This function returns stored procedures from the master database that are configured to execute automatically during SQL Server startup. Startup procedures are useful for initializing application settings, populating cache tables, or performing other tasks that need to run every time the SQL Server service starts. The function returns SMO StoredProcedure objects with details about each startup procedure, including creation dates, schemas, and implementation types.

Read more

Set-DbaStartupParameter

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

Set-DbaStartupParameter View Source Stuart Moore (@napalmgram), stuart-moore.com Windows, Linux, macOS Synopsis Modifies SQL Server startup parameters stored in the Windows registry Description Changes the startup parameters that SQL Server uses when the service starts, including paths to master database files, error log location, and various startup flags. These parameters are stored in the Windows registry and require elevated permissions to modify. This function is commonly used to enable single-user mode for emergency repairs, set trace flags for troubleshooting, relocate system database files during migrations, or adjust memory settings.

Read more