SQL Server Administration and Maintenance

Installation, configuration, automation, health checks, and governance controls.

301 associated posts140 primary posts

How to Set Up SQL Server 2012 Always On Availability Groups

Before we get started, we need to talk about something. I'm going to be using the C word - that's right, Clustering. Deep, calming breaths. Relax. We can do this, you and me. This isn't the old-school clustering with shared disks, heartbeat networks, and hardware compatibility lists. This is just another feature you're going to…

Read more about How to Set Up SQL Server 2012 Always On Availability Groups 251 comments — Join the discussion

Ozar’s Hierarchy of Database Needs: a 6-Month DBA Training Plan

You need to poop. Maybe not right now, but in general, you need to breathe, eat, drink, sleep, and poop.  If you can't do any of those things, then the rest of your needs will take a back seat until you can accomplish the basics.

Psychology professor Abraham Maslow designed Maslow's Hierarchy of Needs to illustrate how us meatbags prioritize our daily tasks.  It's usually visualized with a pyramid:

Read more about Ozar’s Hierarchy of Database Needs: a 6-Month DBA Training Plan Be the first to comment
Production DBA

Stop Shrinking Your Database Files. Seriously. Now.

I had sworn to myself that if I saw one more helpful article about how to shrink your SQL Server database files with DBCC SHRINKFILE or how to back up your log with TRUNCATE_ONLY, I was going to write a rant about it.

SQL Server Magazine just tweeted about their latest article, a reader-submitted solution on how to shrink your database files with ease.

Read more about Stop Shrinking Your Database Files. Seriously. Now. 302 comments — Join the discussion

How to Import the StackOverflow XML into SQL Server

UPDATE 2013: This code is no longer available. The size of the StackOverflow export has grown beyond what you can import with this method.

Want to play around with the StackOverflow database export?  Here's how to import the XML files into SQL Server, and some notes about the tables and data schema.
Script to Import StackOverflow XML to SQL Server
This T-SQL script will create six stored procedures:

Read more about How to Import the StackOverflow XML into SQL Server 16 comments — Join the discussion
Production DBA

Dev, Test and Production SQL Server Environments

In a perfect world, my test/QA servers get restored nightly from production. Let's say every night at 9pm, the production full backups kick off, and they're finished by 10pm. At 11pm, the QA box kicks off a restore job that grabs the latest full backups off the file share and restores them. The production backups are written to a file share, never local storage, so there's no additional overhead on the production box for this restore process.

Read more about Dev, Test and Production SQL Server Environments 91 comments — Join the discussion
Production DBA

Another backup failure: Carbonite

TechCrunch reports that Carbonite, an online backup company, lost customer data.

But wait, this is different: it's not their fault.  They're suing Promise Technology, makers of popular storage gear, for selling them bogus equipment.  Bogus equipment?  You mean, like hard drives that fail?  That's horrible!  Who could expect something like that?  Who could know about the dangers that lurk around every corner?

Read more about Another backup failure: Carbonite 32 comments — Join the discussion

SQL Server 2008’s new Central Management Server

Got more than one DBA?  Want to make your life easier?  You might want to configure a Central Management Server.

This is useful for fast-changing shops where there's a lot of servers added and removed.  At my last company, we had a hard enough time telling everybody when we'd finished adding a new server, or what the new server's name was, or when we didn't need to look at a server anymore.

Read more about SQL Server 2008’s new Central Management Server 62 comments — Join the discussion

SQL Server 2005 Setup Checklist Part 2: After The Install

I've covered what needs to happen before you install SQL Server - now, let's talk about what to do immediately after the setup finishes.
Install not just the service packs, but also the cumulative updates.
Starting with SQL Server 2005's Service Pack 2, Microsoft releases hotfixes in cumulative packs. These updates do more than just fix bugs: they improve how SQL Server performs. These updates are free performance benefits - and who doesn't like that?

Read more about SQL Server 2005 Setup Checklist Part 2: After The Install 98 comments — Join the discussion