Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Maintenance Tasks on 2005 MS SQL Database


Maintenance Tasks on 2005 MS SQL Database

Author
Message
techzone12
techzone12
SSC Journeyman
SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)SSC Journeyman (92 reputation)

Group: General Forum Members
Points: 92 Visits: 166
What are the recommended Maintenance tasks to perform on a 2005 SQL production Database. I am thinking of the following:
1. Integrity Check - I am reading that this is resource intensive and can slow down SQL. Therefore it should be done offline.
2. Purge old data - I have a few tables that I can perform a "delete from ... " to delete data older than 6 month old as an example. What impact can this have on the database if it's done live? Is this necessarily going to reduce the size of the database? The database is set for "simple recovery".
3. Reorganize index
4. Update statistics
5. Shrink the DB. I was reading some articles that talked about the fact that this is a bad practice as it can increase fragmentation? So I guess I should not do it?

My objective is to reduce the size of the database without affecting performance. How do you do this?

Thanks
spaulich
spaulich
Forum Newbie
Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: General Forum Members
Points: 9 Visits: 82
First, backups! either with ssms maintenance plans or 3rd party product.
Second, start monitoring and reporting the db's performance, activity.
Third, then you'll know what the next step will be.
Jeffrey Williams 3188
Jeffrey Williams 3188
SSCarpal Tunnel
SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)

Group: General Forum Members
Points: 4463 Visits: 9833
Why do you feel you need to reduce the size of the database? Databases grow as you add data - and unless you have had an event that grew the database far beyond its normal size there is no reason to make it smaller.

Integrity Checks - should be run every day. If a database is corrupted and you don't know about it for several weeks/months you have no option to recover from a known good backup. You would end up losing data - and probably much more... There is no reason to try and run this 'offline' as it runs against a hidden snapshot of the database. Running in offline mode means the database will not be accessible to anyone while it runs.

Purge Data - this could lock the tables being purged. It can also cause performance issues during the process - depends on how it is written and what else is being run on the system at that time.

Rebuild/Reorganize indexes - use a procedure that identifies only those indexes that need to be rebuilt or reorganized. This will reduce the impact of this process on your system. If your system is Standard Edition - index rebuilds will be performed offline - meaning the index itself will not be available while it is being rebuilt.

ShrinkDB/ShrinkFile - as stated above, no reason to run this on a regular basis unless you want to cause additional performance issues and waste time. Both of these cause fragmentation in the indexes - which you just rebuilt/reorganized. And, if you do the shrink before the rebuild/reorganize - then the database is just going to grow back out.

Jeffrey Williams
Problems are opportunities brilliantly disguised as insurmountable obstacles.

How to post questions to get better answers faster
Managing Transaction Logs

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