SQL Server Performance

Shrinking database files

Discussion in 'Getting Started' started by ashish.johri, Sep 24, 2008.

  1. ashish.johri New Member

    I find following options when I want to shirk the database files.
    1. Compress pages and then truncate free space from the file
    2. Truncate free space from the end of the file
    3. Shrink file to ....... MB
    I have following questions:
    Data files:
    1. Is this safe to shrink data file (Using option 3)?
    2. Is this safe to truncate free space from the end of the data file (Using option 2)?
    Log Files:
    3. Is this safe to shrink log file (Using option 3) specially when the recovery model is Full?
    4. Is this safe to truncate free space from the end of the log file (Using option 2)?
  2. Luis Martin Moderator

    The question is:
    Do you really need to shrink data and/or log?
    After any shrink you will loose any previous indexes defrag. So if you shrink (forget the method by now) and after you run any maintenance plan, database will grow again.
  3. ghemant Moderator

    Hi,
    There are pros and cons of doing this activity, unless required it is not recommended to shrink and why is that so please refer Tibor Karaszi's article here http://www.karaszi.com/SQLServer/info_dont_shrink.asp
    Hope this article will give you more insight on it.
    Regards
  4. satya Moderator

    Is this a real-time situation or just for your knowledge?
  5. ashish.johri New Member

    Just for knowledge....
  6. Luis Martin Moderator

    Then, follow Ghemant suggestions.

Share This Page