Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing DB/Log Size. 2

Status
Not open for further replies.

AKSQL

Programmer
Nov 16, 2004
6
US
So I have this DB that was set up quite a while ago (by someone else) with no maintenace plan in place. It was set up to automatically grow the file size of both the MDF and the LDF. Well... because the DB is reasonably active and there was no maintenace to truncate the logs they got reasonably big. (15 gigs) I have trunc'ed them and down to something much more reasonable (I think like 120 MB) but the physical size of the Space Allocated is still 15 + gig.

For reasons too complicated to explain I really would like to shrink that space allocated. Is it safe? Does anyone have any experince w/this???
 
You can shrink it using DBCC SHRINKDATABASE, or using EM.

However, if you do this you should then rebuild your indexes as they can become fragmented in the process. Having said that, rebuilding the indexes should be part of your regular maintenance anyway, so they probably need it!

James Goodman MCSE, MCDBA
 
So in general this is a safe practise huh? Thanks much!
 
Yes, shrink the log file is a safe practice. DBCC SHRINKDATABASE will shrink all the files within the database. DBCC SHRINKFILE will allow you to specify the file within the database to shrink. This will allow you to shrink the log file without effecting the database file.

Denny

--Anything is possible. All it takes is a little research. (Me)

[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top