Removing tempdb files

  • Steve Jones - SSC Editor

    SSC Guru

    Points: 716331

    Comments posted to this topic are about the item Removing tempdb files

  • Jeff Moden

    SSC Guru

    Points: 994945

    It'll be interesting to see how people answer this one because the correct answer won't actually work on a busy system because the file will not be empty.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
    "If you think its expensive to hire a professional to do the job, wait until you hire an amateur."--Red Adair
    "Change is inevitable... change for the better is not."
    When you put the right degree of spin on it, the number 3|8 is also a glyph that describes the nature of a DBAs job. πŸ˜‰

    Helpful Links:
    How to post code problems
    Create a Tally Function (fnTally)

  • Stewart "Arturius" Campbell

    SSC Guru

    Points: 71454

    Jeff Moden - Thursday, March 14, 2019 11:56 PM

    It'll be interesting to see how people answer this one because the correct answer won't actually work on a busy system because the file will not be empty.

    my thoughts exactly.
    thanks for the question, Steve

    ____________________________________________
    Space, the final frontier? not any more...
    All limits henceforth are self-imposed.
    β€œlibera tute vulgaris ex”

  • frederico_fonseca

    SSChampion

    Points: 14188

    Steve does mention the constraint on the answer "Note, if the file is not empty, you cannot remove it.)

  • Jeff Moden

    SSC Guru

    Points: 994945

    frederico_fonseca - Friday, March 15, 2019 5:00 AM

    Steve does mention the constraint on the answer "Note, if the file is not empty, you cannot remove it.)

    Yep... but the correct answer will not work by itself if there's any activity at all in TempDB (system generated or not and there's a fair number of system generated tables that seem to "stick" even after a system goes to a quiet but normal state) and that contingency makes the correct answer listed only a partially correct answer.  Since the question was specifically about TempDB, the contingency should have been a part of the correct answer, IMHO.

    Heh... it didn't happen here but instructions on some exams to "pick the best answer" give me the hackles when the "best" answer isn't actually the best answer.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
    "If you think its expensive to hire a professional to do the job, wait until you hire an amateur."--Red Adair
    "Change is inevitable... change for the better is not."
    When you put the right degree of spin on it, the number 3|8 is also a glyph that describes the nature of a DBAs job. πŸ˜‰

    Helpful Links:
    How to post code problems
    Create a Tally Function (fnTally)

  • Steve Jones - SSC Editor

    SSC Guru

    Points: 716331

    It's the best answer. Clearing the system of a workload is a separate task and a separate question.

  • Jeff Moden

    SSC Guru

    Points: 994945

    Steve Jones - SSC Editor - Friday, March 15, 2019 9:36 AM

    It's the best answer. Clearing the system of a workload is a separate task and a separate question.

    Heh... no it's not.  The "Best Answer" would be the one that includes the "clearing of the guns" because the code won't actually work on most production systems because of the current workload.  This is especially true since the title of the question is ...

    Removing tempdb files

    πŸ˜‰

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
    "If you think its expensive to hire a professional to do the job, wait until you hire an amateur."--Red Adair
    "Change is inevitable... change for the better is not."
    When you put the right degree of spin on it, the number 3|8 is also a glyph that describes the nature of a DBAs job. πŸ˜‰

    Helpful Links:
    How to post code problems
    Create a Tally Function (fnTally)

  • Mike Hinds

    SSCarpal Tunnel

    Points: 4248

    A "useful" answer would include steps to clear such a file, or at least a link to a more complete set of steps to do so. I would appreciate such a link to bookmark for myself and my in-house compadres.

    Mike Hinds Lead Database Administrator1st Source BankMCP, MCTS

  • Mike Hinds

    SSCarpal Tunnel

    Points: 4248

    Mike Hinds - Monday, March 18, 2019 6:20 AM

    A "useful" answer would include steps to clear such a file, or at least a link to a more complete set of steps to do so. I would appreciate such a link to bookmark for myself and my in-house compadres.

    Reminds me of a conversation from "Fiddler on the Roof" -
    "You can't both be right."
    "And you are also right."

    Mike Hinds Lead Database Administrator1st Source BankMCP, MCTS

  • Shayn Thomas

    SSCertifiable

    Points: 5427

    Mike Hinds - Monday, March 18, 2019 6:20 AM

    A "useful" answer would include steps to clear such a file, or at least a link to a more complete set of steps to do so. I would appreciate such a link to bookmark for myself and my in-house compadres.

    +1

    ---------------------------------------------------------------------------------------
    The more you know, the more you know that you dont know

Viewing 10 posts - 1 through 10 (of 10 total)

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