Shrink Database

When a database log file size increase we can shrink it to reduce its size. If recover model is not important, we can set database recovery model to SIMPLE mode and then shrink it.This code can release 10 percent amount of test_db files size.


USE test_db;
GO
DBCC SHRINKDATABASE (test_db, 10);
GO
<div id="_mcePaste" class="mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0; width: 1px; height: 1px;"><strong><em><a href="http://www.sql.co.il/books/insidetsql2008"><strong>Inside Microsoft SQL Server 2008: T-SQL Programming (MSPress, March 2009)</strong></a></em></strong></div>
Advertisements
This entry was posted in Database Administration, Joy of T-SQL, SQL General Information, T-SQL Tips & Tricks. Bookmark the permalink.

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s