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.
Summarize Functionality
Invoke-DbaDbShrinkcallsDBCC SHRINKFILE. As of SQL Server 2022,WAIT_AT_LOW_PRIORITYis supported byDBCC SHRINKFILE. We should giveInvoke-DbaDbShrinkthis functionality. For the same reason that we provideStatementTimeoutand the option toInvoke-DbaDbShrinkin steps,WAIT_AT_LOW_PRIORITYis 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:
$file.Shrink($shrinkSizeKB.Megabyte, $ShrinkMethod). We would need to re-write to use T-SQL.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.