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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transaction Log Shrinking 1

Status
Not open for further replies.

tkatlas

MIS
Apr 24, 2000
8
US
I am having trouble shrinking the size of my transaction log.&nbsp;&nbsp;I just started working here and notice the transaction log was never backed up.&nbsp;&nbsp;Therefore it grew to 900 meg.&nbsp;&nbsp;I cannot get the size to decrease and have about 800 Meg allocated that is not being used.&nbsp;&nbsp;I have truncated the log and performed backups, but I still cannot get the database allocated transaction log file to shrink in physical size.... Any ideas would be appreciated.<br>Thanks,
 
Click 'Truncate Log On Checkpoint' if you log is an issue - the only problem is that your log becomes useless to restore from... <p>Cal<br><a href=mailto: > </a><br><a href= > </a><br>
 
This drove me crazy (a short trip) before finding the &quot;solution&quot; on a newsgroup.&nbsp;&nbsp;Run this from the Query Analyzer:<br><br><FONT FACE=monospace>dbcc loginfo</font><br><br>If there is a &quot;2&quot; in the status column for the last record, it means that the last portion of the log is the active portion.&nbsp;&nbsp;There is nothing you can <i>easily</i> do at this point to shrink it.&nbsp;&nbsp;You can:<br><br>A) occasionally (daily, say) run <FONT FACE=monospace>dbcc shrinkfile (your_log)</font> and/or the E/M's Truncate Log option, and wait for the active portion of the log to wrap back around during normal database activity, at which time the file will shrink, OR<br><br>B) write a loop in VB, FoxPro, or whatever to force a gazillion writes, thus speeding up the process in A.<br><br>Since its not an emergency, I'd choose A. <p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top