Some useful Scripts

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):-
https://github.com/imajaydwivedi/SQLDBA-SSMS-Solution

-> Scripts to perform DBA Restore/Copy/Move for Database/Instance Migrations
https://github.com/imajaydwivedi/SQLDBA-SSMS-Solution/tree/master/Backup-Restore
-> Scripts to baseline your server, and Extract data for a variety of use cases
https://github.com/imajaydwivedi/SQLDBA-SSMS-Solution/tree/master/Baselining
-> Scripts to troubleshoot SQL Server performance issue from inside SQL Server
https://github.com/imajaydwivedi/SQLDBA-SSMS-Solution/tree/master/BlitzQueries
-> Scripts to setup WMI based Blocking Alert
https://github.com/imajaydwivedi/SQLDBA-SSMS-Solution/tree/master/Blocking%20Alert
-> Scripts to setup manual LogWalk SQL agent job, with automatic alerting/troubleshooting/handling with Service Broker
https://github.com/imajaydwivedi/SQLDBA-SSMS-Solution/tree/master/LogShipping
-> Miscellanous Scripts like ‘powershell code for Disk File retention’, Getting data from table in HTML format etc
https://github.com/imajaydwivedi/SQLDBA-SSMS-Solution/tree/master/Misscellaneous%20Queries
-> Indexing procedure [IndexOptimize_Modified] on top of Ola code to satisfy Replication/LogShipping/AG scenarios where too much log generation becomes an issue
https://github.com/imajaydwivedi/SQLDBA-SSMS-Solution/blob/master/OlaHallengren.com/%5BIndexOptimize_Modified%5D.sql
-> 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
https://github.com/imajaydwivedi/SQLDBA-SSMS-Solution/tree/master/SQL%20Jobs
-> Script to track server network availability by pinging the server(s) constantly every second, and keeping the data for 15 days
https://github.com/imajaydwivedi/SQLDBA-SSMS-Solution/tree/master/SQLAgent-Notifications
-> Script to create SQL Server Inventory using TSQL, SQL Server, Powershell, and various nice HTML mailers using dynamic querying of SQL tables
https://github.com/imajaydwivedi/SQLDBA-SSMS-Solution/tree/master/SQLDBATools-Inventory
-> 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)
https://github.com/imajaydwivedi/SQLDBA-SSMS-Solution/tree/master/sp_HealthCheck

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.
https://github.com/imajaydwivedi/SQLDBATools

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.
https://github.com/imajaydwivedi/Space-Capacity-Automation

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.