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
A hand tapping a plaster cast of a carved column top in a workshop, the original column visible outside.

Running DBCC CHECKDB on a Restored Copy Instead of Production

December 28, 2019
Pinal Dave
SQL Tips and Tricks
Database Corruption, DBA, SQL Backup and Restore, SQL Server DBCC

Run CHECKDB on a restored copy to validate a recoverable backup, retain the full check output, and understand what remains untested.

Read More
Gouache painting of a wooden birdhouse with a vermilion roof, a feather and twigs at its doorway, on a wooden bench

Copy Database Without Statistics and Query Store Data

December 17, 2019
Pinal Dave
SQL Tips and Tricks
Execution Plan, Query Store, SQL Scripts, SQL Server DBCC, SQL Statistics

To copy database without statistics, add NO_STATISTICS and NO_QUERYSTORE to DBCC CLONEDATABASE. This post shows why that matters, because histograms and Query Store texts hold real values. It also shows the plan estimate that changes, how to make a clone writable, and what VERIFY_CLONEDB does.

Read More
Gouache painting of a cream vase with sage branches beside a smaller empty cream vase with a vermilion rim

Clone Database in SQL Server With DBCC CLONEDATABASE

December 16, 2019
Pinal Dave
SQL Performance
Execution Plan, Query Store, SQL Scripts, SQL Server DBCC, SQL Statistics

Clone Database in SQL Server with DBCC CLONEDATABASE and you copy the structure and the statistics without a single row. This post runs the command on a demo database, checks what the clone holds and what it leaves out, and shows that the optimizer builds the same plan from the copied statistics.

Read More
Gouache painting of a shelf with one vermilion bucket and four more stacked aside

Remove Extra tempdb Files in SQL Server Safely

August 19, 2019
Pinal Dave
SQL Performance
SQL Scripts, SQL Server, SQL Server DBCC, SQL TempDB

To remove extra tempdb files, empty each file first with DBCC SHRINKFILE and then remove it with ALTER DATABASE. This post checks the file count and the allocation waits before you start, rehearses both steps on a demo database, shows the tempdb statements with their undo, and explains why emptying can fail.

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
Two different inspection tools examine an intact instrument beside preserved fittings.

SQL SERVER – Historical PHYSICAL_ONLY Bug and Version Specific Evidence

August 3, 2019
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Server, SQL Server DBCC

A historical SQL Server 2017 Bug affected CHECKDB with PHYSICAL_ONLY and clustered columnstore data. One client observed a dump.

Read More
Gouache painting of a bare kitchen counter with one vermilion jar brought back from the pantry

DBCC DROPCLEANBUFFERS Impact on Memory: See a Cold Cache in Action

July 11, 2019
Pinal Dave
SQL Performance
SQL Memory, SQL Scripts, SQL Server DBCC

DBCC DROPCLEANBUFFERS removes every clean page from memory, so the next query reads from disk. This post counts the pages of one database before and after, shows why a CHECKPOINT comes first, and compares a cold read with a warm read.

Read More
Previous 1 2 3 4 5 6 7 … 16 Next
  • Books
  • Testimonials
  • Privacy Policy

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