Author: way0utwest

  • Learning Goals–May Update

    It’s 5 months in, and this is hard. I find that the time I’ve picked each week sometimes gets bumped by other items, which do have a higher priority. More on this later.

    Extended Events

    An epic fail here for May. I started with one week and managed to get an hour watching part of a PASS session and building a few questions. However, the second week I got busy with some family stuff that impacted my work week. With deadlines and travel the third week, I skipped this.

    The third week I was gone, and the fourth, well, only a little focus, though I did start to write a short piece on using Jon Kehayias’ script to convert a trace to an XE session. We’ll see if I get this done.

    Fifth week, not sure. That Tuesday will be in the June update.

    Python

    Not a lot better than the XE stuff. Week one I had some family issues get in the way of my Friday learning and ended up skipping this as I was away from home. With a busy weekend, I didn’t make this up.

    Week 2 I was prepping for week 3. Week 3 I was gone.

    This brings me to week 4. While I like to try and do something, I really didn’t get much done during the week. I am looking to add Python questions to the mix on SSC, so I have taken a little time during the week to build a couple questions. Going through basics like lists and dictionaries helps me come up with things that I think people might not know and can get inspired to learn a little with a question. That helped me get a few things done this month.

    I did take time to go through part of a Pluralsight course in week 4, about 90 minutes of total time, some of that pausing the course so I could generate a question and practice some Python skills.

    I keep a few browser tabs open with Python links to try some problem solving, but I keep not making time.

    Moving Forward

    I didn’t travel much until mid May, but I had a very busy life outside of work and didn’t make much time to learn away from work. Fortunately my work is related to these topics, so I can take a little time for learning.

    As I close out the first half of the year, I’m somewhat disappointed with progress. I definitely continue to learn, as my job requires it, but I’m not getting the focused time in these areas. Looking forward to next year, I want to aim for topics that are more tightly integrated with work so that I get more practice. Here, even though I’m doing something, I’m not as focused.

    For June and further, I’m going to shift my times around and pick what I think are quieter times for me to get something done. Since I can ride a bike at home and watch Pluralsight, I’ll pick those times for at least passive learning. Then I’ll set aside a shorter time period, 30 minutes, for practice at other points in the week when I have found myself with time.

  • How Far Back?

    At the Redgate SQL Privacy Summit recently, there was panel I hosted that I thought was really interesting. At one point someone asked a question and there was a bit of a discussion about the right to forget in the EU. One of the fascinating things wasn’t about the rights, but about backups. One of our panelists noted that we often keep too many backups, most of which are really useless.

    This portion of the discussion started by asking how many backups people keep. Many of those in the audience kept many backups, sometimes dozens. Many of them had some rotation scheme that determined how many files were kept over time. I know I’ve worked in places where we kept over a week or two worth of backup files, often along with a monthly or quarterly backup for a year and then multiple year end backups in perpetuity. I guess since we didn’t really know how long those backups were valid as we just marked some tape as the end-of-year one and left it in a vault somewhere.

    What was also interesting is the panelist asked if many people had restored a backup more than a month old. Almost no one had, but a few had restored a year old backup. I think that’s common, and I find I’ve only restored one backup more than a month old. That one was actually for a legal case, and it was six or seven years old. I actually had to find someone at Microsoft that could provide us with an old version of an SP to restore the database.

    I’m wondering today about the rest of you. Not if you have done it, but would you do it today? How far back would you go for a backup of an important database? Assume this isn’t any requirement to find the data at a point in time, but for recovery purposes in a disaster.

    For me, I’d expect that most of the systems I’ve managed really would have struggled to go back a week. After that point in time, so many transactions are missing that there are serious repercussions. This is why I’ve often ensured I had automated restores happening all the time, since I need to be sure that we can restore from yesterday or two days ago. If I went back more than a week, it would be because we had corrupt backups. While the business would probably survive, I’m not sure my job would. If I hadn’t been able to produce a workable backup for the last week, I think most organizations would be justified in terminating me.

    Whether they would or not is another debate.

    Steve Jones

    The Voice of the DBA Podcast

    Listen to the MP3 Audio ( 4.4MB) podcast or subscribe to the feed at iTunes and Libsyn.

  • No More Downtime

    At one point in my career, I worked for a wealth management firm. We managed funds for various customers, a part of which was making trades in the financial markets. Various brokers and companies used our platform to run their business, and performance was always an issue. At the time we were an NT 4.0/SQL Server 6.5 shop, though we moved to Windows 2000 and SQL Server 2000 while I was there.

    While we were looking at upgrades, a number of potential customers asked why we weren’t using AIX or Solaris or Linux. Management would come to a few of us technical leads to ask, and we usually had to provide some justification. Our success was hit and miss, though we did run into a few companies that were doing real time trading on the Windows platform, and a few of us had the chance to talk to them about how they managed their systems in an age when Windows hosts often needed patching, a requirement of which was rebooting. If you’re interested, the company actually had a fairly server oriented architecture built on top of Windows, essentially managing work by just connecting to whichever boxes were running.

    Things have changed. These days Microsoft has been working hard to build a better Windows OS to power Azure and they’ve done some amazing work. I saw a post on one of the things they’re doing, which is finding ways to patch the underlying OS without disturbing applications, including VMs that are running on the host OS.

    The work is amazing to me, and this is where we should have been going with all operating systems. We ought to be able to patch these without downtime, and certainly without disturbing guests or programs that might be running. As this rolls out to Windows hosts in our data centers, I could imagine an era when we have monthly patches for Windows that never cause downtime for SQL Server.

    Well, I guess there is some downtime. Applications such as the hypervisor are paused, which some of us might consider downtime. However, if the time frame were in the single digits of seconds, I’m not sure many clients would this as downtime. It’s along the lines of a network hiccup or a momentarily busy server. In some sense, this would be a great move forward for HA.

    On the other hand, this would raise expectation. Clients and customers would be less tolerant of downtime, which is something we can’t control with Windows and SQL Server patches. However, it is something we can control with our deployments. A system that is almost never down because of patches would put pressure on us to ensure that our enhancements to the database itself also didn’t cause downtime.

    While there’s no magic in how we make changes to objects in SQL Server, there are techniques that can make changes in stages, perform additive work, and use automation in a DevOps style workflow to limit downtime and lower the risk of making changes. To me, this might be a bigger change than cloud systems. With that in mind, I’d urge many of you to learn techniques to avoid interrupting applications when you deploy changes. There are ways to do this, but it takes some effort and practice to build better skills and habits.

    Steve Jones

    The Voice of the DBA Podcast

    Listen to the MP3 Audio ( 4.8MB) podcast or subscribe to the feed at iTunes and Libsyn.

  • Cleaning up Azure Client IPs

    I travel around, and as a result, I may find myself accessing my Azure databases from different locations. Since it’s a quick click and login to add my IP from SSMS, I’ll end up with multiple ones. I don’t want to leave systems open for a long time, and certainly don’t want to just add 0.0.0.0 without good reason.

    As a result, I periodically clean things up. I’d like to do this after each trip, but I sometimes forget. Here’s how I do this in the Portal.

    First, I need to access my server, not my database. Servers are separate from databases, as you can see below. This isn’t an instance, but rather a logical construct for holding multiple databases.

    2018-05-22 08_26_04-Window

    From here, I get a list, and I can click one.

    2018-05-22 08_26_10-Window

    When I do this, I get the details of the server. On the right side of the overview are the firewall settings.

    2018-05-22 08_26_21-Window

    Click this and you see the list of firewall rules. Each of these has a name, a starting and ending IP range. You don’t really need to worry about this much if you’re a dev. If you want to give access to a group of IPs because your  company has them, talk to your network admin about the addressing.

    On the right side are three dots. Click these to get the delete option.

    2018-05-22 08_28_14-Window

    I click through these and it’s really quick. I can remove 10 IPs in about 20 seconds, so I don’t bother with too much automation here. I could use PoSh, but it might take me longer to figure out what to do than just click a few times.

    I can also edit a row. If I click the middle, I get edit boxes, and as you see, I can rename a rule that makes sense. I ought to do this for other times, but since I add access from SSMS in hotels, I don’t often go to the server at that time.

    2018-05-22 08_29_00-Window

    It can be a pain, and if I tended to work with a lot of different servers (I have 4), I’d likely automate this more.

    Actually I’ll automate it in another post as it’s a good skill to have.