• palmeralex (8/28/2015)


    Hi

    I've had a bit of a strange experience when shrinking tempdb. Before everyone points out how stupid it is to shrink it, please read through the entire thread and bear in mind I'm not a full time DBA.

    I'd set up tempdb with 6 files, one for each processor and set the initial size as 1gb on each with unlimited autogrow of 100mb.

    Three months later the tempdb had grown to 84GB are was taking over the whole drive. I looked at the properties and only around 100mb of the tempdb was being used.

    It's difficult to restart this particular database so I thought I'd shrink the database. I used the GUI (tasks - shrink - database) and it successfully executed.

    When I went back in to review the properties it has only shrank to 69GB and the initial sizes of the files had changed varying from between 10087mb - 11929mb.

    Can anyone explain why this has happened and what should be done about it.

    Cheers

    Alex

    It sounds to me like the files were simply in use. You can't shrink what's being used. And, that thing about TempDB growing to 84GB? That's likely the result of a batch job running or a really bad ad hoc query but, in either case, you should find out what it is and fix it.

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

    Change is inevitable... Change for the better is not.


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