Solved

MS SQL Server 2012 Maintenance Plan sequence

Posted on 2014-01-23
2
608 Views
Last Modified: 2014-01-25
Hello from Italy,
we're running MS SQL Server 2012 under 2008 R2 for our ERP database

We have two Maintenance Plans:
- Backup ERP database plan (two times at day)
- Montly maintenance plan (first sunday of month)

This second plan runs the following tasks:
- Check Database Integrity
- Rebuild Index
- Update Statistics
- Clean Up History
- Shrink Database

Some questions:
1) Is there a task to be added or deleted?
2) This montly tasks sequence is correct or must be modified?
3) 'Reorganize Index' task is included in 'Rebuild Index' task or
    must be added to sequence?
4) Is correct to perform the above tasks for all databases (system
   databases included) or we must select only ERP database?

Thank you very much for your worldwide help!

Mauro
0
Comment
Question by:MauroMan
2 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 250 total points
Comment Utility
>- Shrink Database

this step should be removed. shrinking databases or database files should NOT be done regularly, it will just waste IO, and slow down the next operations on the database that require again some new space. usually, db are increasing and not decreasing. keep the free space (if any) . on the contrary, you should (best case) have the db files be increased before a INSERT actually requires more space and no free space would be available

for the rest, it depends ....
- cleanup history can be done "as by your actual needs", which can differ from db to db / server to server

- Check Database Integrity
   should be done weekly or even daily ... monthly is too longer interval

- Rebuild Index
  should NOT be done in a generic way for all indexes. better is to fetch some more dynamic script from internet, doing a rebuild for only indexes that are actually fragmented and not "small" indexes

- Update Statistics
  same as above, it may not be needed on all tables

of course, it is "simple/small" databases, it will work like you described.
for bigger (serious) databases, the standard maintenance plan is just "too simplistic"
0
 
LVL 42

Assisted Solution

by:EugeneZ
EugeneZ earned 250 total points
Comment Utility
the answer is depends on your specifics \business requirements\ maintenances window\
DB size\ server  -sql server -DB setup configuration and much more


As the main idea: try to use T-SQL for these tasks as much as you can but it is not mandatory  :)

Shrink DB could be removed unless you have Drive space issues (you need to resolve space issues first and then remove shrink step)

--


We have two Maintenance Plans:
- Backup ERP database plan (two times at day)
2s per day? is it full backup? if it is a business requirement and not affecting performance - nothing you can do
But you must check if your DB in Full recovery Mode and if it is - you must to run regular (every 15 mins\30mins..) transaction log backup

- monthly maintenance plan (first Sunday of month)  -- this you must review

This second plan runs the following tasks:
- Check Database Integrity --- < EZ if DB is small and you have After hours window -try to  run nighty (it is online operation)

- Rebuild Index  ( same for this one - is it online or offline)
- Update Statistics  -- try to use not full but sample 10 for daily
- Clean Up History - daily
- Shrink Database  -- try to avoid
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Join & Write a Comment

Suggested Solutions

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now