Solved

SQL Server 2008 R2 - Optimize task runs very long

Posted on 2013-12-01
5
203 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how the fundamental information of how to create a table.

777 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