Question

Just-me-today on Fri, 28 Nov 2014 18:45:02


Hello

SQL 2008.

I'm looking at a couple of databases 20Gb and 50Gb, both are SIMPLE, and have a 6Gb and 17Gb logfile respectively. 

In SQL Management studio, tasks-->shrink-->logfile shows the log file can be reduced by 80+%

I am aware if I did this it'd re-grow if it was needed.

But, bemusingly, the ldf files are dated about 6 months ago - so date not been updated on the file system which I'd have expected.  I can confirm the log file I'm looking at is the right one :)

This server is new to me, and it us unlikely that any maintenance has been done, and I don't know the history.

So just curious, can I shrink these as a one-off tidy up? 

Should the file stamps change?

(I'm normally a server / email guy, not looked at SQL severs for a few years)


Sponsored



Replies

Kalman Toth on Fri, 28 Nov 2014 19:03:45


You can shrink the logs as a one-time-event.

Blog on shrinking log: http://www.sqlusa.com/bestpractices2005/shrinklog/




Kalman Toth Database & OLAP Architect SQL Server 2014 Database Design
New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014





Shanky_621 on Fri, 28 Nov 2014 21:44:10



So just curious, can I shrink these as a one-off tidy up? 

Should the file stamps change?

(I'm normally a server / email guy, not looked at SQL severs for a few years)

If you want to do it just once yes you may but keep in mind shrinking of data and log file is not advisable. Regarding time stamp in windows Server it always does not shows last modified date This link has more details

Dan Guzman on Fri, 28 Nov 2014 22:38:32


But, bemusingly, the ldf files are dated about 6 months ago - so date not been updated on the file system which I'd have expected.  I can confirm the log file I'm looking at is the right one :)

Has the instance been restarted?  The file date might not get updated unit it is closed.

Balmukund on Fri, 28 Nov 2014 23:51:37


I agree with Dan. Looking at date in Windows Explorer can't be used as way to determine usage of database log file.

scott_morris-ga on Mon, 01 Dec 2014 14:14:39


This server is new to me, and it us unlikely that any maintenance has been done, and I don't know the history.

Translation:  I see a sleeping bear and I have a strong desire to poke it.  Any concerns?