PowerShell

Understanding I/O Freeze in SQL Server 2022's TSQL Snapshot Backups

SQL Server 2022 introduces a new feature to enable application-consistent snapshot backups. TSQL Snapshot Backups enable the SQL Server to control the database quiesce without external tools. Using TSQL Snapshot backups enables instantaneous restores, independent of the size of data, for a database, group, or server backups, including point-in-time recovery.

When you use this feature, it freezes I/O. You’ll see a record like this in your error log when you execute the command ALTER DATABASE TestDB1 SET SUSPEND_FOR_SNAPSHOT_BACKUP = ON. This blog post will show you that the I/O freeze is just for write operations. You can continue to read from the database during this frozen state.

Using the Pure Storage PowerShellSDK2 - Part 3 - Getting Performance Data from FlashArray

Welcome back to the third installment of our blog series on using the Pure Storage PowerShell SDK2. In this post, we’ll learn how to retrieve performance data from FlashArray and Cloud Block Store. Here, you’ll uncover the intricacies of extracting performance data across several object types, including Volumes and Hosts. We will dig into the object model that exposes crucial performance insights. Moreover, we’ll delve into the realm of performance analysis, addressing common customer questions such as:

Using the Pure Storage PowerShellSDK2 - Part 2 - Working With Data

Welcome back to the second installment of our series on using the Pure Storage PowerShell SDK2. In this post, we’ll dive into working with object data using Pure Storage PowerShell SDK2.

When it comes to manipulating data in PowerShell, the ability to effortlessly pipe objects and their associated data between cmdlets is a game-changer. However, when it comes to Pure Storage PowerShell SDK2, there’s an even more efficient way to handle this. By tapping into the REST API of your FlashArray and Cloud Block Store, you can significantly reduce the runtime of your cmdlet executions. This can be achieved by leveraging key functions such as sort, limit, and filter.

Using the Pure Storage PowerShellSDK2 - Part 1 - Connecting to FlashArray

Welcome to our blog series on using the Pure Storage PowerShell SDK2. In this series, we will provide you with practical insights and examples on how to harness the power of the Pure Storage PowerShell SDK2 to enhance your storage management capabilities.

Throughout this series, we will cover a wide range of topics, including performance data gathering, snapshot management, performance bottleneck identification, and resource management within your FlashArray and Cloud Block Store. I will guide you step by step, making complex tasks easier to understand and execute.

Getting SQL Agent Jobs and Job Steps Configuration

Recently I needed to take a look at all of the SQL Server Agent Jobs and their Jobs Steps for a customer. Specifically, I needed to review all of the Jobs and Job Steps for Ola Hallengren’s Maintenance Solution and look at the Backup, Index Maintenance and Integrity Jobs to ensure they’re configured properly and also account for any customizations and one-offs in the Job definitions. This customer has dozens of SQL Server instances and well, I wasn’t about to click through everything in SSMS…and writing this in TSQL would have been a good candidate for a Ph.D. dissertation. So let’s check out how I solved this problem using dbatools.

Speaking at PSConf EU 2020

I’m proud to announce that I will be speaking at PSConf EU 2020 in Hannover, Germany. The conference runs from 2 June 2020 to 5 June 2020 and brings together some of the titans of the PowerShell community and members of the PowerShell team from Microsoft. 

<p>
  This is an incredible event packed with fantastic, deep dive content. <a href="https://psconf.eu/schedule">Check out the amazing schedule</a>! Head on over to the site and <a href="https://psconf.eu/"><strong>register now</strong></a>!
</p>

<p>
  This year I have two sessions!
</p>

<p>
  On Thursday<strong>, 2 June at 13:00</strong> &#8211; I’m presenting “<strong>Linux OS Fundamentals for the PowerShell Pro</strong>”
</p>

<p>
  Here’s the abstract
</p>

<blockquote>
  <p>
    PowerShell and SQL Server are now available on Linux and management wants you to leverage this shift in technology to more effectively manage your systems, but you’re a Windows admin, Don’t fear! It’s just an operating system. It has all the same components Windows has and in this session, we’ll show you that. We will look at the Linux operating system architecture and show you how to interact with and manage a Linux system. By the end of this session, you’ll be ready to go back to the office and get started working with Linux.
  </p>
  
  <p>
    In this session, we’ll cover the following <br /> &#8211; Service control<br /> &#8211; Package installation<br /> &#8211; System resource management (CPU, disk and memory)<br /> &#8211; Using PowerShell to interact with Linux systems 
  </p>
