Tearing down SQL Server Replication

I recently was engaged in updating the Compatibility Mode of our production databases to 110 (2012) in preparation for upgrading them all to SQL Server 2014. One of the production servers had a database named ‘distribution’ and, since I am most familiar with log-shipping, was unaware what the database was for I need to do […]

Using PSScriptAnalyzer

…for those of you that use Sapiens’ PowerShell Studio, there is a new feature available since version 5.2.118 that allows you to use PSScriptAnalyzer in the GUI. PSScriptAnalyzer is a module that you can run against your scripts and identify any code that is not in line with best practices. As with most code analysis […]

A new cmdlet: Get-ClusterActiveNode

Here is a small cmdlet I wrote to get the currently active node in a Windows cluster:

Using the cmdlet as displayed below: Views – 182

Using Get-ClusterNode

I was in the process of writing a few PowerShell cmdlets for a project I was working on and ran across this cmdlet for querying the active nodes on a Windows cluster:

Which returns: Ref: TechNet: Get-ClusterNode Views – 171

PowerShell Help Notes

A neat feature I just discovered was the -ShowWindow toggle when using Get-Help. This toggle allows you to redirect your output when using help for a cmdlet to a separate window, thus leaving your command-line screen uncluttered from the help output. Let’s look at an example:

Notice the items highlighted in the window. The […]

Manually removing log-shipping

I have had a number of situations where log-shipping broke and I needed to rebuild it but could not drop the log-shipping configuration from the primary SQL server. This often happens in my work environment where we have multiple business locations and I have found that I needed to use an FQDN or IP address […]

Resolving the “Backup detected log corruption in database”

I saw this in the SQL logs today. It looks like some corruption happened in the transaction log of a specific database. I saw a few different ways to approach this but saw the most common way (as a first attempt) was to simply set the database recovery model to SIMPLE, run a CHECKPOINT; manually, […]

MSDB is in “Recovery Pending” state

I had a SQL Server at work today where I found the msdb database in “Recovery Pending” state. After reading a number of blogs about it, and trying a few different approaches (the last resort going to be to have the Systems Admin restore the VM). I saw the article below and was able to […]

Moving the TempDB database to a new drive

Often you will need to add or move the tempDB data files, either to match the core count (up to 8 as best practice), or move them to an SSD or Flash card for performance. Below is a template script you can use. Just alter the drive letter, path and size to your standards and […]