Quantcast
Browsing all 57 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Intro

Like many SQL Server DBAs I run into a problem at work or get an idea in my head then scour the internet to see if someone else had the same thing so I don’t have to reinvent the wheel.  Some DBAs stop...

View Article


Image may be NSFW.
Clik here to view.

Database Assessment

This script looks much more intimidating than the results it produces, so I recommend running it before reading through it.  I’ll run this when I first get on a unfamiliar server as a basic assessment...

View Article


Image may be NSFW.
Clik here to view.

Copy / Paste Code

Copy / Paste formatted text is a nightmare in WordPress.  I’m singling out WordPress because I use it, and, from what I can see, every blog site has this issue.  If you have a SQL Script (again,...

View Article

Image may be NSFW.
Clik here to view.

File Sizes

There are two scripts I like to use to look at the file sizes on servers.  The first one is everything I could hope for on servers where there is only a single file per filegroup.  All of the vital...

View Article

Image may be NSFW.
Clik here to view.

Cluster Info

This script is so simple you’ll start off by asking why you’d ever use it.  Then you’ll use it and wonder why no one gave this to you as part of your new-hire orientation at your first DBA job.  The...

View Article


Image may be NSFW.
Clik here to view.

Backup History

Can you tell me the drive we were backing up server #58 to exactly 8 months ago, and, if possible, it would really help if you could give me the exact file name for me to pull the backup from tape for...

View Article

Image may be NSFW.
Clik here to view.

Running Processes

Sp_who2 is not used by this DBA.  That info is amazingly good to have, but I want more.  Don’t get me wrong, sp_who2 is kinda hidden in this one as it’s really just a proc that does little more than...

View Article

Image may be NSFW.
Clik here to view.

Index Columns and Names

Don’t trust the name of an index to tell you what it is. The name is wrong, or at least that’s what you have to assume. I’m a huge fan of index naming conventions, with my favorite being starting out...

View Article


Image may be NSFW.
Clik here to view.

Table Sizes

Although this isn’t guaranteed to be 100% accurate, it’s fast and usually extremely close if it’s not perfect. You can find this code all over the internet, mine is just a slight variation where I...

View Article


Image may be NSFW.
Clik here to view.

Roll Logs – Backup Recovery

Rolling log files for a day, especially with 15 or even 5 minute log backups is a pain at best. Here’s a slightly better way to do it. Set the two variables at the top to the directory where the log...

View Article

Image may be NSFW.
Clik here to view.

Job Schedules – SQL Agent

This info should be easier to get than it is. Keep in mind that for something to run the subscription and schedule both have to be enabled. To be fair, the majority of this code was grabbed from the...

View Article

Image may be NSFW.
Clik here to view.

Indexes – Unused and Duplicates

Indexes aren’t free, and many databases end up with unused indexes. Every time you make any update to a table you will be updating the clustered index (I assume no heaps, because I hate heaps), and...

View Article

Image may be NSFW.
Clik here to view.

Indexes – Understanding basic types and their components

The biggest problem developers and newer DBAs have with understanding indexes is that you don’t realize when you’re using the exact same thing away from your computer.  Pick up any reference style book...

View Article


Image may be NSFW.
Clik here to view.

Wait Stats – sys.dm_os_wait_stats – Monitoring and Using

sys.dm_os_wait_stats is one of the most important DMVs out there, and one that you should know the historical values of for every server you care about. This DMV will tell you the cumulative amount of...

View Article

Image may be NSFW.
Clik here to view.

Blocking – Capturing and Monitoring

If a query is taking longer to run than normal, there’s a good chance it’s being blocked by something else. This is especially true when you’re doing something rediculously simple and SQL Server just...

View Article


Image may be NSFW.
Clik here to view.

White papers, DMVs and Monitoring Concepts

According to Jason Strate (SQL Server MVP) there are 5 white papers ever SQL Server DBA should read. Considering my blogging is focused on how to monitor and tune previously installed servers, we’ll...

View Article

Image may be NSFW.
Clik here to view.

Tracing Introduction

SQL Server tracing is essential for troubleshooting performance issues, yet it can put loads on your server that would cause noticeable slowness, capture so much information that it fills the drive,...

View Article


Image may be NSFW.
Clik here to view.

Reading Traces

Capturing information is useless unless you know how to use it. Here’s what I use to get the most out of my basic trace of anything taking over so many seconds. This is also my template for more...

View Article

Image may be NSFW.
Clik here to view.

Recently Recompiled Resource Hogs

It’s not too uncommon for a query to get a new execution plan that performs a lot worse than it could, and sometimes it’s bad enough to drag the whole server down to a halt.  When it’s something...

View Article

Image may be NSFW.
Clik here to view.

SQL Server Running Slow

A user calls to say the app or server is slow today.  Here’s a quick summary of how I get started.  It depends on monitoring where you can compare baselines to recent activity, and I include links to...

View Article
Browsing all 57 articles
Browse latest View live