SQL 2005 Maintenance Jobs (backup, index reorg, index rebuild, shrink, etc.)

I have some general questions about SQL Maintenance Jobs.   Currently, I have a separate backup job for each of our DB's, 3-5 jobs, which also notify a group via DBMAIL upon failure.   Now, I want to introduce Index rebuild, Index Reorg, and Shrink plans.   So here are my questions:
1).  Would it be better to have my backup jobs under one maintenance plan and w/ multiple subplans? The backup jobs are scheduled daily and run in the evening.
2).  I know the difference between Index Rebuild and Index Reorg and that with SQL 2005, you can do an index rebuild online leaving the index available.  Which one is better?  How often do you would you want to run either? I assume weekly or on demand depending on performance or size issues.
3).  For the DB Shrink, this could be set to run weekly and before the backup, so when the backup job runs, it will pick up the smaller DB?  Can it be be a subplan of the db backup job and have a constraint for the backups to start once the DB shrink subplan is completed?
4).  Is there any specific order these four maintenance plans/subplans should be run?  

Any specifics on the parameters in the index rebuild wizard or t-sql would be appreciated.  
66chawgerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MohammedUCommented:
It is better to have to different jobs/plans for backup and maintenance (reindex).
Online reindexing is only available in EE and it has some ristrictions like table should not have text/varchar(max) columns...
It is better to reindex the table which fragmented instead of doing all without checking the fragmetation.
DB shrink is not advisable because, if may grow again and can impact the peformance...

YOu can also you use the script to reindex instead of maintenance plance...

http://www.sql-server-performance.com/tips/rebuilding_indexes_p1.aspx
http://www.mssqltips.com/tip.asp?tip=1014
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
66chawgerAuthor Commented:
Very interesting!!!  When you speak of reindexing are you speaking in general, or about rebuild vs. reorg?  I have had luck performing index reorg test, but as you said about the online reindexing (assume you are speaking about rebuild) I have encountered errors.  This could be related to what you mentioned about tables that should not have text/varchar (max) columns....

Ok, what is the best way to look at fragmentation do decide if it is feasible to do a index reorg?  
So you would not advise doing DB shrink as part of a maintenance job, correct?  So other than backup plans, what other maintenance plans would you suggest if not index reorg/rebuild and shrink?
0
66chawgerAuthor Commented:
I spoke too soon!  I see you gave me a link to check fragmentation.  Is it true that index reorganization, not rebuild, locks the table?
0
MohammedUCommented:
ReOrg will create big tlog because it is logged operation irrespective of recovery model...
rebuild locks the table unless you use ONLINE indexing option...
0
66chawgerAuthor Commented:
Excellent feedback..thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.