Category: Blog

  • A Guest at the Ranch

    From the other side of the world, I had a guest at the ranch today.

    pinal

    Pinal Dave, a friend from India, sent me an email that he’d unexpectedly come to Denver this week. He had some time, so I invited him out to the ranch today for a few hours to sit and chat, see the horses, and spend some time.

    We had a good time, and snapped a quick photo before he headed back to his hotel, and likely work knowing him.

    I really enjoy the conversations I get to have with other successful and passionate people. They are some of the most interesting, and helpful, times I have in my career. This was definitely one of them.

  • SQL Server Backup – Inadvertent Striping

    When I started working with SQL Server I got bit in the rear one day while I was testing backups. I was in the process of making a quick backup before I deployed some changes. I think this was in the Enterprise Manager days of SQL 2000, but it could have been v6.5. In any case, I had a dialog similar to this one that I’ve shown in Management Studio. For simplicity I’ve recreated this with AdventureWorks:

    stripebackup

    No biggie, right? I click add, and enter my new file for the backup:

    stripebackup2

    I accept this, and highlight me new file and click “OK” to do the backup. That will work, won’t it?

    stripebackup3

    Actually it won’t. or rather, it will but not in the way I expect.

    What this will do is create a striped backup (search in this article for “striped). I will have my data in a backup, but I will need both of these files in order to do a restore as each will only have half my data.

    It’s a rookie mistake, one that’s not possible with a script, which is why you should backup with scripts, not the GUI.

    However if you notice this, delete all the files, add yours back, and make a full backup right away. Chances are that you might have broken your recovery chain. And make sure you let everyone know this is not what you want to encounter.

  • Office Work

    rg_buildingI have been working at home for over 8 years, sharing an office with my wife for most of that time. I like working at home, though I do notice that if my wife is gone for a few days, I go a little stir crazy being completely by myself. It’s almost “too quiet” for me and I end up sometimes going to a Starbucks to work, just to have some ambient noise.

    This week I’m in the UK, visiting with my group at Red Gate Software. Typically I spend a few days in a conference room with my group and then a day or two in the office. Today is an office day, and it’s amazing just how busy and crowded the Red Gate spaces have become.

    You can see the Red Gate building here, two wings, with the upper two floors being completely Red Gate space. When I came last year, the quadrant where my group is located was fairly empty. Now it’s quite full, with most desks in use.

    rgoffice

    Most of the space is busy, and the lunch service from the in house cafeteria is very busy. It was so busy I forgot to get a picture before eating, being slightly worried about getting my own food and finding a seat. I went back near the end of lunch and snapped this one:

    lunch

     

    The SQL Servery, as it’s known, was just getting going before, but now it’s in full swing, with the menu’s posted, and lots of choices. Yesterday I had a lamb ragout and today was a spicy pasta vegetarian dish instead of the bangers and mash (shudder). Juices of all sorts are around, along with the most important piece of technology in the office:

    coffee

    I have made liberal use of this machine in the two days I’ve been in the office. The food is mostly healthy, which is good to see. At first I was a little put off that the only sodas in the office are in a vending machine, requiring all sorts of strange UK coins, but on this visit I’ve rarely had a soda all week and it’s been fine. I think if I had a company these days I’d consider providing healthy snacks and drinks for free and letting people buy the unhealthy stuff if they want.

    minimeMy “mini-me” is still there, which is cool. I thought this was one of the coolest pieces of art produced by the Red Gate designers. When I first saw it, I thought it was great. There are a few other walls that are decorated with various paintings and drawings.

    The office is bright and airy, and surprisingly quiet given all the people there.

    But there’s lots of them, more than I’m used to, so it’s a bit strange to walk around to get water or coffee and dodge people. Usually I’m just dodging a dog or two.

    One other very interesting thing is the memory wall. A long wall, with some cork sections, and some metal sections, where people post photos from company events and various press articles. It seems there are regular Red Gate events (which I rarely get to) that build bonds and help keep the company close together. I need to send something over to place up there.

    memory_wall

    I’m not much of a foosball player, but I see games going on regularly in the lower lobby area. There is a ping pong table, and it makes me think I need to get mine set up in the basement back at the ranch.

    Not much work getting done this week, but it’s a good trip and good to see so many of the people I correspond with on a regular basis and others I’ve known for years.

  • Striping Backups in SQL Backup Pro

    SQL_68x68_BackupThere are times you really do want to stripe backups across multiple files. If you have a short backup window, or a large data set, if you can write the backup to multiple files at the same time, you can drastically reduce your backup window. I think I heard one person say they had a client that was backing up a 2TB database in around 30 minutes with striping. Now that’s cooking with gas!

    My company, Red Gate Software, makes a nice backup product called SQL Backup Pro, which offers a number of features, compression and encryption being the two most notable ones. However I noticed at one point that it supported striping as well, so I decided to play with it.

    I started the backups, picking a database and then getting to the backup file screen.

    sqlbackup1

    There’s a drop down in the upper left, which gives you a few choices. One of these is the backup and mirror and the other is a backup to multiple files.

    sqlbackup2

    I selected the “Split backup into multiple files”, which equates to striping, and then added a file to the file dialog.

    sqlbackup3

    However I wanted to add a second file. I clicked “Add” again.

    sqlbackup4

    It’s nice that the names are changed, but adding a second file to the same path isn’t likely to give me much more throughput on the backup. Both files would write to the same I/O device. I was thinking that “Add” might give me a dialog for a different drive/path, but it didn’t.

    Instead I needed to click on the ellipsis next to the folder (I’ve added the arrow in the image below):

    sqlbackup5

    This brought me to a dialog that shows me the drives my machine can see. I didn’t test UNC paths, but I assume any valid path would work. You can set a path, or you can pick one, and you can even create a new folder. Handy since this could be a remote machine. The SQL Backup Pro client is like SSMS, it’s a client view to a remote service.

    sqlbackup6

    I select the D: drive on my machine, which is actually a separate physical drive.

    sqlbackup7

    I get back to the main dialog, and this time when I click “Add”, I get the desired result. A second file on a different path.

    sqlbackup8

    I run the backup, and sure enough, I have files in two places, each a little over 1MB. There’s some overhead, so it’s not a completely even stripe.

    sqlbackup10

    sqlbackup11

    As a comparison, I’ve highlighted a regular backup I made after this, same db, with one file:

    sqlbackup9

    That seems a little cumbersome, but I’d anticipate that you would only set this up once for each set up databases, and since you can easily script a SQL Backup set of commands (on the last screen) or create template, this shouldn’t be too hard to manage. In fact, the command for multiple databases does support striping as well, as in this example:

    EXECUTE master..sqlbackup ‘-SQL “BACKUP DATABASES [AdventureWorks,AdventureWorks_SSC,AdventureWorks2008R2]

    TO DISK = ”F:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Backup\<AUTO>_2.sqb”,

    DISK = ”C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Backup\<AUTO>_1.sqb”

    WITH DISKRETRYINTERVAL = 30, DISKRETRYCOUNT = 10″‘

    Since striping is usually done with only very large databases, this might not even be necessary. Most databases won’t need striping, and you can set a template for them that backs up to whatever location you wish.

    SQL Backup Pro has some nice features, and allows you to easily manage lots of backups across lots of servers. The compression ratios are nice and it has some great features, like this striping of backups, that can really improve your backup performance.