﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by Paul Randal  / Clearing the Transaction Log / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Mon, 20 May 2013 00:52:58 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Clearing the Transaction Log</title><link>http://www.sqlservercentral.com/Forums/Topic930509-2616-1.aspx</link><description>good Q on Transaction Log Physical Architecture and Virtual Log Files</description><pubDate>Thu, 10 Jun 2010 04:15:58 GMT</pubDate><dc:creator>rahulddeshmukh</dc:creator></item><item><title>RE: Clearing the Transaction Log</title><link>http://www.sqlservercentral.com/Forums/Topic930509-2616-1.aspx</link><description>Another good question which made reading the relevant tech pages to answer it interesting and well worth the time.</description><pubDate>Sun, 06 Jun 2010 10:05:18 GMT</pubDate><dc:creator>jrandolph</dc:creator></item><item><title>RE: Clearing the Transaction Log</title><link>http://www.sqlservercentral.com/Forums/Topic930509-2616-1.aspx</link><description>I "Lost" 2 points :angry: but "gained" a very good knowledge :-)</description><pubDate>Thu, 03 Jun 2010 03:45:05 GMT</pubDate><dc:creator>Tush</dc:creator></item><item><title>RE: Clearing the Transaction Log</title><link>http://www.sqlservercentral.com/Forums/Topic930509-2616-1.aspx</link><description>thanks Paul :-) of all the QOTD, i find your questions the most difficult...:-)</description><pubDate>Wed, 02 Jun 2010 21:25:28 GMT</pubDate><dc:creator>ziangij</dc:creator></item><item><title>RE: Clearing the Transaction Log</title><link>http://www.sqlservercentral.com/Forums/Topic930509-2616-1.aspx</link><description>[quote][b]Paul White NZ (6/2/2010)[/b][hr][quote][b]Oleg Netchaev (6/2/2010)[/b][hr]C. VLFs are overwritten with zeroes? No, in Windows nothing is overwritten with zeroes as there is no need to do that.[/quote]Hey Oleg,Log files are initialised with zeroes (there's some complexity around that - see Paul's blog and Jonathan Kehayias' entries:[url]http://sqlblog.com/blogs/jonathan_kehayias/archive/2010/05/13/does-the-tempdb-log-file-get-zero-initialized-at-startup.aspx[/url]Windows uses zero-initialised memory pages too (see Demand Zero Pages).Paul[/quote]Thank you Paul, it is good to know. Usually, Windows does not need to write any zeroes (when you delete files or format drive, just the records from allocation table are deleted and this is good enough), but initializing a log file with zeroes does make a lot of sense. Since the question was about clearing [b]existing[/b] log file, I think that my assumption about not overwriting existing inactive fragments with zeroes is still OK. If not then I guess I got lucky while dismissing options which I perceived as incorrect. In any case, I got my 2 points out of the question posted by Paul Randall, and to get those is never a trivial task.Oleg</description><pubDate>Wed, 02 Jun 2010 16:06:58 GMT</pubDate><dc:creator>Oleg Netchaev</dc:creator></item><item><title>RE: Clearing the Transaction Log</title><link>http://www.sqlservercentral.com/Forums/Topic930509-2616-1.aspx</link><description>[quote][b]Oleg Netchaev (6/2/2010)[/b][hr]C. VLFs are overwritten with zeroes? No, in Windows nothing is overwritten with zeroes as there is no need to do that.[/quote]Hey Oleg,Log files are initialised with zeroes (there's some complexity around that - see Paul's blog and Jonathan Kehayias' entries:[url]http://sqlblog.com/blogs/jonathan_kehayias/archive/2010/05/13/does-the-tempdb-log-file-get-zero-initialized-at-startup.aspx[/url]Windows uses zero-initialised memory pages too (see Demand Zero Pages).Paul</description><pubDate>Wed, 02 Jun 2010 15:05:26 GMT</pubDate><dc:creator>Paul White</dc:creator></item><item><title>RE: Clearing the Transaction Log</title><link>http://www.sqlservercentral.com/Forums/Topic930509-2616-1.aspx</link><description>This is a great question, thank you Paul. It would have been very difficult to answer it correctly, but fortunately for me, incorrect options were clearly incorrect, and therefore it was not too difficult to not answer the question incorrectly:B. VLFs are physically deleted? No, VLF is, well, VLF, a fragmentC. VLFs are overwritten with zeroes? No, in Windows nothing is overwritten with zeroes as there is no need to do that. Even formatting the drive does not actually overwrite data with zeroes.With above out of the way, [b]All of the above[/b] and [b]Answers A and C[/b] have to go too.This leaves only [b]A[/b] and [b]D[/b] to seriously consider, and while this is true that the only way to shrink the file is to first have it inactive VLFs (Status = 0 when running dbcc loginfo()) bunched in its tail, the log file shrinks when dbcc shrinkfile is called.Thus, answer [b]A[/b] is the only answer which is not incorrect.Oleg</description><pubDate>Wed, 02 Jun 2010 14:11:48 GMT</pubDate><dc:creator>Oleg Netchaev</dc:creator></item><item><title>RE: Clearing the Transaction Log</title><link>http://www.sqlservercentral.com/Forums/Topic930509-2616-1.aspx</link><description>I got lucky... I got it right. Partly from discounting some, and the rest by what didn't make sense.I also agree... excellent explaination of the answer.</description><pubDate>Wed, 02 Jun 2010 11:47:25 GMT</pubDate><dc:creator>WayneS</dc:creator></item><item><title>RE: Clearing the Transaction Log</title><link>http://www.sqlservercentral.com/Forums/Topic930509-2616-1.aspx</link><description>Got it wrong.  :angry:Thanks for a good explanation.  :-)</description><pubDate>Wed, 02 Jun 2010 11:18:26 GMT</pubDate><dc:creator>Daniel Bowlin</dc:creator></item><item><title>RE: Clearing the Transaction Log</title><link>http://www.sqlservercentral.com/Forums/Topic930509-2616-1.aspx</link><description>Thanks for the great question! I am learning so much more from these questions and their explanations.</description><pubDate>Tue, 01 Jun 2010 20:23:23 GMT</pubDate><dc:creator>UMG Developer</dc:creator></item><item><title>RE: Clearing the Transaction Log</title><link>http://www.sqlservercentral.com/Forums/Topic930509-2616-1.aspx</link><description>Great question.  This is what the QOD is all about.  A great explanation of the answer as well.</description><pubDate>Tue, 01 Jun 2010 12:38:39 GMT</pubDate><dc:creator>Steve Cullen</dc:creator></item><item><title>RE: Clearing the Transaction Log</title><link>http://www.sqlservercentral.com/Forums/Topic930509-2616-1.aspx</link><description>Paul, thanks to a firmly worded and clearly written article of yours I'd read a while ago [url=http://www.sqlskills.com/BLOGS/PAUL/post/Misconceptions-around-the-log-and-log-backups-how-to-convince-yourself.aspx]http://www.sqlskills.com/BLOGS/PAUL/post/Misconceptions-around-the-log-and-log-backups-how-to-convince-yourself.aspx[/url], I got this one right.I agree with the comment someone posted on that web page above: it would be helpful if BOL adopted more explicit language about this issue.Yours,Rich M.</description><pubDate>Tue, 01 Jun 2010 10:40:42 GMT</pubDate><dc:creator>rmechaber</dc:creator></item><item><title>RE: Clearing the Transaction Log</title><link>http://www.sqlservercentral.com/Forums/Topic930509-2616-1.aspx</link><description>Most excellent question.</description><pubDate>Tue, 01 Jun 2010 10:30:50 GMT</pubDate><dc:creator>SQLRNNR</dc:creator></item><item><title>RE: Clearing the Transaction Log</title><link>http://www.sqlservercentral.com/Forums/Topic930509-2616-1.aspx</link><description>[quote][b]Tom Garth (6/1/2010)[/b][hr]I think I almost got it right - :-)This was a great question that made me do a little reading and learn something about a little understood part of SQL Server.I do believe that the other 16% who got it right, deserve more than just 2 points.Thanks,[i][font="Arial"]"There are three kinds of men. The one that learns by reading. The few who learn by observation. The rest of them have to pee on the electric fence for themselves." -- Will Rogers[/font][/i][/quote]Speaking of which, you deserve 2 points for your tag line! :-)Thanks,webrunner</description><pubDate>Tue, 01 Jun 2010 09:22:00 GMT</pubDate><dc:creator>webrunner</dc:creator></item><item><title>RE: Clearing the Transaction Log</title><link>http://www.sqlservercentral.com/Forums/Topic930509-2616-1.aspx</link><description>Ouch! Got that one wrong.Great question.Thanks,webrunner</description><pubDate>Tue, 01 Jun 2010 09:19:30 GMT</pubDate><dc:creator>webrunner</dc:creator></item><item><title>RE: Clearing the Transaction Log</title><link>http://www.sqlservercentral.com/Forums/Topic930509-2616-1.aspx</link><description>I think I almost got it right - :-)This was a great question that made me do a little reading and learn something about a little understood part of SQL Server.I do believe that the other 16% who got it right, deserve more than just 2 points.Thanks,</description><pubDate>Tue, 01 Jun 2010 08:56:35 GMT</pubDate><dc:creator>Tom Garth</dc:creator></item><item><title>RE: Clearing the Transaction Log</title><link>http://www.sqlservercentral.com/Forums/Topic930509-2616-1.aspx</link><description>Today i learned about the Transaction Logs and  virtual log files</description><pubDate>Tue, 01 Jun 2010 05:41:26 GMT</pubDate><dc:creator>sharath.chalamgari</dc:creator></item><item><title>RE: Clearing the Transaction Log</title><link>http://www.sqlservercentral.com/Forums/Topic930509-2616-1.aspx</link><description>Today i learned new topic about VLF.</description><pubDate>Tue, 01 Jun 2010 05:25:55 GMT</pubDate><dc:creator>malleswarareddy_m</dc:creator></item><item><title>RE: Clearing the Transaction Log</title><link>http://www.sqlservercentral.com/Forums/Topic930509-2616-1.aspx</link><description>Not too difficult for someone who hasn't read his blog as well.  I just pay close attention to others more versed in log files that also post here on SSC.</description><pubDate>Tue, 01 Jun 2010 01:20:14 GMT</pubDate><dc:creator>Lynn Pettis</dc:creator></item><item><title>RE: Clearing the Transaction Log</title><link>http://www.sqlservercentral.com/Forums/Topic930509-2616-1.aspx</link><description>Ha!  Easy for anyone who reads your excellent blog :-)Great question.</description><pubDate>Tue, 01 Jun 2010 01:15:33 GMT</pubDate><dc:creator>Paul White</dc:creator></item><item><title>Clearing the Transaction Log</title><link>http://www.sqlservercentral.com/Forums/Topic930509-2616-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/questions/Transaction+Log/70328/"&gt;Clearing the Transaction Log&lt;/A&gt;[/B]</description><pubDate>Mon, 31 May 2010 21:15:17 GMT</pubDate><dc:creator>Paul Randal</dc:creator></item></channel></rss>