일반적으로 백업은 DML blocking 하지 않으나 백업이 진행중일 때는 database/file shrink 할 수 없으며,

Primary에서 Log shrink 를 진행해도 Secondary에도 적용이 되기 때문에 위와 같은 Lock wait이 발생하게 됩니다.

Limitations and restrictions

Ÿ   The database can't be made smaller than the minimum size of the database. The minimum size is the size specified when the database was originally created, or the last explicit size set by using a file-size-changing operation, such as DBCC SHRINKFILE. For example, if a database was originally created with a size of 10 MB and grew to 100 MB, the smallest size the database could be reduced to is 10 MB, even if all the data in the database has been deleted.
Ÿ   You can't shrink a database while the database is being backed up. Conversely, you can't back up a database while a shrink operation on the database is in process.
Ÿ   You cannot shrink files while database Backups are happening.
Ÿ   You might also notice that these commands encounter a wait_type = LCK_M_U and a wait_resource = DATABASE: <id> [BULKOP_BACKUP_DB] when the status of these commands is viewed from the various dynamic management views (DMVs), such as from sys.dm_exec_requests or sys.dm_os_waiting_tasks.


Shrink a database - SQL Server | Microsoft Learn

MSSQLSERVER_3023 - SQL Server | Microsoft Learn

+ Recent posts