All posts by jrdalrymple

Bareos and free open source backup for MSSQL

Here is my way. I’ve actually had this up and running for some time in another environment using SQL Server Standard 2008. I’m not in need of configuring a new backup for a 2012 SQL Express instance. There are a few parts, obviously. This article assumes you can configure a Bareos Windows client, if not there are plenty of other tutorials to help with that.

Part 1 is to create a sql command that will backup your databases to a file in the location of your choosing. I choose to keep all of my scripts as well as backup files in the same location so that if I ever have to restore I can figure out what it is exactly I did to get the backup working in the first place.

  • Launch SQL Server Management Studio (go get a cup of coffee while you wait for it to load)
  • Connect using whatever credentials give you some pretty hefty rights to the database or databases you want backed up.
  • Drill into the Database server, Databases menu items, then right click on the database you want to work with, select Tasks and Back Up…
  • The only thing you should have to change in the resulting dialogue is where you want it saved. The default will work fine, but as mentioned I recommend keeping backup scripts and backup files in 1 easy to find work area. For me it’s going to be nice and easy “c:\dbbackups”. There may be performance or capacity implications you’ll have to take to mind in your environment. Also if you do like me and create a folder at the root it’s a good idea to pair back the root permissions on that folder.
  • Don’t hit OK, that will back up your database, not necessarily what you want now. Tap the down arrow near the Script button at the top of the dialogue and choose “Script action to file”. For me I’m putting it in the folder mentioned before.

Step 2 is to create a script or batch file or something that Bareos can call to have the backup run. The file you execute should not complete until the backup file is created so that Bareos doesn’t try to backup the file until it exists. I believe Bareos even halts and “fails” the backup if the return status from the script is not 0, I’ll probably verify that later. Mine is a simple file that deletes yesterday’s backup then creates today’s backup:

erase "C:\dbbackup\*.bak"
sqlcmd -E -i "C:\dbbackup\backup.sql"

I could add more logic here, but it seems I don’t need to. This has been reliable for me in the past.

Next Step is to configure the backup FileSet, Job and Schedule. Here are what mine look like:

FileSet {
  Name = "c_dbbackups"
  Include {
    Options {
      Signature = MD5
      Drive Type = fixed
      IgnoreCase = yes
    }
    File = c:/dbbackups
  }
}
Job {
  Name = "hostname_db"
  Type = Backup
  FileSet = "c_dbbackups"
  Schedule = "NightlyFull_2000"
  Storage = File
  Messages = Standard
  Priority = 10
  Pool = Database
  Client = "hostname-fd"
  ClientRunBeforeJob = "c:/dbbackups/backup_db.cmd"
}
Schedule{
  Name = "NightlyFull_2000"
  Run = Level=Full sun-sat at 20:00
}

The obvious key component is the ClientRunBeforeJob directive in the Job definition. This makes sure to run the MS SQL backup prior to running the Bareos file backup.

I should mention the reason I’m doing Full nightly… obviously this method could be renamed cheapass backup. As such there is no interaction between the actual SQL backup and the file backup Bareos is performing. You could do a differential backup (and I have in other installations where bytes are more scarce and databases are bigger) but the actual differential part of it is done way back in step one when you’re creating the MSSQL backup script. If you do this I recommend backing up to a separate file in that same all encompassing directory, that way all the crap you need is there, the scripts, the full, and the diff. If you’re backing up a 500GB DB and you only have a couple T to store to… you’ll have to do something like this.

And then we test… Did you expect this error, I did?

ClientBeforeJob: The server principal "NT AUTHORITY\SYSTEM" is not able to access the database "DATABASENAME" under the current security context.

So last step is we have to run that .CMD in a security context that has rights to backup the database. The easy solution is to go back into your SQL Server Management Studio, expand the DB server, Security, and Logins then right-click on NT AUTHORITY\SYSTEM and open the properties dialogue. In there highlight Server Roles in the left pane then check sysadmin in the right pane.

 

After this you can login to BAT or bconsole or however you choose and test your job again.

Of course even if it appears to work, you should test your restores, which is a whole different ball of wax. If you’re lucky like me you have a test server that you can do your restore to since testing restores on a production MSSQL system is an absolute bear. Remember, if you haven’t tested restores, you don’t have backups!

Ghastly cursor performance XenApp 6.5 –> RDP –> 2012 Server

