• Paul White NZ (6/2/2010)


    Oleg Netchaev (6/2/2010)


    C. VLFs are overwritten with zeroes? No, in Windows nothing is overwritten with zeroes as there is no need to do that.

    Hey Oleg,

    Log files are initialised with zeroes (there's some complexity around that - see Paul's blog and Jonathan Kehayias' entries:

    http://sqlblog.com/blogs/jonathan_kehayias/archive/2010/05/13/does-the-tempdb-log-file-get-zero-initialized-at-startup.aspx

    Windows uses zero-initialised memory pages too (see Demand Zero Pages).

    Paul

    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 existing 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