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