How to defrag after Shrinking the data and log every night

OK, my shop has a shrink job that runs every night. It shrinks the data and log files. DBCC SHRINKFILE (filename,1). We have recovery model Simple.
So reading that SHRINK is horrible for the data file because of fragmentation, so looking to stop the daily job. BUt this job has been running everyday for years right after the ETL. We have a big nightly ETL process that (1) truncates several
hundred SQL tables and then BULK INSERT from the AS400 (2) for really large tables we just bring in the last X number of days from the AS400 and insert those records into the SQL table. We have very few indexes, but do have some on the really
large tables. FYI - The SQL Servers are at the clients' sites.
What kind of fragmentation has the SHRINK on the data file caused? how would it affect the ETL, and retrieval of data during the day? how can the fragmentation be fixed? 

Hello,
Databases suffer from fragmentation on indexes as explained
here, but they suffer from physical fragmentation at the storage level also. 
When the shrinking process shrinks a data file and recover space from the disk and the data file needs to grow again as part of your ETL process the new portion of the data file will rarely be contiguous to the rest of the data file on disk, and if this
shrink process happens many times, the data file may be spread among many tracks on the disk. This increases the disk requests required to write data on a fragmented data file and increases disk requests to create new data files. In general, fragmentation
will originate that what should be a simple I/O request has to be broken on many disk requests, making disk activity and performance less predictable and making disk queues larger.
My suggestion is to stop sql server services during maintenance window, defragment disk using the Windows Defrag tool or a third party tool, when finish start SQL Server services again, then defrag indexes on your databases.
Hope this helps.
Regards,
Alberto Morillo
SQLCoffee.com

