Solved

SQL Server 2008 R2 - Optimize task runs very long

Posted on 2013-12-01
5
201 Views
Last Modified: 2013-12-02
I run the Optimize task from the built-in maintenance plans once a week.  The database is 46.4 GB.  The Optimize job runs > 20 hours.  Is this Normal for a database of this size?  What can be done to reduce run time?
0
Comment
Question by:bleonardi
  • 2
  • 2
5 Comments
 
LVL 8

Assisted Solution

by:Mohit Vijay
Mohit Vijay earned 250 total points
ID: 39688605
sometime its normal. It depends of indexes available in your database and fragmentation of tables.
0
 
LVL 7

Accepted Solution

by:
XGIS earned 250 total points
ID: 39688699
Here is a link to some sql optimisation options

Is data the issue or the log file blowing out?  There are some shrink options that may work for you to get it to a more manageable size.

here are some basic tips on this approach.
0
 

Author Comment

by:bleonardi
ID: 39690548
Took me a little while to review the articles referenced by XGIS.  

We run a shrink job every night.  The log files are not exceptionally large.

Basically, what I am taking from your comments is that I need to focus on the index structure, and then secondarily minimizing fragmentation in the indexes.  Correct?
0
 
LVL 8

Expert Comment

by:Mohit Vijay
ID: 39690731
if above question to me, then answer is yes.
0
 
LVL 7

Expert Comment

by:XGIS
ID: 39691241
Hello  bleonardi.. thankyou for the points.. pls advise if you have performed a shrink via command line and not SSMS.  Particularly your logfile, because sometimes it does not shrink properly inside SSMS. Also I have seen apps like DNN in the past the have settings that make their logfiles blowout very frequently.. so often that you needed to run a shrink process weekly.
As for indexing and so forth what type of data are you storing.  eg if you are storing images in the database as binary and not as file paths this can be an issue.  Also you may benefit from some normalisation.  eg replace words with numbers for common values.  These things can be daunting if you are not confident in sql execution. Always make a backup for testing etc.
I actually use a sql chaining type scenario in sql express 2012, where each database has a maximum size of 10gb, and a new one generates each time the other fills up.  eg10million records.  I use a MASTER database to mange the CHILD databases which enables me to run queries across all databases at once.  Maybe this approach is something to consider.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

911 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

21 Experts available now in Live!

Get 1:1 Help Now