Skip to content
A set of scripts and jobs to help you manage SQL Server from end to end
PowerShell
Find file
Failed to load latest commit information.
CATSQLServerDataGathering lots of powershell scripting Apr 5, 2013
.gitignore Inital Check in. Jun 20, 2011
DatabaseDetailsps.ps1 lots of powershell scripting Apr 5, 2013
GetAgentDetails.ps1 lots of powershell scripting Apr 5, 2013
GetDatabaseInformation.psm1 lots of powershell scripting Apr 5, 2013
IndexFragmentationLevelsps.ps1 adding powershell scripts Feb 21, 2013
IndexUsageStatisticsps.ps1 adding powershell scripts Feb 21, 2013
Management.BlockingChains.sql added job schedules Feb 13, 2013
Management.CreateManagementDatabaseObjects.sql lots of powershell scripting Apr 5, 2013
Management.DBProperties.Table.sql lots of powershell scripting Apr 5, 2013
Management.GatherDatabaseMetadata.sql added job schedules Feb 13, 2013
Management.GatherDatabaseSpaceDetail.sql adding powershell scripts Feb 21, 2013
Management.GatherDatabaseSpaceDetailps.sql adding powershell scripts Feb 21, 2013
Management.GatherIndexFragmentationLevels.sql added job schedules Feb 13, 2013
Management.GatherIndexFragmentationLevelsps.sql adding powershell scripts Feb 21, 2013
Management.GatherIndexUsageStatistics.sql added job schedules and conformed all scripts to the same standard Feb 13, 2013
Management.GatherIndexUsageStatisticsps.sql adding powershell scripts Feb 21, 2013
Management.GatherSQLAgentJobInformation.sql added job schedules Feb 13, 2013
Management.GatherSQLAgentJobInformationps.sql adding powershell scripts Feb 21, 2013
Management.GatherServerMetadata.sql lots of powershell scripting Apr 5, 2013
Management.GatherServerWaits.sql added job schedules Feb 13, 2013
Management.GatherServernameps.sql adding powershell scripts Feb 21, 2013
Management.GatherStatisticsInformation.sql Adding GatherStatisticsInformation, GatherIndexFragmentationLevels, G… Jul 3, 2011
Management.GatherStatisticsInformationps.sql adding powershell scripts Feb 21, 2013
Management.GatherTableMetadata.sql Add GatherDatabaseMetadata updated GatherTableStats and GatherTableMe… Jun 30, 2011
Management.GatherTableStatistics.sql Add GatherDatabaseMetadata updated GatherTableStats and GatherTableMe… Jun 30, 2011
Management.GatherTableStatisticsps.sql adding powershell scripts Feb 21, 2013
Management.VirtualFileStats.sql Inital Check in. Jun 21, 2011
NetworkMachines.txt lots of powershell scripting Apr 5, 2013
QuerySQLListner.ps1 lots of powershell scripting Apr 5, 2013
README minor update Jun 27, 2011
SQLAgentJobInformationps.ps1 adding powershell scripts Feb 21, 2013
ServerNameps.ps1 lots of powershell scripting Apr 5, 2013
StatisticsInformationps.ps1 adding powershell scripts Feb 21, 2013
TableStatsps.psq.ps1 adding powershell scripts Feb 21, 2013
dbfilestats.ps1 lots of powershell scripting Apr 5, 2013
dbinfo.ps1 lots of powershell scripting Apr 5, 2013
execute_sql.ps1 adding powershell scripts Feb 21, 2013
failed login servers.txt lots of powershell scripting Apr 5, 2013
pingserver.ps1 lots of powershell scripting Apr 5, 2013
testport.ps1 lots of powershell scripting Apr 5, 2013
wmi_test.ps1 lots of powershell scripting Apr 5, 2013

README

See http://sqlserverio.com/2011/02/22/sqldiy-manage-and-monitor-sql-server-yourself/ for a full description.

Manage By Exception
This means setting up your monitoring and alerting systems to work for you not against you. To many alerts are just as deadly as too few. As you handle problems feed the solution back into your automated system.

Automate Everything
Make your servers work for you and not against you! There is always a cost up front to automate the management of your environment. The time you get back by not having your very valuable and highly skilled workers not doing menial tasks more than makes up for it.

Standardize Across Servers
As servers come on line you may find that they aren’t setup to the company policies. Fixing all of this by hand is also a huge time waister. Define a standard and modify it as needed. Through automation you can make a single change and then deploy it across your entire environment.

To meet these needs I’ve written several modules, a centralized system for managing them and the servers in my care. I will update this list with links as the articles come on line. If I use any code that I haven’t written I’ll be very clear who did write it, if I made changes to it and what the license to redistribute the code falls under.

Monitoring

Server Blocking
Backup Status
Check Backup Space
Daily Status
Database Drive Detail
Server DB Configuration
Server Database I/O
Server Wait Stats
Server Database Transaction Rate
Server Poll
System Database Roles
Job Schedules
Table Statistics
Long Running Queries
Long Running Stored Procedures
Log Shipping

Administration
Backup Database
Update Statistics
Re-indexing
QA Refresh
Test Backups
Log Shipping
Reporting

Daily Status
Meta Data
Long Running Queries
Long Running Stored Procedures
Trend Analysis

Backup/Restore Failure Analysis
Backup Growth
Drive Space Detail
Server Blocking
Database I/O
Database Transaction Rate
Server Wait Statistics
Long Running Queries
Long Running Stored Procedures
Something went wrong with that request. Please try again.