Tag: syndicated

  • Moving to Rancher Desktop

    I’ve been very happy with Docker Desktop for years, running it on both laptop and desktop. However, a corporate decision was made to move to Rancher Desktop, so I now have an unexpected “opportunity” to learn something new.

    Here’s a short post on how things went on the desktop and laptop.

    Getting Rancher Desktop

    I had never heard of Rancher. I’ve met a number of Linux/Oracle people using Podman, but not Rancher. You can download Rancher from rancherdesktop.io. This is a project from SUSE, of the Linux distribution fame, and one of their many projects.

    The install is a next/next/next standard Windows MSI, though once installed, I found I needed WSL2 on my desktop. On my laptop, I ran wsl –v and saw this.

    2025-05_line0035

    On my desktop, I installed this first, and tried to get things going. It installed, downloaded some Kuberbetes things, asked me to use containerd or dockerd (I chose the latter), and then was running. Once the engine was up, my docker commands worked and I could start containers.

    However, there was a problem in that I had a volume (unnamed) that a few containers were using. However, after uninstalling Docker Desktop, I couldn’t find the volumes. I’m lightly concerned I’ve lost some data, which isn’t the end of the world, but it annoying.

    Learning From My Mistakes

    On my laptop, I decided to try and make this smoother. First, I uninstalled Docker.

    2025-05_line0068

    Next I ran the Rancher install.

    2025-05_line0069

    Once this installed, I started the desktop program. It again downloaded some Kubernetes components and then seemed to be up and running.

    2025-05_line0070

    I tried Docker components after starting the Rancher Desktop (RD), but before I realized it was downloading stuff. That was the docker error shown first below. The second one was once the online status was shown in RD.

    First Tests

    I have a few containers set up to run SQL Server with docker compose files. I have a batch file I double click for “docker compose up” (and another for down). I clicked one and saw this: images downloading.

    2025-05_line0072

    I assumed an image store would be an image store, but apparently not. Rancher must use a different place. That’s an interesting thing I need to check. Do I have extra images laying around. I think my Docker Desktop was using containerd, so maybe that’s part of this.

    I could connect from SSMS fine and I could see my container running in the desktop (I had to switch away from the Containers item and back).

    2025-05_line0081

    I also checked some docker commands and they seemed to work. I could get a list of containers, and apparently Rancher runs a bunch itself.

    2025-05_line0082

    I could also see logs from my container, which are handy at times when I need to try and debug an issue.

    2025-05_line0083

    Summary

    I have to admit that after a week, I’m still nervous. Losing a volume, whether it’s really gone or I just can’t find it, is disturbing. I hate losing data.

    Rancher seems to work fine for the basic things I do with containers, though the interface feels incomplete and simple. I can’t set hardware limits, it isn’t an active interface, and I feel like I’ve lost a lot of options. I didn’t really use more, but I still feel some loss.

    I haven’t heard internal complaints from anyone, so I’m assuming that most container based things still work. We’ll see how I like this across the next month.

  • The Third Sabbatical

    I can’t believe I’ve been at Redgate long enough to get a third sabbatical. I’ve very lucky to have this job, still enjoy it, and get the benefit. I’ve scheduled it from Jun 30 – Aug 8, and I’ll be gone from work during that time.

    The idea of the sabbatical is to get away from work and recharge. It’s an extended break, and while some people use this to further their career in some way, others just try to get away from their daily life.

    I wrote about a bunch of projects I had during my first one. The second one was less planned, but I also had a quick review of the time away.

    For this one, I have no great plans right now. In fact, life has been so busy this year, I haven’t even had time to think about what to do, but I didn’t want to delay things, so this was the best time to take it.

    I started this post to get me to at least lightly focus on the time and what the possibilities could be. For now, I have a few things to do:

    • Work with a contractor to replace the covering on our riding arena
    • Rebuild a better generator house and re-wire a circuit
    • Replace some damaged fencing
    • Rebuild 2 horse feeders
    • Organize the garage a bit more
  • Advice I Like: Focus on what’s important

    Don’t let someone else’s urgency becomes your emergency. In fact, don’t be governed by the urgent of any sort. Focus on the important. The urgent is a tyrant. – from Excellent Advice for Living

    I try to set my life up to be fairly relaxed. A little chaotically busy, but relaxed. I try to stay ahead of work, plan things, get them prepped, and beat my milestones, at work or at home.

    However.

    As some people might say, life happens. Others might use a different 4 letter word, but I’ve liked life. As John Lennon says: Life is what happens to you while you’re busy making other plans.

    I do try to help others and accommodate them, but another’s emergency isn’t mine. I am here for support, and to listen, but encroaching on my wallet or my time is something I have to choose to give you. Sometimes I might, but sometimes I might not. Ultimately. I don’t want to get jerked around by others, at work or in life.

    I try to remember what’s important, which might not be someone else’s thing. This might mean previous plans take precedence. Or it might mean that I decide to help with your emergency. The important thing is the important thing.

    I’ve been posting New Words on Fridays from a book I was reading, however, a friend thought they were a little depressing. They should be as they are obscure sorrows. I like them because they make me think.

    To counter-balance those, I’m adding in thoughts on advice, mostly from Kevin Kelley’s book. You can read all these posts under the advice tag.

  • Modifying a Trigger to Capture More Info: #SQLNewBlogger

    I had someone ask me about using triggers to detect changes in their tables. This is a second post looking at triggers, in this case, modifying my trigger to detect more changes and using that information.

    Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers.

    The Setup

    We’re using the same table from the last post.  This is the dbo.Customer table with a PK and 5 other fields.

    In this case we want to track the changes to an email and capture what those changes are. In other words, if I update the email from ‘sjones@sqlservercentral.com’ to ‘steve.jones@red-gate.com’, I want to capture

    To do this, let’s modify our trigger. We can still test if the field is updated with UPDATE(). We did this in the last post.

    This will let us know that the column changes by returning a boolean. If this is true, we want to insert the new values into our logger. We also want to capture the old value. These values are stored in the inserted and deleted tables, which are available in a trigger. I’ll use a join between these on the PK to get the same data from both.

    I’m also using a query with these tables because more than one row can be updated and we want to capture all the changes.

    Here is my new trigger, with the OR ALTER added to the code.

    CREATE OR ALTER TRIGGER Customer_tru ON dbo.Customer FOR UPDATE
    AS
    BEGIN
         IF UPDATE(CustomerName)
             INSERT dbo.logger (logdate, logmsg) VALUES (DEFAULT, 'dbo.Customer.CustomerName changed')
         IF UPDATE(AddressKey)
             INSERT dbo.logger (logdate, logmsg) VALUES (DEFAULT, 'dbo.Customer.AddressKey changed')
         IF UPDATE(CustomerStatus)
             INSERT dbo.logger (logdate, logmsg) VALUES (DEFAULT, 'dbo.Customer.CustomerStatus changed')
         IF UPDATE(CustomerContact)
             INSERT dbo.logger (logdate, logmsg) VALUES (DEFAULT, 'dbo.Customer.CustomerContact changed')
         IF UPDATE(ContactEmail)
         BEGIN
             INSERT dbo.logger (logdate, logmsg) 
             SELECT GETDATE(), 'ContactEmail updated from ' + d.ContactEmail + ' to ' + i.ContactEmail 
              FROM inserted i
              INNER JOIN Deleted d ON i.CustomerID = d.CustomerID
         END
    END

    This is mostly the same code, but now I’ve changed the last conditional test. If the email is updated, I want to query the inserted and deleted tables and create a log message. This is the type of thing I’ve seen often in systems, and while it’s not a great pattern, it does let me capture some information. There are some problems with this, I’ll discuss in the next post.

    We can see below that when I run this code, I get the updated captured and logged.

    2025-05_0230

    This post has introduced a few new things, the inserted and deleted tables, which I didn’t discuss in the last post. However, they are useful when you want to capture information affected in triggers, which can be more than one row. Using these tables helps you set up triggers that handle multiple changes.

    There are problems with this trigger, mainly with NULLs, potential performance, and architecture in what is captured, but we’ll address those in the future.

    SQL New Blogger

    This post looks at enhancing a previous post and providing more information. You (hopefully) learn from your work, from both feedback  and experiments, and you should modify your thinking and work. This shows how I’ve adapted something I did previously, which is a skill we all need.

    This was a 20-30 minute post for me. You could likely do it in a similar amount of time.