Click here to Skip to main content
Click here to Skip to main content

Clearing Transaction Logs

By , 24 Jan 2011
 
Clear the transaction Log if you are facing a low disk space on the database server.
 
To truncate log, use the following commands:
 
DBCC SHRINKFILE('logfilename', 1)
BACKUP LOG redeoba WITH TRUNCATE_ONLY DBCC SHRINKFILE('logfilename', 1)
 
where log filename is usually database name, i.e., northwind.log.
 
Please do let me know, if you have any doubt.
 
Please provide "Vote":thumbsup: if this would be helpful.:rose:
Thanks,
Imdadhusen

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Sunasara Imdadhusen
Software Developer (Senior) Infostretch Ahmedabad-Gujarat
India India
Member
Aspiring for a challenging carrier wherein I can learn, grow, expand and share my existing knowledge in meaningful and coherent way.

sunaSaRa Imdadhusen
 
AWARDS:
  1. 1st Best Asp.Net article of SEP 2010
  2. 2nd Best Asp.Net article of MAY 2011
 
Read More Articles...

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralMy vote of 5memberSavalia Manoj M7 Nov '12 - 1:10 
Good one...
GeneralMy vote of 4memberMember 93931173 Oct '12 - 22:39 
nice
GeneralReason for my vote of 4 Very useful in the database applicat...memberPravin Patil, Mumbai24 Jan '11 - 3:29 
Reason for my vote of 4
Very useful in the database applications....
GeneralRemoved superfluous "Accept Answer" request (not available h...subeditorIndivara23 Jan '11 - 16:08 
Removed superfluous "Accept Answer" request (not available here)
GeneralReason for my vote of 2 Please explain more in-depth.memberJerry OLoughlin6 Dec '10 - 17:34 
Reason for my vote of 2
Please explain more in-depth.
GeneralIt may also be helpful to point out that you can shrink the ...memberwizardzz2 Dec '10 - 6:04 
It may also be helpful to point out that you can shrink the data file as well.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130523.1 | Last Updated 24 Jan 2011
Article Copyright 2010 by Sunasara Imdadhusen
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid