In this blog post, we will explore the DBCC SHRINKDATABASE command and its options, focusing on the WAIT_AT_LOW_PRIORITY feature.
Finding Oversized Data Files With Lots of Free Space
Identify oversized data files with FILEPROPERTY, separate internal free space from disk capacity, and review one-time shrink choices.
Log File Not Shrinking: Read log_reuse_wait_desc First
A log file not shrinking is explained by one column: log_reuse_wait_desc. A demo database reads LOG_BACKUP and ACTIVE_TRANSACTION from it and shows why the first shrink after a log backup can still fail. A table lists the other reasons with the action for each.
Counting Objects by Type in Every Database With One Query
One loop and one pivot give you tables, views, procedures and functions for every database. A planted demo database proves the counts.
How to Change Database File Size? – Interview Question of the Week #296
Question: How to Change Database File Size?
Answer: By Shrinking the files. Now, many have a negative opinion about Shrinkfile.
Kill a Running Shrink: Is It Safe to Stop DBCC SHRINKFILE?
You can kill a running shrink with KILL and the database stays safe. This post starts a shrink on a test database, stops it from a second window, checks the data and the file afterwards, and shows that the shrink itself, not the kill, is what fragments the table.
Shrink tempdb Without Restarting SQL Server
To shrink tempdb without a restart, run DBCC SHRINKFILE against each tempdb file with a target size in megabytes. This post checks the file sizes and the space use first, shows the statement with its undo, and tests the shrink rules on a demo database, so the tempdb server stays untouched.







