일반적으로 백업은 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 |
'Database > AlwaysOn' 카테고리의 다른 글
Always-on Availability group(AG) 구성의 SQL Server에서 Primary replica가 병렬 Index Rebuild 수행 시 Secondary도 동일한 수량의 병렬 Index Rebuild를 수행 하는가 (0) | 2024.08.22 |
---|---|
Alwayson 동기화 지연 원인 파악 (1) | 2024.02.14 |
데이터 동기화 대기 시간에 대한 일반적인 원인 및 문제 해결 (0) | 2024.02.14 |
SQL Server Always On 가용성 그룹에 대한 가용성 복제본 및 데이터베이스를 모니터링하기 위한 동적 관리뷰 (0) | 2023.04.05 |
SQL Server AlwaysOn synchronous-commit 환경에서 동기화 레이턴시 트러블슈팅 (0) | 2020.08.27 |