Problem Statement: Script to find the Bad indexes Solution: The indexes returned by the below query degrade the performance of the[…]
Read moreMonth: March 2017
MSSQL Server: Find Missing Indexes
Problem Statement: Script to find the missing indexes using 3 different ways. Solution: 1) Find missing indexes using DMVs –Find top ten missing indexes using following DMV SELECT TOP 10 ( user_seeks ) * avg_total_user_cost * ( avg_user_impact * 0.01 ) AS […]
Read moreMSSQL Server: Get VLF counts of all Dbs
Problem Statement:Get the VLF count of all the dbs in a SQL server Instance. Solution: –variables to hold each ‘iteration’ DECLARE @query VARCHAR(100) DECLARE @dbname SYSNAME DECLARE @vlfs INT –table variable used to ‘loop’ over databases […]
Read moreMSSQL Server : Automatically Restore DBs from backup files
Problem Statement:Many a times we need to restore multiple dbs from the backfiles on disk. We must write scripts to[…]
Read more