SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Auto Close and Auto Shrink - Just Don't


Auto Close and Auto Shrink - Just Don't

Author
Message
Andy Warren
Andy Warren
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: Moderators
Points: 14853 Visits: 2730
I don't know that it's as simple as just changing it to simple mode. I run on average about 200 db's, all fully logged. On any given day maybe 25% are really being used. I run log backups 4 times a day, but I run a second job that backs up any log over 50mb (arbitrary, pick a # you like) and then shrinks the log. This gives me a usage based backup, plus keeps disk usage in check. The time it takes to shrink a log is pretty small compared with a db backup. Switching to simple doesn't alleviate the problem of space usage, one big transaction can balloon up the file size way beyond what it "normally" is.



Andy
http://www.sqlservercentral.com/columnists/awarren/

Andy
SQLAndy - My Blog!
Connect with me on LinkedIn
Follow me on Twitter
shew
shew
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1174 Visits: 954
I agree that Auto Close is a silly option. It potentially causes more headaches than it is worth. Rdb (purchased by Oracle several years ago) has the same goofy feature.

On the other hand, we use Auto Shrink at our site. We have about 40 SQL Server machines with roughly 800 databases spread across them. Most of our Production servers are beefy machines (most with 4 CPUs, some with 8 CPUs), and many of our larger Production databases reside on (high-priced) EMC disk storage. Auto Shrink helps us to conserve disk space. So far, I have only noticed Auto Shrink causing a performance problem on one database in particular--that SQL 7.0 database is heavily updated throughout the day, and we disabled Auto Shrink for it. I haven't noticed any Auto Shrink problems with SQL 2000 at this point.

As long as you recognize the potential problems that Auto Shrink can create, I don't see any problem with trying the feature. If it causes problems, you can always turn it off. Auto Shrink has certainly stopped a lot of disk space-related phone calls on our Development boxes.

Just my 2 cents... Another 48 will buy you a (small) cup of coffee. ;-)



shew
shew
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1174 Visits: 954
By the way, several people alluded to shrinking the databases during off hours. Would anyone care to post the syntax they use?

Thanks



PBirch
PBirch
SSC Eights!
SSC Eights! (939 reputation)SSC Eights! (939 reputation)SSC Eights! (939 reputation)SSC Eights! (939 reputation)SSC Eights! (939 reputation)SSC Eights! (939 reputation)SSC Eights! (939 reputation)SSC Eights! (939 reputation)

Group: General Forum Members
Points: 939 Visits: 35
On the databases I have AutoClose off. It's one of those really bright ideas that no one wants.

Autoshrink is off because I found it twice trying to shrink itself during a very heavy I/O time (which added to the length of time for the process).

I just use DBCC SHRINKFILE(table, size).

Patrick

Quand on parle du loup, on en voit la queue
RD Francis
RD Francis
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1147 Visits: 447
Having read the advice regarding auto_shrink, I checked our database and found that several did indeed have that option on.

Rather than simply turning it off (we have gobs of space available, but I don't know that I want to let things grow without bounds), I decided to see if SQL Server 2000 provided a simple way to do this. Surprise, surprise, you can set a time to shrink in your maintenance plan. We'll be doing weekly shrinks (once the database grows to twice its current size, that is).


R David Francis
Robert W Marda
Robert W Marda
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1733 Visits: 109
Most of our databases in production use auto shrink. None of them use auto close.

I suspect the reason we have not noticed much in the way of a performance hit is because it is rare to have large amounts of data deleted during peak hours. Whenever a customer issues a delete command what really happens is a delete column is flagged as deleted. Some months later this data is moved to an archive table in the same database. So all our databases are gradually growing which means the auto shrink probably doesn't often try to shrink our databases.

Robert W. Marda
SQL Programmer
bigdough.com
The world’s leading capital markets contact database and software platform.

Robert W. Marda
Billing and OSS Specialist - SQL Programmer
MCL Systems
shew
shew
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1174 Visits: 954
Robert,

I suspect that is why we do not tend to see problems with Auto Shrink as well. "Purge" does not seem to be in our Developers' vocabulary. The majority of our databases tend to grow steadily so there is little to shrink, except for the log files.

Jon



tim-142151
tim-142151
Grasshopper
Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)Grasshopper (23 reputation)

Group: General Forum Members
Points: 23 Visits: 4

yeh.. um.. ok, there must be times where you have to auto-shrink! Isn't there? or is it completely dud and useless?


colin-815699
colin-815699
Forum Newbie
Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: General Forum Members
Points: 5 Visits: 18
If auto-shrink is turned on , is there any possible side effects on the database if you turn it off ?
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search