Tag: T-SQL Tuesday

  • Automation Ideas for T-SQL Tuesday #130

    tsqltuesdayThis month we have another great T-SQL Tuesday topic, and again, a host that I pressured into writing the invitation. Elizabeth Noble (@SQLZelda) and I were talking DevOps last year at a SQL Saturday, just as she was effecting some change at her employer. At an event later in the year, I challenged her to host, and here we are, with a great topic, Automation.

    That’s this month’s invitation. Elizabeth describes the process of using automation to smooth out their deployments to SQL Servers. They slowly built a CICD pipeline and migrated projects over and over to save her time.

    This month, what have we done to automate things? I have a few stories.

    Automating Data Collection

    One of the things that I am passionate about is the SQL Saturday events. I loved that PASS maintained a site, and made a feed of event data available, but over time, we’ve lost some data and I don’t think there is much impetus to maintain this over time.

    As a result, I build an automated process to grab data from the feeds and save it as an XML file on my local machine. I have the basic code up at GitHub, though I need to improve and refactor it a bit. These files change as the organizers update them, so I need a good merge process. Right now I tend to delete all 1-2KB files periodically, as the file is built once the event is approved. However, until all the speakers and sponsors are scheduled the file size is just a few KB. Most events are > 100KB once they are set.

    This is a basic way of grabbing some data, and I’m looking to build a few more data collection processes to grab data in my life and keep it around, just in case some service I use goes kaput.

    Automatic Databases

    I work at Redgate, and one of the things I’ve been spending more time doing is the automation of databases for development with the latest code and test data. This is a challenge, but a few of the things that I’ve done with Redgate that help are as follows:

    1. Use Powershell to automate the creation of SQL Clone images.
    2. Use PowerShell to update SQL Monitor alert values and add instances
    3. Use Flyway in a container to deploy changes
    4. Use our SQL Change Automation cmdlets to deploy changes to databases

    All of these items can be automated so that a user just needs to run a script, or sometimes just click a button.

    I’m slowly getting the PoSh code up on GitHub as I build demos and help customers get things done. Right now, getting organized is the biggest part of my job, because I find these questions coming over and over.

    I’m a bit proponent of DevOps and automation. Use tools and computers to do the tedious, repetitive work. Keep your day focused on solving problems and building/improving scripts.

  • My T-SQL Tuesday #129 Time Capsule

    This month the T-SQL Tuesday invitation comes from tsqltuesdayTamara Clark. I strong-armed Tamara last fall, along with her husband, into hosting this year. She came through, with a great topic given the state of the world.

    She asks us to write about what we’d put in time capsule, the items or information that goes into a #sqlcommunity bucket. In some sense, this invitation reminds me of Brent’s reminder post to himself.

    Memories of 2020

    What do I remember about this year? First, a lot of vacation for me. My employer, Redgate Software, gives a sabbatical every five years. It’s a great perk for employees that stick around, and it has helped me recharge and refresh. I think I was the last one to get a sabbatical this year while the offices were open, however, there are other companies that take care of employees, and my first memory is a reminder of this. Maybe some future person opening this capsule will think about asking their organization for this.

    The second thing is that I won’t go into an office this entire year. I didn’t get any visits before lockdown, and we’ve closed our offices for the year. That’s a first for me in over a decade. However, the next thing I want to remember from this year is that so many companies are realizing that work from home (WFH) not only works, but lots of people are very productive. We can rethink our costs in buildings, commutes, living locations, and more. Redgate has traditionally not allowed anyone to avoid the office. There are a few of us that have been exceptions over the years, but 90% of our employees have been expected to show up at the office every week.

    That’s changed, and it will change our culture and organization in the future.

    The last thing to put in this time capsule is the importance of social contact and togetherness. I’ve missed a lot of this across the five months, to the point I work to see some people locally every couple weeks. I love my family, but I miss the social contact I used to get regularly, whether traveling to a SQL Saturday, visiting an office, maybe working in a library or Starbucks for a few hours, or just at a movie theater.

    We need more social contact, or at least, I do.

  • T-SQL Tuesday #128–Learning From Others

    tsqltuesdayIt’s the second Tuesday of the month and time for T-SQL Tuesday again. This month I’m grateful that Kerry Tyler is hosting. I had the pleasure of sitting with Kerry and his wife at a SQL Saturday last year before the world locked down and presented travel. At the time I was looking for hosts and pressured a few people into agreeing to host a month.

    This month Kerry wrote an interesting invite based on his passion with airplanes and flying. Mistakes and errors with planes can be catastrophic, so they are always revisiting issues and learning from others. He asks us to do the same this month.

    Root Cause Analysis

    One of the things that we talk about in technology is analyzing incidents and failures to determine a root cause. Despite the talk, relatively few places I’ve worked in actually perform a root cause analysis and produce actions that are taken into account in future protocols, processes, and documentation. Too few people perform a blameless postmortem, which is what we need more of.

    And too few companies share their learnings publicly.

    I can’t change that, but I can think forward.

    DevOps

    I talk a lot about DevOps and work with companies to transform what they do. This is part of my job, but it’s also an area I have passion in because I’ve worked in organizations that were following the tenets of DevOps before the term existed. A couple of areas where I learned from others to build better systems for the future.

    Networking is something that relatively few of us deal with as technical professionals. Since DHCP became a very solid platform and the amazing growth of wireless, we don’t need to dig into networking most of the time. However, understanding how DNS works and the networking protocols is still relevant.

    I was fortunate to work with a talented network engineer at one company. We were having issues with a client being able to connect to our database server, and he managed to show us how the DNS records were different between our office and theirs, when working across a VPN. Since then, I’ve always learned to check simple things, with tools like nslookup, to verify a client can see a server.

    As a data professional, I know backups are important. I use BackBlaze at home, but at work I often deal with a variety of products, even with SQL Server. While the backup process has been very consistent and stable in SQL Server, we’ve had different options emerge, as well as third party products that sometimes deal with backups in a different way. I’ve often insisted on verifying that we can restore databases to a point in time, precisely because this is what will be required during some DR incident.

    Over the years, many people have helped me understand how their product or system worked, too many to name, but I’m grateful for those that have helped explain to me exactly how a particular backup or restore process works and helped me validate the process to recover data.

    For the most part, I’ve just been the one pushing to ensure documentation was captured and available for others to use in the future.

    I do try to give back and teach others as well. I’ve been writing about Version Control Systems, including some basics I’ve learned over the years. Sometimes by reading a tutorial or blog, sometimes by making mistakes and trying to work through documentation. My learnings from others inform most of the content I produce to teach you, so it’s not that I’m doing anything innovative; I’m translating the lessons from others and myself for you.

    We all learn from others. We stand on the shoulders of giants and of ordinary people. Remember that, continue to learn, and help others where you can.

  • T-SQL Tuesday #127–Non SQL Tricks

    tsqltuesdayToday is T-SQL Tuesday, with this month being hosted by Ken Fisher. This is an interesting topic, looking at tips, but ones outside of SQL Server. Since many of us are data professionals, I think this is a place where I might learn a few things from others. Looking forward to the recap.

    I spent a number of years working in network administration and desktop work, as well as some software development teams, so I have to think about what I think makes a good tip.

    A Quick Fix with Contig

    One of the problems with a machine that runs out of memory or disk space is that it will act slow and suspicious. It often isn’t obvious that you’ve run out of resources, since we often don’t think about a slow degradation for RAM or disk space. Usually we’re looking for a runaway process, a virus, or something else. I’ve been surprised sometimes that I spent an hour, or watched someone else do this, before checking disk space.

    These days Windows is better about warning us when space is low, but it can be easy to ignore this or defer action until a later time when you’re busy. This tip won’t help you with RAM, but it can help with storage, which often affects things like pagefiles.

    Contig.exe is a utility from the Sysinternals utilities. It is designed to defragment files, but it can be used to create new files. Of whatever size you want. I’ve written about this before, and I use this on my machines. Whenever I get a new drive, I usually make 10 new files, each 1GB in size and keep them around. This post reminded me to do this on a new drive.

    2020-06-02 21_03_35-SanDisk1MB (E_)

    If I run low on space, I can get 10GB back quickly, without searching my filesystem for something to delete.

    You could do the same thing with a large ISO if you want, but keeping a file ready to delete can be handy. It always seems I run out of space when I’m in a hurry to get something else done.