• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Calling all SQL experts - To shrink or not to shrink?

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    #11
    Originally posted by SimonMac View Post
    Not SAP (Dynamics AX), that is exactly what I did, 4 of the biggest tables are the job history from when the system was launched in 2014 and not done with anything since
    Be careful with job history, it takes a fair while to clear down.

    If it's SQL Server (which Dynamics AX tends to sit on), then do you mean the SQL Server job history table? There's a retention parameter which sets the number of days to keep. Reducing this will mean that the clear up process will suddenly dump the extra days - make sure you do this at a quiet time (create some SQL to run after your weekly backup).
    The greatest trick the devil ever pulled was convincing the world that he didn't exist

    Comment


      #12
      Originally posted by SimonMac View Post
      Indexes are rebuilt weekly, but if there is less data in the tables, the rebuilt indexes etc will be completed quicker?
      You seem to be confusing removing data vs shrinking database. By all means remove old data, just shrinking the DB will move all the pages around, causing table and index fragmentation and OS disk fragmentation.

      Comment


        #13
        Originally posted by LondonManc View Post
        Be careful with job history, it takes a fair while to clear down.

        If it's SQL Server (which Dynamics AX tends to sit on), then do you mean the SQL Server job history table? There's a retention parameter which sets the number of days to keep. Reducing this will mean that the clear up process will suddenly dump the extra days - make sure you do this at a quiet time (create some SQL to run after your weekly backup).
        No, this is Dynamics Batch history, yeah it is taking a while, only doing a month at a time but making a big improvement on size so far at least.
        Originally posted by Stevie Wonder Boy
        I can't see any way to do it can you please advise?

        I want my account deleted and all of my information removed, I want to invoke my right to be forgotten.

        Comment


          #14
          Originally posted by DimPrawn View Post
          You seem to be confusing removing data vs shrinking database. By all means remove old data, just shrinking the DB will move all the pages around, causing table and index fragmentation and OS disk fragmentation.
          Its clear in my mind at least

          I am removing data, that bit I am happy with, I want to know if this alone will improve performance of backup/indexing etc or will I need to shrink the database as well
          Originally posted by Stevie Wonder Boy
          I can't see any way to do it can you please advise?

          I want my account deleted and all of my information removed, I want to invoke my right to be forgotten.

          Comment


            #15
            Originally posted by SimonMac View Post
            Its clear in my mind at least

            I am removing data, that bit I am happy with, I want to know if this alone will improve performance of backup/indexing etc or will I need to shrink the database as well
            Like I said, shrinking a database will ruin the performance, so it's up to you.

            Comment


              #16
              Originally posted by DimPrawn View Post
              Like I said, shrinking a database will ruin the performance, so it's up to you.
              But is it only a temporary performance drop? You mention the indexes, but they are scheduled to be rebuilt anyway, so does this negate the loss of performance
              Originally posted by Stevie Wonder Boy
              I can't see any way to do it can you please advise?

              I want my account deleted and all of my information removed, I want to invoke my right to be forgotten.

              Comment


                #17
                Originally posted by SimonMac View Post
                No, this is Dynamics Batch history, yeah it is taking a while, only doing a month at a time but making a big improvement on size so far at least.
                Sounds similar to the SSIS batch job history. Had fun with that last year.
                One thing for you to look for - there may be a retention parameter or you might need to set up a job to periodically purge the batch history.
                The greatest trick the devil ever pulled was convincing the world that he didn't exist

                Comment


                  #18
                  Originally posted by SimonMac View Post
                  But is it only a temporary performance drop? You mention the indexes, but they are scheduled to be rebuilt anyway, so does this negate the loss of performance
                  Rebuilding the indexes after the shrink will move all the pages around again, the DB will then grow much larger during this process. OS Disk fragmentation will get even worse. But if it makes you feel like you're making things better and can invoice why the hell not?

                  Comment


                    #19
                    I can explain it with smarties

                    Comment


                      #20
                      Simple enough for me to understand though?
                      Originally posted by Stevie Wonder Boy
                      I can't see any way to do it can you please advise?

                      I want my account deleted and all of my information removed, I want to invoke my right to be forgotten.

                      Comment

                      Working...
                      X