-
-
Notifications
You must be signed in to change notification settings - Fork 864
Open
Labels
Description
Summarize Functionality
Invoke-DbaDbShrink calls DBCC SHRINKFILE. As of SQL Server 2022, WAIT_AT_LOW_PRIORITY is supported by DBCC SHRINKFILE. We should give Invoke-DbaDbShrink this functionality. For the same reason that we provide StatementTimeout and the option to Invoke-DbaDbShrink in steps, WAIT_AT_LOW_PRIORITY is quite handy.
Is there a command that is similiar or close to what you are looking for?
No
Technical Details
This will be tricky for two reasons:
- We currently use the SMO shrink method, called as
$file.Shrink($shrinkSizeKB.Megabyte, $ShrinkMethod). We would need to re-write to use T-SQL. - Nothing else in dbatools supports
WAIT_AT_LOW_PRIORITY, so we would have to figure out how calling it from PowerShell should look. It effectively has three parameters: if it should be on or off, the max duration in minutes, and what to abort.
Reactions are currently unavailable