Solved

MS SQL Server 2012 Maintenance Plan sequence

Posted on 2014-01-23
2
619 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
ID: 39802487
>- 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
ID: 39802584
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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Question has a verified solution.

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

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

947 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

23 Experts available now in Live!

Get 1:1 Help Now