Solved

SQL Server 2008 R2 - Optimize task runs very long

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

757 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

20 Experts available now in Live!

Get 1:1 Help Now