Change your process

This is an excellent example of how you need to be flexible with your processes, even when you’re in the middle of a project.

We started a project to move a DB to a new set of disks. Since the files are large, we probably weren’t going to be able to fit it into a single downtime so we were going to just move one file at a time over the next few weeks until they were all done. Well, due to circumstances out of our control, now they all have to be done at the same time. The problem is that now the file copies are going to take in excess of 6hrs, which is way longer than any downtime they would give us. I know, right? Don’t worry, I’ve got big problems with them forcing us to do operations in a large chunk like this, and then saying we can’t have time to do it. So we were doing our test last week and it did indeed take about 6hrs to copy all the files. And I don’t know why it didn’t hit me before, but why not change the process? The copy process was there because we were going to piecemeal the operation over several weeks, but since that’s gone, then maybe it’s time to come up with a new strategy.

So that’s what I did. My new strategy is an even simpler backup/restore op. All I have to do when I restore is map the files to their new locations and I’m golden. So so far it’s 6hrs to copy, and I know I can backup in 20-25mins. So my restore I’m guessing will be about 30mins (give or take).

Of course, the backup/restore won’t perform that well on its own. You have to tune it so it’ll use the resources to its advantage. This is where knowing how to tune your backups can come into play. And while I often say that tuning backups is quite often frustrating because you can’t use a lot of your resources because you’ve still gotta leave room for user processing on the box, this is one of those times that you can crank it all the way up. Everyone’s going to be offline for this op, so the box is completely mine. I can use every ounce of RAM and CPU on the server if I want. And that’s what I’m going to do. If you’re interested in how to go about tuning your backups, you can look at my recent SQLSAT session on the topic. I did it for SQL #90 in OKC. You can find the vid page for it here: http://midnightdba.itbookworm.com/Events.aspx

So anyway, the point is that just because you’ve come up with a way to do something, don’t set it in stone. If the scope changes in such a way that you can now do it a better way, then don’t be afraid to say “Stop, I’ve got a better way”. You may get some pushback from your peers because the project plan is already done and we need to just move forward with what we’ve got, but that’s when you need to push back and say no, this process was developed for a different circimstance and now it’s a different scenario completely. So this is no longer a viable method.

6 thoughts on “Change your process”

  1. I’m facing this very situation myself, 6 hours of file copies, with limited time to actually get it done. Complicating my situation is replication – the databases being moved are published, so a backup/restore means additional time to sync up replication. The plan at this point is to shut the server down, do a block-level copy from old SAN to new SAN, mount the new disks with the old drive letters, and hope SQL Server is oblivious to the change…

  2. Hey Tracy… My DB is replicated too. I fail to see however, why this is a problem. If you kick all the users out and make sure repl is caught up, then it will be synched when you restore it.
    Is there something I’m missing?

  3. No, it looks like the error is mine. I have, for years, operated under the assumption that restoring a published database would require re-snapshotting all of the articles. I believe I was told that at some point, and never questioned it. I see now, according to some MSDN stuff, that it’s not such a big deal after all. I just learned something…

  4. Most excellent. And I find that to be one of the biggest problems in our field. Someone gets told something and they go on thinking it forever and never questioning it. I worked with a DBA last yr who kept telling people that the big difference between using TCP/IP and Named Pipes is that NP doesn’t allow you to use Windows auth. The guy had like over 20yrs in SQL. I was always on him for so much that I didn’t address that the first couple times I heard it, and I always meant to go back and talk to him about it, but we got rid of him shortly after that so I never got a chance. Honestly though, he wouldn’t have listened even though it’s easy to prove.

  5. Well, here’s hoping that both of our moves are successful. My first one is this weekend, with more the two following weekends…

Comments are closed.