Unfortunately since XenApp 6.5 doesn’t support 2012 we’re forced to use RDP to access those desktops instead of just publishing them as desktops. It sucks, but it is a tolerable situation – until you actually do it. The cursor performance for me by default was terrible. I felt like I was working on an X-client hosted from Germany. Typical behavior for the cursor when in an RDP session is that it moves as fluid as on your own desktop, not so with 2012. I thought maybe the solution was to upgrade to Remote Desktop Client 8 on the XenApp host since RDPing straight from my PC (across the Internet) yielded fine results. That had no useful affect. The solution ended up being a simple UI change on the client end.

 

“Enable pointer shadow” UNCHECK IT! Night and day, try it.

As a funny aside, if I had a 2008r2 RDP window open inside the 2012 RDP window, the behavior inside the RDP inside the RDP was normal and good. Once I “cursored” out of the RDP inside the RDP into the upper level RDP behavior got funky again, whatever.

Friday the 13th – the day of reckoning

The 13th of September 2013. It was all about removing one item from my bucket list, that item being an Iron Maiden concert. They say it’s not about the destination, but the journey. Thank goodness that’s rubbish because this journey sucked, thank goodness also – Bruce and company more than made up for it. If the end goal of this trip was related to any band besides one of my big 3 (AC/DC, Scorpions, Maiden) I probably would never have went to a concert anywhere again in my life.

Before our trip even started it was being riddled with detriment. Originally the trip was supposed to occur on a couple of days when Owen would be with his dad so we wouldn’t have to worry about finding someone for him to be with. As always plans change, things get complicated. The good news is Casey’s family was helpful and graciously accommodated us.

Potential showstopper number 2 was when Grandma got sick 2 nights before departure. On my way out of the house Wednesday morning I found grandma worshiping the throne. That situation didn’t really get great at any time prior to departure, but we left anyway. She assured us she was going to be OK and sent us on our way. We got her squared away with my spare phone so that we could call and check on her. I was worried with Grandma’s ability to do the slide to answer an iPhone, but Deb got her trained up and she did succeed; we got in touch of her a couple times while we were away.

The dog was a mild nuisance. Because grandma was sick we didn’t want to burden her with Porter. I was confident enough in the mobility that grandma was exhibiting to just tell Deb to scratch the last minute attempts at finding boarding for him. He was apparently missing a shot and it was going to be way too big of a hassle to make that happen prior to departure, we’d almost be better off paying to have him come with us.

Next travesty is my own sickness. My own sickness wasn’t going to stop the journey, no chance. However it did take its toll on me the entire time. Every successive decent from cruising altitude became more and more painful. My sinuses were trying to push my eyeballs out of my head. I was crying, I was using my own shirt to blow the crud out of my nose, anything to relieve the pain. The most helpful thing was deep breathing the cool processed air coming from the vent above.

The last surprise PRIOR to departure happened while checking in for our Spirit Airlines flight. The flight was cheap, really cheap compared to the normal big carriers such as Delta, US Airways, etc. I was hesitant, but the decider was that they offered the best flight schedule for us. Leave Friday morning and arrive in LA just in time to be a little late to the concert, then leave Saturday morning not too early, but not so late that we’d get back to MSP sometime Sunday. The shocker was at check-in. Apparently nothing is included with your flight on Spirit Airlines, including the seats. I had to pay extra money to be able to choose my own seats. There was a random option, but I was afraid that me and my lovely gay wife would be *randomly* separated. Seats were no less than $10/flight for each person for each flight. Add in the cost I had to pay to check 1 single bag (even carry-ons weren’t free) and my add-on bill for using Spirit Airlines was $158. It still ends up being far cheaper than doing a big-name carrier’s flights, but it was a surprise.

With all the situations standing in the way of me and Iron Maiden even prior to departure, I’d hoped it would get easy after departure, heavens… I had gotten an E-mail prior to us even departing that our connecting flight from Vegas to LAX was delayed by 70 minutes. This adds 70 minutes to how late we’d be arriving at San Manuel Amphitheater, but I wasn’t worried yet. There were 6 names on the ticket, and while I would have loved to see them all, the headliner was my only drop-dead concern.

We landed in Vegas with no real outstanding problems other than my annoying sinus explosion. Once off the plane we searched food. Vegas’ airport is not arranged in such a way that once you get past security you can visit all terminals without leaving the secured area so we were limited to what was in our terminal. We went to a bar with grab & go stuff, but weren’t served so we left. Next shot was this place that specialized in cheese steaks. For specializing in them they were pretty lackluster, but they did fill our stomachs.

