Using Replication to keep your Admin Scripts Current

We all have handy scripts that we want present in our SQL Server database instances. Examples would includesp_WhoIsActive, sp_Blitz, sp_BlitzCache, Ola's maintenance scripts or custom scripts like Estimated Time to Complete. But how do you keep all your instances updated when new versions are released? You certainly don't want to run the updated scripts on each instance one-by-one, especially if you manage quite a few instances. One way to keep them in sync is by using a Central Management Server (CMS) and running the updated script on multiple instances at once. However, what if there are some instances that you don't really want or need to deploy the scripts to? That was my situation, so I opted to use SQL Server Replication to keep my scripts in sync.

I personally have an instance that I call my "UTILITY" instance. I use this instance as my CMS. It's also where I store all my monitoring databases like Spotlight, utility databases like ClearTrace and most importantly - my central DBADB. I have a DBADB in every instance I administer. It's a place to keep all your DBA related scripts and tables (maintenance logging tables, sp_BlitzCache output, harvested wait stat data, etc.) and you can have peace of mind that nobody else is going to go in there and mess with them. I then created a publication on my DBADB, selected only the stored procedures that I want to deploy and set up subscriptions to all the target instances. With just a few clicks of the mouse, I was able to deploy out the latest and greatest version of all my administrative scripts.

Full post:

To view or add a comment, sign in

More articles by Allen McGuire

  • Identify and Retry Failed Backups using Ola's Solution

    I ran into a situation where a database backup would fail due to a network error - specifically "Operating system error…

    1 Comment
  • Using Synonyms with Availability Groups

    I'm a big fan of using synonyms to point to objects in other databases, but if you've tried to use them in conjunction…

  • Monitor and stop long-running SQL Server Agent Jobs

    In recent days I've been having a periodic issue with the distribution cleanup job for replication. The vast majority…

    1 Comment
  • VMware Host Performance and Configuration Reports

    So you are a DBA and you are in a virtual environment - VMware in particular. You are curious to know the health of the…

    1 Comment
  • SSMSBoost - A Productivity Tool

    Today I typed up a little "tips and tricks" document for the various teams I work with and figured heck, why not share…

  • Work Smarter, Not Harder - The UTILITY Instance

    If your a SQL Server DBA, chances are you've walked into environments that were pretty disorganized to say the least…

  • My (SQL Server) DBA Toolbox

    We all have favorite administrative scripts, utilities, monitoring software and other items in our "toolbox" that we…

    4 Comments
  • Changing the Default Installation Paths for SQL Server

    There are often times where you need to move all the files and SQL Server objects from the default installation paths -…

    3 Comments
  • Consolidate your Reports with Dynamic Data Sources

    I love writing SSRS reports that assist me in consuming data across my instances. In some cases I set up subscriptions…

  • Reporting on sp_BlitzCache Results

    Regularly examining the plan cache in your database instances is a must, as there is a wealth of useful information…

Explore content categories