Solved

auto-shrink in SQL

Posted on 2014-09-29
4
501 Views
Last Modified: 2014-10-08
can anyone give a management friendly summary of the issues in using "auto-shrink" on SQL databases:

1) does it cause any risks
2) why do DBA's use it
3) if it does cause risks - are there any safer alternatives to get the same result?
0
Comment
Question by:pma111
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 34

Assisted Solution

by:ste5an
ste5an earned 125 total points
ID: 40350045
Auto-shrink resorts the pages in your data file. This means also index pages are reorderd. This leads to index fragmentation.

1.) No.
2.) Never used it.
3.) Rebuild your filegroup.

See also Why you should not shrink your data files from Paul Randal.
0
 
LVL 50

Accepted Solution

by:
Vitor Montalvão earned 125 total points
ID: 40350112
I have a little different view fro ste5an.
[1) does it cause any risks
 2) why do DBA's use it
 3) if it does cause risks - are there any safer alternatives to get the same result?
1) Yes. Because is auto-shrink you can't control when it going to trigger. Can be during a period that your database need to be available and depending of the size of data and the fragmentation it can take hours to shrink and during the process will cause locks so no one will be able to do any operation on the database.
2) Because DBA's are wise people and like to control their own databases :)
3) Rebuild indexes

NOTE: Shrinking transaction log files aren't that bad as data files but can have some impact in the performance because if SQL Server needs to growth the tlog file it will block until all the empty space are filled with zeros.
0
 
LVL 24

Assisted Solution

by:Phillip Burton
Phillip Burton earned 125 total points
ID: 40350184
1. It can reduce performance.
2. They don't if they are wise. Growth will soon happen, so all of the auto-shrink is not needed.
3. Manually shrink it if required, and then only to the extent that is needed.
0
 
LVL 69

Assisted Solution

by:Scott Pletcher
Scott Pletcher earned 125 total points
ID: 40350396
1) Shrinking dbs causes delays in processing and can cause huge performance overhead.  This includes, but is not limited to, releasing and reacquiring disk space, and fragmenting table indexes.  Shrinks are only very selectively needed, thus there is never a need to auto-shrink a db.

2) DBA's don't use it [auto-shrink], ever.

3) Pre-allocate sufficient space, particularly log space.  In the very rare cases when a shrink is needed, do them as efficiently as possible.
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question