Log File VLFs

  • Comments posted to this topic are about the item Log File VLFs

  • Nice question! Again, I've learned something new about VLF.

    You can test it out with the following script:

    CREATE DATABASE Test_DB

    GO

    USE Test_DB

    GO

    DBCC LOGINFO;

    In the column Status, a status = 2 means active VLF, while status = 0 means inactive VLF.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • today's question is really interesting.

    Thanks,

    Yash

  • Good question. In all my google'ing I couldn't get a definite answer, and still couldn't even in the linked article associated with the answer.

    Ended up applying commonsense, and 50/50 with the answer being "1" or "0"... decided if there are no transactions to restore/rollback then there is no need for an active vlf... which, on reflection, went against everything I've learned about computer & software architecture.

    Doh! 🙂

    _____________________________________________________________________
    [font="Comic Sans MS"]"The difficult tasks we do immediately, the impossible takes a little longer"[/font]

  • Nice question Steve.

  • This was removed by the editor as SPAM

  • This was removed by the editor as SPAM

  • Thanks for the question.

    I was about to encite a forum riot with "it depends how big the log is and you didn't say!!!! bad question! bad poster! trick question! gimme muh pointz bak!" (and any additional mind reading comments)

    But I read it a couple more times, correctly, and it all made sense. 😀

    thanks again

    ______________________________________________________________________________________________
    Forum posting etiquette.[/url] Get your answers faster.

  • Nice question.

    The fact there's always an active VLF even when the log is empty doesn't appear to be documented anywhere. But it seems like common sense to me.

    Tom

  • Tom.Thomson (1/12/2011)


    Nice question.

    The fact there's always an active VLF even when the log is empty doesn't appear to be documented anywhere. But it seems like common sense to me.

    Exactly my thinking.

  • That was a good question and I learned a couple of things from it.

    I thought that 4 VLFs would be created and almost answered that way until the word "active" caught my eye. That seemed to be a big hint.

    Then, after running Koen's query, I found that my original guess of 4 VLFs was incorrect and only 2 are created.

  • I couldn't help but thinking about the old joke...

    Q. How many people are dead in a cemetary?

    A. All of them.

    😛

  • Scott Arendt (1/12/2011)


    That was a good question and I learned a couple of things from it.

    I thought that 4 VLFs would be created and almost answered that way until the word "active" caught my eye. That seemed to be a big hint.

    Then, after running Koen's query, I found that my original guess of 4 VLFs was incorrect and only 2 are created.

    That's assuming you're using the default size of the model database. Manually make the log file something bigger (like 8GB), and you'll see a few more - about a dozen.

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • from QOTD of 7th JAn

    log created at:

    less than 64MB - 4 VLFs

    64MB and less than 1GB - 8 VLFs

    1GB or greater - 16VLFs

    ---------------------------------------------------------------------

  • Thanks for the question

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

Viewing 15 posts - 1 through 15 (of 20 total)

You must be logged in to reply to this topic. Login to reply