Tag: syndicated

  • Hands off dbatools updates

    I really like the dbatools project. This is a series of PowerShell cmdlets that are built by the community and incredibly useful for migrations between SQL Servers, but also for various administrative actions. I have a short series on these items.

    One of the downsides of an active project is that updates happen often. I know when I’m working with new versions of Redgate tools, they’ll deliver new builds to me every day if I want them (I usually don’t).

    With dbatools, I find a similar issue, though at a slightly longer scale. I’ll see a tweet or post about a new cmdlet, only to find out that I don’t have the newest version. As a result, I need to update my modules, which means I need an elevated command window, which is distracting.

    I saw a post about someone that built a SQL Agent task to update their server, which I was thinking to do until Anthony Nocentino pointed out Watch-DbaUpdate.

    Install-DbaUpdate

    There’s actually a cmdlet that does what I want. It’s Install-DbaWatchUpdate, and it’s designed to setup a scheduled task that calls Watch-DbaUpdate and updates the module. That’s what I want, so I decided to check it out.

    First, I looked at Scheduled Tasks. In Windows 10, this is the Task Scheduler from the Start menu, and surprisingly, lots of software uses this. Google, Adobe, Microsoft, etc.

    2018-05-22 16_20_00-Task Scheduler

    I then tried the –WhatIf parameter for Install-DbaWatchUpdate, but it didn’t work. I know this is a fun cmdlet, but this should work.

    2018-05-22 16_21_02-cmd - powershell (Admin)

    In any case, let me just run it. I don’t get much detail back.

    2018-05-22 16_23_34-cmd - powershell (Admin)

    If I refresh scheduled tasks, I see a dbatools version check.

    2018-05-22 16_23_50-Task Scheduler

    If you look at the details, this is triggered at midnight and runs once an hour. The PoSh executable is called and it in turn calls the Watch-DbaUpdate cmdlet, which checks for a new version and should let me know if there are updates. Since I’m at the latest version, I’ll have to see if this works.

    So far, so good.

    I even tested the Uninstall-DbaWatchUpdate and it does remove the task.

  • One Week to Music City Tech

    Next week is Music City Tech, a three day conference consisting of Coding, Agile, and Data tracks, takes place in Nashville on May 31-June 2. There are a lot of great sessions on the schedule, covering a lot of software development topics.

    I’ll be delivering two talks, one on DevOps and one on security/encryption on Saturday. I’m looking forward to the conference, with some great .NET and development talks on Thursday and Friday, with a nice spread of data talks on Saturday.

    If you’re near the area, you can get tickets for a very reasonable price for the conference. I hope to see you next week.

  • Jobs in PoSh to Create a Load

    I saw this from Argenis Fernandez, and thought it was wonderful.

    1..128 | % { start-job -name ‘job name’ -scriptblock { & sqlcmd -S instanceName -U sa -P ‘iLovePoSh’ -i /home/username/test.sql } }

    Create 128 threads, each running a background job in PowerShell to connect to an instance and run a script file.

    Start-Job is used to begin a job, and then you can get information from Get-Job and use Stop-Job to turn things off.

    Very cool. Looking forward to trying to use this in a demo and make things happen.

  • Update Oddness for SQL Server

    I’ve been meaning to patch some of my development instances. With a little spare time while doing other work, I started the process the other day. My first step was to patch SQL Server 2016 with SP2.

    This went as many patches have gone for me, which is fairly boring and easy. Other than having to wait to accept the R terms and then clicking next, it was quick. Afterwards I rebooted.

    Then things got interesting. I started the SQL 2017 CU6 patch. This extracted, as other patches have, but then I got a message that I wasn’t running this under enough permissions. To be clear, after extraction, the SP2 patch did give me a UAC prompt.

    I stopped and then re-ran the patch, right clicking and running as administrator. After a few Nexts, I got this screen:

    2018-05-21 14_47_47-Install a SQL Server 2017 update

    I haven’t seen a patch ask me to stop SSMS. I’m still not clear if this is necessary, but I did stop SSMS. The patch worked fine, and strangely, re-running the patch later didn’t produce the same messages.

    Odd, but things seemed to work and my system was patched, though even without SSMS, I still had a pending reboot.

    Any thoughts or explantions appreciated.