</blockquote>

<p>
  On Friday<strong>, 3 June at 11:00</strong> &#8211; I’m presenting “<strong>Using PowerShell Core Remoting in Cross-Platform Environments</strong>”
</p>

<p>
  Here’s the abstract
</p>

<blockquote>
  <p>
    PowerShell Core is about choice and the transport layer for Remoting is one of those choices. In this session, we’ll look at Remoting in cross-platform environments, installing and configuring OpenSSH and how we can leverage Remoting to really scale up our administrative capabilities.
  </p>
  
  <p>
    In this session, we’ll cover the following<br /> &#8211; Cross-platform Remoting use cases<br /> &#8211; Configuring SSH based Remoting<br /> &#8211; Troubleshooting Remoting
  </p>
</blockquote>

<p>
   <a href="https://psconf.eu/"><img style="display: block; margin-left: auto; margin-right: auto;" src="https://psconf.eu/assets/svg/psconfeu-logo-blue.svg" alt="PS Conf EU logo" width="150" /></a>
</p>

Speaking at PowerShell Summit 2020!

I’m proud to announce that I will be speaking at PowerShell + DevOps Global Summit 2020 the conference runs from April 27th through April 30. This is an incredible event packed with fantastic content and speakers. Check out the amazing schedule! All the data you need on going is in this excellent brochure right here!

<p>
  This year I have two sessions!
</p>

<p>
  On Wednesday<strong>, April 29th at 09:00AM</strong> &#8211; I’m presenting “<a href="https://sessions.eventraft.com/PowerShell2020"><strong>Inside Kubernetes &#8211; An Architectural Deep Dive</strong></a>”
</p>

<p>
  Here’s the abstract
</p>

<blockquote>
  <p>
    In this session we will introduce Kubernetes, we’ll deep dive into cluster architecture and higher-level abstractions such as Services, Controllers, and Deployments and how they can be used to ensure the desired state of an application deployed in Kubernetes. In this session we will introduce Kubernetes, we’ll deep dive into each component and its responsibility in a cluster. We will also look at and demonstrate higher-level abstractions such as Services, Controllers, Deployments and Jobs and how they can be used to ensure the desired state of an application deployed in Kubernetes. By the end of this session, you will understand what’s needed to put your applications in production in a Kubernetes cluster
  </p>
  
  <p>
    Session Objectives
  </p>
  
  <ul>
    <li>
      Understand Kubernetes cluster architecture
    </li>
    <li>
      Understand Services, Controllers, and Deployments
    </li>
    <li>
      Designing Production-Ready Kubernetes Clusters
    </li>
    <li>
      Learn to run PowerShell in Kubernetes Jobs.
    </li>
  </ul>
</blockquote>

Restoring Backups from Azure Blob with dbatools

Recently I needed to write a PowerShell script that could build a backup set from a collection of backups stored in Azure Blob Storage without any backup history available from MSDB. And as with all things SQL Server and PowerShell related I went straight to dbatools.io to see if Restore-DbaDatabase was up to the task…and of course, it is…let’s talk about how I solved this challenge.

When restoring from Azure Blob, the main challenge you have is accessing the blobs and building a backup set. For this process, you’ll need access to the Storage Account via PowerShell and you’ll have to have define a Credential on your SQL Instance that has access to the Storage Account. Here’s the code I used to connect to my Storage Account in Azure.

OpenSSH Resources for Windows and PowerShell

Had a conversation with a good friend in the SQL Community about OpenSSH and how it fits as a transport layer for PowerShell Remoting. I pointed him towards several resources I have online. So here’s a post aggregating those resources.

If you’re looking to get started with OpenSSH on Linux and Windows Systems check out thisPowerShell Summit presentation I did in 2018. This covers OpenSSH in theory and practice.

Session: OpenSSH Internals for PowerShell Pros

Using PowerShell in Containers

The vision for PowerShell Core is to be able to run PowerShell anywhere. In this article, I’m going to discuss how you can use Docker Containers to enable just that. We’ll look at running PowerShell in a container, running cmdlets, running different versions of PowerShell at the same time, and also how to build our own “serverless” computing platform.

Let’s address a few reasons why you would want to run PowerShell in a container.