Similar Messages

  • How do you edit out the date and time stamp from a photo

    How do you edit out the date and time stamp from a photo

    You can blur it out with retouch
    The built-in "Retouch" brush in "Edit" mode should suffice, if the background is mostly uniform, and if you set the size of the brush to slightly wider than the bar width of the letters. For example, in this picture I removed the year from the date (in the lower right corner) by using the "retouch" brush and following the contours of the letters. (the screen shot is from iPhoto '11, but iPhoto 9 should give similar results).
    Regards
    Léonie

  • In Numbers, how do I lock in the date and time data when an IF/THEN formula is used with the "NOW" function?

    In Numbers, how do I lock in the date and time data when an IF/THEN formula is used with the "NOW" function?
    =IF(I127,NOW()," ")
    I127 equals a check box. The formula retuns a value of the current date and time when a check is placed in the box. How does one lock that date and time so that it cannot be changed?

    I don't think it is possible to lock in the date and time using a formula. You could put NOW() in a cell, copy, and Edit Paste Formula Results where you want the result.
    Or if you are "time stamping" a lot, you may find this Automator Service (Dropbox download) helpful. It puts a "Today" function (actually it should be named "Now" because it includes both date and time) in your Services menu like this:
    Just doubleclick the .workflow package to install it. You may have to click "download anyway" in System Preferences > Privacy & Security.
    If you want you can assign the service a keyboard shortcut in System Preferences here:
    SG

  • How do I find out the date and time a picture was taken on my Ipad?

    How do I find out the date and time a picture was taken on my Ipad?

    Photo Manager Pro
    http://i1224.photobucket.com/albums/ee374/Diavonex/Album%202/7a2b3650710f4bded81 ab75dda6a3ee5.jpg

  • Change the Data and Log file locations in livecache

    Hi
    We have installed livecache in unix systems in the /sapdb mount directory where the installer have created sapdata and sapdblog directories. But the unix team has already created two mount direcotries as follows:
    /sapdb/LC1/lvcdata and /sapdb/LC1/lvclog mount points.
    While installing livecache we had selected this locations for creating the DATA and LOG volumes. Now they are asking to move the DATA and LOG volumes created in sapdata and saplog directories to these mount points. How to move the data and log file and make the database consistent. Is there any procedure to move the files to the mount point directories and change the pointers of livecahce to these locations.
    regards
    bala

    Hi Lars
    Thanks for the link. I will try it and let u know.
    But this is livecache (even it uses MaxDB ) database which was created by
    sapinst and morover is there any thing to be adjusted in SCM and as well as
    any modification ot be done in db level.
    regards
    bala

  • I have a hand me down iphone 3, how can i erase all the data and pictures from it?

    i have an iphone 3gs from my son, how can i erase all his data and photos from the phone so I can start transfering my own and use it

    Restore as New  >  http://support.apple.com/kb/HT1414

  • How do I programatically set the date and time of my FP-2000 in LabVIEW RT?

    I checked out the following knowledgebase document which has a tool for setting the system time, but I also need to set the date:
    http://zone.ni.com/devzone/explprog.nsf/ 6c163603265406328625682a006ed37d/ 37175dbc3696a1ac86256a850051097d?OpenDoc ument
    How can I do this?
    -Jim

    That is great, Steven. I also found a solution using GetSystemTime and SetSystemTime which are functions in kernel32.dll that get and set the system date-time. This function call worked on the FP-2000 that I have and should work on RT-Embeded systes, as well.
    -Jim
    Attachments:
    GetSystemTime.vi ‏16 KB
    SetSystemTime.vi ‏14 KB

  • Cannot use min-max-close buttons in top of screen after loading new web page, also has issues with videos. Does work fine oddly after shrinking the window and re-opening it from the taskbar...

    Issues with firefox where it wouldn't respond to above mentioned tasks, its like its clicking through the browser sometimes to screens behind it, or with drop down menus, it opens the menu up, but you click an option and it'll click on whatever the drop down menu is cover up. My computer has been running rather ragged lately which makes me think its a virus, I do have anti-virus and have tried a couple of programs to clean whatever it is up. I've also tried reinstalling firefox and that doesn't seem to help either.

    In Firefox 4 and later Safe mode disables extensions and disables hardware acceleration.
    *http://kb.mozillazine.org/Safe_mode
    Try to disable hardware acceleration.
    *Tools > Options > Advanced > General > Browsing: "Use hardware acceleration when available"
    If disabling hardware acceleration works then check if there is an update available for your graphics display driver.

  • A plus sign shows automatically after filling the date in my table cell.Why?How to delete it?

    Hi y'all..I'm using Numbers as my record for my expenses,income,etc.
    I have a "date" coloumn eg "13 September 2011" and after I fill the date and move on to the next table, a "+" sign appear on my date table automatically, what's that?How do i delete that?

    That means your column is not wide enough to display all of the content. Widen the column & the + will go away.

  • How can I get rid of the dates and time on my Notes

    How do I get rid of the dates and times on my Notes that appeared when I updated to 8?

    Yes, it's seems like a poor design decision.
    By putting the date on the line below the Note title in the Notes Index, the app shows half the number of notes per page AND if you have a large number of notes, it takes twice as long to stroll down.
    I doubt the designer actually uses the app. 
    TSAW

  • How do I have photos in iPhoto display on their face the date and time?

    How do I have photos in iPhoto display on their face the date and time? Displaying in the camera shows this. When I check edit the info is there. How do I have that displayed on the face of the photo when I view it in iPhoto?

    How do I have photos in iPhoto display on their face
    the date and time? Displaying in the camera shows
    this. When I check edit the info is there. How do I
    have that displayed on the face of the photo when I
    view it in iPhoto?
    Hi! My name is Tom from San Diego, CA. I have the exact same question as you. That is, I would like to be able to print out a photo from iphoto with the date that picture was taken displayed on the face of it. In this way, someone looking at that picture in a photo album years later would know when it was taken. Did you ever find a method to print copies of photos out of iphoto with the date displayed on the print? Thanks for your help!

  • HT1382 how can I restore my back up files from my laptop? i want to see the dates and time that I backed up  my files. is it posssible?

    how can I restore my back up files from my laptop? i want to see the dates and time that I backed up  my files. is it posssible?

    What backed up files?
    Available backups for an iOS device can be found in Edit > Preferences > Devices.

  • My Macbook pro was stolen 09/12, the police just returned it to me. I want to remove all the data and start over. Format the drive's etc. I have windows 7 on 1 partion and mountain lion OSX on the apple partition. How is the best way to do this?

    My Macbook pro was stolen 09/12, the police just returned it to me. I want to remove all the data and start over. Format the drive's etc. I have windows 7 on 1 partion and mountain lion OSX on the apple partition. How is the best way to do this?

    Have a look here...
    what-to-do-when-your-hard-drive-is-full.html

  • How do i keep only the name of a month in a cell in Numbers and not have it auto fill the date and time?

    how do i keep only the name of a month in a cell in Numbers and not have it auto fill the date and time?

    Hi JN and Barry,
    Barry wrote:
    The second case may not be included in the available D&T formats in Numbers 3
    For my region, the Date & Time data formats include month.
    The Date Pop-Up
    This may not be the case for all regions.
    Remember that the month is only the display, and the Full Date & Time is still there. If I change the format to reveal what is behind the curtain:
    Regards,
    Ian.

  • How to check the date and time when a material is blocked

    Hello,
       Please tell me how can i check the date and time when a material is blocked or unblocked.
    Regards,
    Priyanka

    Hi Pryianka,
    Are you speaking about blocked status of material master ('X-plant matl status' > MM03 > Basioc view 1; 'Plant-sp. matl status' > MM03 > MRP 1) or your problem is to find out the date when your material was booked into blocked state (stock category).
    If your problem is about mmr you can use the above mentioned MM04 (or MM03 > menu > Environment > Display changes).
    If your problem is to find out when your goods were posted to blocked stock you have to use MB51 + relevant movement types (e.g. 103, 344) + batch + etc. ()
    BR
    Csaba

Maybe you are looking for

  • Issues with Withholding tax on advance paid

    Dear Experts Our client deducts TDS on the Advance amount paid and on posting of Invoices from the Vendors. The documents are posted with withholding Tax types configured for this purpose in F-48 and FB60 respectively. Document splitting has been act

  • How to use JavaScript in Web bean generated JSP

    I want to do some simple JavaScript validations (for example, checking if a particular field is empty) in the JSP page rendered by the data web bean. Because the HTML is rendered by the bean, I'm not able to refer to the HTML controls in the JSP page

  • Database Structure For Articles and Categories

    Hi - This is a question about database structure - please help. Thanks For a website with many subjects or themes is it best to use 1 big table to hold or the articles or many small tables to hold articles for different subjects - I will explain what

  • Published site comes up blank

    Hello Everyone, I created a site in iWeb with all the updates. I published to a folder, than transferred the files to my webserver using Cyberduck via FTP. Everything except the .plst file transferred correctly, but when I go to my domain, the page c

  • Can't open FCP 6 project file on FCP 5

    FCP says: "can't open a never version file", so - *is there any possibility in FCP 6 make SAVE AS older version?* in FCP 5 i can't see any possibility to do that. maybe there is another way to solve my problem? thanks!