Created
June 20, 2022 13:41
-
-
Save muratvezir/5d82856a142254a22c346ce9061da5a1 to your computer and use it in GitHub Desktop.
Shrink TempDb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- You have to edit script for your temp db count :) | |
USE [tempdb] | |
GO | |
DBCC FREEPROCCACHE | |
DBCC DROPCLEANBUFFERS | |
DBCC FREESYSTEMCACHE ('ALL') | |
DBCC FREESESSIONCACHE | |
DBCC SHRINKFILE ('tempdev', 500) | |
DBCC SHRINKFILE ('temp2', 500) | |
DBCC SHRINKFILE ('temp3', 500) | |
DBCC SHRINKFILE ('temp4', 500) | |
DBCC SHRINKFILE ('temp5', 500) | |
DBCC SHRINKFILE ('temp6', 500) | |
DBCC SHRINKFILE ('temp7', 500) | |
DBCC SHRINKFILE ('temp8', 500) | |
DBCC SHRINKFILE ('templog', 500) | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment