Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 4729

Shrinking transaction log file

$
0
0
I'm a beginner with SQL.  I'm running SQL server 2008 R2.  I have a transaction log that has grown to 49gb.  I run transaction log backups nightly but this hasn't been truncating the log probably due to the fact that I didn't set a growth limit on the file (??).  I've run a transaction log backup manually and when I go to shrink the file, the available free space shows as 99%.  The initial size of the file is set to 49gb, which means that it isn't shrinking.  I saw some previous posts which talked about running the command SHRINKFILE({logical file name}, target_size) in order to shrink the file to the target size and reset the initial size to the target size.  I'm wondering if it is okay to do this during production hours?  Also, is the target_size in mb?  So, if I want to shrink the file to 1gb and the logical name of the trans log file is "castlegar_Log" then I would run the query SHRINKFILE({castlegar_log}, 1000).  Does this look correct? Does anybody have other suggestions for how I should deal with this?  Thank you.

Viewing all articles
Browse latest Browse all 4729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>