Not long after we finished eating I got an E-mail that read “Your flight to LAX has been delayed 3 hours.” I am very thankful that Kayak e-mailed me this, GO KAYAK. When I approached the person at the service desk she had no knowledge of the new much longer delay, who knows how long we would have sat there had I not gotten that E-mail. Now we have a real problem… There was no way with the 3 hour delay and traffic exiting LA around that time of day on a Friday would we be able to make it to the concert on time. The hail-mary was to rent a car and drive to San Bernardino.

So we did. The car was a very base model Hyundai Accent, a real steamer. I’m generally not one who gets excited about an under powered car as I’m not one who gets in a huge rush to get anywhere. This was a whole new level of under powered though. The car required entire ramps to get up to freeway speed. Going through the hills on I-15 it sometimes had to downshift twice to maintain highway speed. It had no cruise control – not a phenomena I was elated with given that it lacked the power to maintain consistent speed and I was on a long highway drive. The radio selection sucked (not the car’s fault), the iPod connection didn’t work (the car’s fault). I guess 2 good things were I didn’t have to descend from 35,000 feet and traffic was pretty light.

Our 200 mile journey from Las Vegas to San Bernardino ended with a little snag that did nothing more than miss us the first half of Anthrax’s set, something that I really don’t care about as Anthrax was the band on the ticket I was least interested in. Deb’s iPhone chose to lead us to San Manuel Stadium as opposed to San Manuel Amphitheater, 2 very different venues that are separated by about 20 minutes of driving, thus adding about 40 minutes to our late arrival.

We found our way to the correct venue, got parked, got out of the car, changed into our concert clothes, walked certainly no less than a full mile from where we parked to where the action was taking place. No snags with pat-downs or ticketing. We did have to wait in pretty substantial lines to access ATMs, but that was to be expected and unfortunately I was too frazzled to think of it prior to our departure from the airport. We got beer and made our way to our seats just in time to watch Megadeth! It wasn’t amazing as I’m not the biggest fan ever, but sounded better than when they were in the Carlson Center and I had beer and my favorite person there with me which was a welcome change.

There isn’t much to say about when Iron Maiden came on. The set lasted what I feel was probably 90 minutes, maybe a couple hours… however long it was I was left totally happy even after all I’d went through to get there. For that period of time I found pure bliss.

The rest of the night was rough, but with a warm hotel bed waiting for me I was determined to get there. I would guess it was 2 hours easy from the time the show ended until we got on the highway, then it was another 75 minute drive to the hotel. I was tired so this obviously seemed to take forever, one of the longest forevers I’ve ever experienced. Upon arrival the hotel clerk let us park right where registration parking was so I went to the room, jumped through the shower to calm my nerves and sinuses then hit the sack for 4 hours – had to be up at 7 to get back on the plane and head home.

The trip home was totally event-free, thank goodness. I am happy to be home on Sunday and have this extra day to regroup before going back to work. It’s stunning to me to think that my trip to Budapest to see the Scorpions was so much simpler logistically than this was. It was totally worth it and if I knew what I was getting into I’d do it all over again.

The New Flowerbed days 1 & 2 progress

I don’t have any exercise numbers to add to the Biggest Loser contest for the weekend. I think I’m going to mark a good 180 minutes anyway. I was sweating buckets while moving dirt, tamping and then stacking the wall blocks.

image

I should have gotten good before pictures, I didn’t. Oops. I suppose I should mention that the goal wasn’t necessarily to build a retaining wall flowerbed box thingie, but rather I wanted to get the retaining wall blocks that were delivered to me some months ago off pallets, out of the driveway and into their proposed useful resting spot. I was less than 1/2 successful in this endeavor as I still have a pallet and change of bricks left.

image

You can see the intention is for the wall to go all the way around the Flowerbed. It’s not good practice to do landscaping above the sill plate. Also I need to maintain a path for the rain-gutter to get away from the house.

image

Lots of tamping. I didn’t start with gloves on… Plenty of blisters.

image

Well here is what I think the finished product will be.

image

I’m going to try and level the tops a bit, definitely in that corner where the cinder and wall blocks meet.

image

After getting the wall built I spent another hour or so sifting landscaping rock out of the dirt contained within. It seems the prior homeowners redid this Flowerbed a number of times. I found quite a number of layers of fabric and extra rock. I could sieve rock out of this ground forever it seems.

I don’t have a great way to haul fill dirt, nor do I have a great source yet. I’ll work on both of those problems during the upcoming week.

And lastly, I have a picture of the bricks being delivered. The forking truck was a surprise. When the guy pulled up I was like “WTF, I didn’t pay too have these delivered so I could unload them by hand.” The Eastern European delivery driver was a nice guy. Go Menards.

image