Archive for the ‘SQL Server’ Category

Recently I was searching the internet for a good approach to perform database maintenance and index rebuilds on a scheduled basis. While searching for frameworks I found a nice project at by Ola Hallengren.

A quote of the description from the authors page:

SQL Server Backup, Integrity Check, and Index and Statistics Maintenance

The SQL Server Maintenance Solution comprises scripts for running backups, integrity checks, and index and statistics maintenance on all editions of Microsoft SQL Server 2005, SQL Server 2008, SQL Server 2008 R2, SQL Server 2012, and SQL Server 2014. The solution is based on stored procedures, the sqlcmd utility, and SQL Server Agent jobs. I designed the solution for the most mission-critical environments, and it is used in many organizations around the world. The SQL Server Maintenance Solution has been voted as Best Free Tool in the 2013, 2012, 2011, and 2010 SQL Server Magazine Awards, and a top session at PASS Summit 2014. The SQL Server Maintenance Solution is free.

If you are looking for a method to perform easy database maintenance look no further and check out the provided page. This is a really nice set of scripts to put to good use in your own SQL environment! And in case you didn’t see that the description states it’s free this is your second chance at realizing this.

One of the nice features is that it contains a procedure to rebuild or reorganize indexes based on a fragmentation threshold.

All this indexation heaven is possible on a per-table-approach or even a complete database-at-once approach. Be aware to schedule this in your maintenance window time, otherwise this could slow down your server performance significantly when you start re-indexing large database tables in the middle of peak hours.