Monday, January 2, 2012

Shrink Database

To shrink database using MS Sql Server
============================

use [db_name]

--Delete data log
Alter database [db_name] set recovery SIMPLE
DBCC SHRINKFILE ( db_name,TRUNCATEONLY)

--To Clear Cached plan
DBCC FREEPROCCACHE

--TO Clear Buffer from Buffer Pool
DBCC DROPCLEANBUFFERS





No comments: