SQL Saturday in Orlando is almost upon us, and I get to present a favorite subject of mine, Fundamentals of DBA-Ism. I have given this one a few times, and I have learned alot about the habits and practices of other DBAs out there.
The thing I love about presenting is that it is so evolutionary. I don’t think I have ever given the same presentation twice becuase I learned something new from the last one. 9.24.11 will be different thanks to what I learned from my attendees in South Florida.
I have refined my fundamentals to 5 building blocks- what I will ultimately label The 5 Effective Habits of Exceptional DBAs (or something like that) to be:
1. Configuration
2. Availability
3. Maintenance
4. Monitoring
5. Managing Expectations
So, in order to help me redo my slides, I am going “talk it out” here. Starting with
Configuration
I think how to configure SQL server is one of the most interesting topics, because there are so many different ideas on how to do it. Not only amongst us DBAs, but everyone seems to know what is best (SAN Admins, Windows Admins, managers, etc). From where the data files should go, to how big the TempDB should be, to even something as simple as who installs SQL server are up for discussion. What I have learned is there, there are as many ways to do this as there are midichlorians in Anakin’s blood. So, let me share with you some of the ways I have managed to keep out of trouble with this topic by answering questions that have been posed to me :
Q: Who should install SQL?
A: Well, The SQL DBA. It’s in our name for a reason. I seriously doubt the System Admins would like me trying my hand at installing Windows Server 2008 R2, so they should understand my position. SQL does require a bit of on the spot configuration for installs (Filestream, default file locations, etc) so it best if you have the person who is managing it install it.
Q: Where do I put my Data and Log files?
A: This reminds me of the story on how the angel got on top of the Christmas tree, but that is for another time. Personally, I do not like the default placement that SQL uses. C:\program files\microsoft sql server\blah\blah\blah.mdf is a whole lot of letters to type. I like simple. Give me D:\Data, E:\Logs, and F:\System and I am a happy DBA. I do advocate the separation of log and data and system, even in the face of the SAN admins saying its all the same thing. I do it partially for performance, but mostly for organization. I like being able to go to where the logs live without bothering anyone else.
Q: How big should the TempDB files should there be, and how many should I have?
A: This is a question I think is asked most. As far as how big it needs to be, my best answer is as big as it needs to be. I think it was Brent Ozark who compared the TempDB to a public bathroom. Im going to be more descriptive. TempDB is like a public restroom at Comic Con after they handed out thousands of free Energy drinks to the attendees. Given everything that happens in the TempDB, that’s a pretty accurate description. The TempDB can get very large, and it gets that way because it needs to be. They best bet is to give it sufficient room to grow, and let it do just that. That means the data files AND the log files. After a time the size will stabilize and you will know the answer to your question. That way, if it every suddenly grows abnormally, you know someone was up to something and you need to find out what (see 4-Monitoring when I write it). As for how many files, again, many opinions. I prescribe to the 1 per socket methodology, with them being the same size and set to not grow.
Q: Are naming conventions really that important?
A: Yes, they are. If you set and enforce naming conventions for any objects on your databases, you will always know what you are dealing with. I am talking about going beyond the Access throwbacks of TBL and USP and TR. I mean if you have a database that service multiple purposes, prefix the objects with some identifier for them. You can also use schemas to do the same thing.
The bottom line with configuration is that you are setting up the foundation of your environment. Every other thing that you do will be based upon that foundation. With that in mind, be strong in setting your “Gold Standards” to make sure your servers are stable and run smoothly.