Some useful Scripts

Spread the love

As a DBA/Developer, there have been many occasions where I had to write my own scripts/automation to fulfill specific business requirements.

Below are some of those useful scripts that I have created (and sometimes by updating other open-source scripts):-

-> Scripts to perform DBA Restore/Copy/Move for Database/Instance Migrations
-> Scripts to baseline your server, and Extract data for a variety of use cases
-> Scripts to troubleshoot SQL Server performance issue from inside SQL Server
-> Scripts to setup WMI based Blocking Alert
-> Scripts to setup manual LogWalk SQL agent job, with automatic alerting/troubleshooting/handling with Service Broker
-> Miscellanous Scripts like ‘powershell code for Disk File retention’, Getting data from table in HTML format etc
-> Indexing procedure [IndexOptimize_Modified] on top of Ola code to satisfy Replication/LogShipping/AG scenarios where too much log generation becomes an issue
-> Scripts for various Notification scenarios like long-running jobs crossing their own threshold time, monitoring agent job and stopping it post a particular time threshold, etc
-> Script to track server network availability by pinging the server(s) constantly every second, and keeping the data for 15 days
-> Script to create SQL Server Inventory using TSQL, SQL Server, Powershell, and various nice HTML mailers using dynamic querying of SQL tables
-> Script to monitor the health of SQL Server, and code to implement module signing to provide execution access to all DB users. (Disclaimer: only 10% of my work on this script)

SQLDBATools Powershell module – cmdlets to perform variety of DBA task that is not taken care of by dbatools module. Contains aggregators for SQLDBAToolsInventory as well.

Space Capacity Automation – automation designed to eliminate manual efforts on Space Capacity ESC tickets where DBA has to add new data or log files on a new volume, and restrict data or log files on the old volume. Apart from this, this procedure can be used for a variety of tasks related to capacity management.

I hope these are useful to other DBAs/Developers. Happy Coding 🙂

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.