This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
Manage Database Size with DBCC SHRINKDATABASE and WAIT_AT_LOW_PRIORITY.

SQL SERVER – Manage Database Size with DBCC SHRINKDATABASE and WAIT_AT_LOW_PRIORITY

September 29, 2023
Pinal Dave
SQL Performance
Shrinking Database, SQL Server DBCC

In this blog post, we will explore the DBCC SHRINKDATABASE command and its options, focusing on the WAIT_AT_LOW_PRIORITY feature.

Read More
A nearly empty grain bin with a scoop in a barn, a field of ripening wheat seen through the open door

Finding Oversized Data Files With Lots of Free Space

March 8, 2023
Pinal Dave
SQL Tips and Tricks
DBA, Disk, Shrinking Database, SQL Data Storage

Identify oversized data files with FILEPROPERTY, separate internal free space from disk capacity, and review one-time shrink choices.

Read More
Gouache painting of a large roll of sailcloth on a drum inside an open shed, with a vermilion block wedged under it

Log File Not Shrinking: Read log_reuse_wait_desc First

August 24, 2022
Pinal Dave
SQL Tips and Tricks
Shrinking Database, SQL Backup and Restore, SQL Server DBCC, Transaction Log

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.

Read More
A rotating shoe carousel with shoes grouped by their different shapes

Counting Objects by Type in Every Database With One Query

July 6, 2021
Pinal Dave
SQL Tips and Tricks
Shrinking Database, Spatial Database, SQL Sample Database, System Database

One loop and one pivot give you tables, views, procedures and functions for every database. A planted demo database proves the counts.

Read More
The same accordion basket construction appears compact and expanded

How to Change Database File Size? – Interview Question of the Week #296

October 4, 2020
Pinal Dave
SQL Interview Questions and Answers
Shrinking Database, SQL Performance, SQL Scripts, SQL Server, SQL Server DBCC

Question: How to Change Database File Size?

Answer: By Shrinking the files. Now, many have a negative opinion about Shrinkfile.

Read More
Gouache painting of a wicker trunk half packed with neat folded blankets and a vermilion strap left half buckled

Kill a Running Shrink: Is It Safe to Stop DBCC SHRINKFILE?

June 4, 2020
Pinal Dave
SQL Tips and Tricks
Shrinking Database, SQL Performance, SQL Server DBCC

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.

Read More
Gouache painting of a huge stockpot with a little soup beside a smaller pot with a vermilion lid

Shrink tempdb Without Restarting SQL Server

August 15, 2019
Pinal Dave
SQL Tips and Tricks
Shrinking Database, SQL Scripts, SQL Server DBCC, SQL TempDB

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.

Read More
1 2 3 4 … 6 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com