ravi teja
ravi teja

Reputation: 61

Shrink database in small chunks

I have a database of 3TB. I need to perform shrinking in the test environment before doing on production database. I read some blogs they say to do in small chunks.

How to do in small chunks?

Upvotes: 1

Views: 2377

Answers (1)

Marek Vitek
Marek Vitek

Reputation: 1633

In management studio you can tell shrink command new size. So basically you set smaller size every time you run shrink.
I don't know SQL command for doing it. But as usual in SQL-Server you can generate one for yourself.
OK just googled it. Following shrinks DB UserDB and leaves it with 10% of free space.

DBCC SHRINKDATABASE (UserDB, 10);
GO

MS reference to SHRINKDATABASE

Upvotes: 1

Related Questions