Solved

SQL Server 2008 R2 - Optimize task runs very long

Posted on 2013-12-01
5
207 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
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
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

696 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