Tip of the Day – Check your TempDB data file count and sizes

by admin on July 20th, 2010

Have you checked your TempDB data file count and sizes?
And moreover, are you monitoring its performance?

A general rule of thumb for most DBAs, for best TempDB performance in SQL Server, you should have one TempDB data file for each processor core in your SQL Server and each of those data files should be the exact same size and Autogrowth turned off. The latter point is very important for correct and balanced use of the data files allocated to to the database in that filegroup, but the former point is kind of a generalized practice to make it easier on yourself when setting up a new SQL Server. We even once had an onsite Microsoft Server Analysis rep tell us we should allocate one data file per CPU, but experience tells me this isn’t always the best solution. You really need to monitor your TempDB utilization and determine what you need. If this wasn’t TempDB, how would you determine if you needed more data files for your user databases? You’d monitor performance, right? Looking for certain wait types, right? Sure you would.

See a fantastic write up by Paul Randal (SQL Server MVP and Microsoft Regional Director) below.

SQL Humor? Yeah…..SQL Humor!

by admin on July 16th, 2010

SQL Cartoon Humor Pic

Little Bobby Tables

Another SSWUG mention found…

by admin on July 14th, 2010

Seems I was quoted in another SSWUG email daily newsletter a while back. The topic of conversation for quite a few days was index fragmentation and how to handle it.

The link above may not work well for everyone as I can’t find a way to get a bookmark to take you directly to the quotation, but below is the original topic and my response quoted in the newsletter on 07/07/2010.

The Question:

Index Defragmentation – How Often Do You See the Need?
Once again, on the list servers here on SSWUG there is a solid discussion about index defragmentation and an application that sets up maintenance plans.

First, a question – please take just a minute and let me know – how often (on average, yes I realize it is variable) do you find yourself needing to defragment your indexes on your production databases?

My response:

…and here’s Patrick’s experience – “We have a variety of systems that we support (120 servers/150 instances (2000/2005/2008)) and my experience shows that for many systems we are able to simply ignore the fragmentation levels because the performance of the system is not negatively impacted enough by the fragmentation to become a squeaky wheel. That said, however, some of our largest systems (0.5TB to 0.8TB in size with tables approaching 120GB) require outages and defragmentation every 6 months to keep performance at an acceptable level. We have a custom built SProc that we run on a weekly basis on the majority of the systems that sends us an email based report on the fragmentation levels of the indexes and also has internal logic to identify what actions should be taken based on best practices (defrag/rebuild/drop & recreate). This rarely gives us any grief and I feel we’ve effectively addressed fragmentation from a performance standpoint enterprise wide.

Yes, you will likely find some heavily fragmented tables/indexes here and there, but by and large we have very few performance complaints that can be tracked down specifically to fragmentation (I feel due to the process we have and use). 9 times out of 10 it’s an I/O bottleneck or someone running a report where it shouldn’t be run.”

I got SSWUG Published ;)

by admin on July 14th, 2010

A recent request from the SSWUG email newsletter asked how we as DBAs approach and handle application/service consolidation on your SQL Server servers. I have a pretty strong feeling and approach to this topic and emailed my experience to SSWUG…..and to my surprise (for the 2nd time I just heard from another DBA friend of mine), I was “published” in the daily SSWUG newsletter. Even further to my surprise, my entire email reply was included in its entirety. Thanks SSWUG!!

And just in case the link doesn’t work someday, here’s the text of the originally posed topic and my response.

Original SSWUG Topic Question:

Who Shares Your Database Server?

Many small businesses and often times large businesses find it difficult to have servers deployed for a single purpose. They may be constrained by hardware and software costs, or not have the necessary skills to configure servers according to best practices.

For example, Microsoft encourages the use of integrated security for Sql Server. Best practices teach us that your Domain Controller and Sql Server should reside on different instances of Windows Server. Already we have two servers.

IIS running on Windows, or even Apache, are often best when run on a different server. This is especially true if the web server faces the Internet. In that case, you will most likely have a firewall between your web server and all your internal hardware, and therefore can’t share windows with Sql Server. Even web servers that are for internal purposes only should not share resources with your database.

Other products also compete for resources that are often used in conjunction with Sql Server. SSIS, SSAS, and SSRS all may require significant memory, disk or CPU resources. Many businesses also have Mail servers, application servers, etc.

Let’s hear from you. You live in the real world and have to balance resources with business needs on a daily basis. Why not share things like what you are currently doing, what you like about it, what you would like to change, and the factors that caused you to choose your current configuration. Don’t worry if your system doesn’t follow best practices. The goal here is to share with each other the issues we all face. Send your experience to btaylor@sswug.org

My published response

Patrick Says…

We have a decent number of dedicated SQL Server instances (hundreds) to support all of the different business applications utilized in our environment. Server sprawl and SQL Server “Silos” as they’ve been labeled by the Systems Admins, have become more prevalent over the last few years, and to accommodate, most of our web/application/support service servers are run in VMs. We also run our SSRS and SSAS installations on dedicated servers because the required resources to do what they’re intended to do without causing performance grief.

I’ve always been a firm believer that you must hold your ground on providing the most appropriate environment for your SQL Server databases to perform within if you have any chance of meeting rigid SLAs (written or not, expressed or implied), and rarely, if ever, allow any other applications that consume even remotely moderate amounts of memory to be run on my SQL Servers. I’ve seen too many departmental SQL Servers struggle to breath with IIS\Exchange on them and just don’t allow it unless there’s no other way, and I document my stance early on.

SQL Server requires certain things. CPU, Memory, Storage. I rarely run into CPU issues with todays (and even yesterday’s) processors. I rarely spec a server with less than 4GB of RAM and usually much more, but there are a ton of configuration options/needs there. The I/O subsystem usually is where I have to compromise most, but that’s a whole different conversation. But right now we’re talking about role/application consolidation, and to me it comes down to how much RAM and CPU is available for SQL Server with at least 30% overheard (with a little flexibility). If there’s anything left in a departmental/dev/test server, we’ll talk about it. If it’s production, fuggeddaboutit!

-Patrick

Check “Long Running Operations” Stored Procedure

by admin on June 7th, 2010

I threw together a SProc for returning useful information about long running operations for SQL Server 2005+ and thought I’d share it. The procedure uses the dynamic management objects, dm_exec_requests, dm_exec_connections, dm_exec_sessions, and dm_exec_sql_text to tell you how much longer you may have to wait on processes that SQL Server categorizes as “long running”. Typically I use this SP to find out how much longer a backup or a restore process is going to take. And it’s usually within a few minutes of being correct, so it’s worlds better than starting a restore on a SQL 2000 box and just telling everyone it will be done when it’s done and there’s little way to tell other than experience. ;)

Let me know what you think…

-Patrick

SQL Server Version/Build Lookup site

by admin on June 3rd, 2010

Just posting a fantastic resource link today.  SQLSecurity.com keeps a nearly always up to date listing, complete with links to KB Articles and the MS product pages, for SQL Server Versions/Builds.  This one is my personal favorite of all the SQL Server build lookup pages online.

http://www.sqlsecurity.com/FAQs/SQLServerVersionDatabase/tabid/63/Default.aspx

From the site authors:
This is a database of SQL Server versions for those of us who want to know what possible vulnerabilities may exist in unpatched SQL Server systems.  This makes it easier for those of us tasked with securing those environments to prepare the proper documentation outlining the threat.  Special thanks to Ken Klaft for helping maintain this area of the site.  With the seamingly endless stream of PSS-only releases out there this gets to be really time-consuming.

--Chip

Do you Tweet?

by admin on May 27th, 2010

I finally broke down and decided to open a Twitter account and hope to use it professionally to share SQL Server knowledge. I don’t have enough interesting to follow yet, but I’m hopeful I can find a way to begin leveraging both the blog and the Twitter account to become more involved in the SQL Server community.  If you do begin to find my musings and tips helpful, follow me on Twitter here.

SQL Server 2008 & the SQL Server Surface Area Configuration Tool

by admin on May 6th, 2010

SQL Server 2008 does away with the dedicated Surface Area Configuration Tool included with SQL Server 2005 in favor of leveraging a new facet within SSMS (SQL Server Management Studio) to now expose the properties necessary to make changes to options not available through the 2008 SQL Server Configuration Manager.

The new facet is called Surface Area Configuration and is accessed via SSMS by right-clicking on the instance name and choosing Facets.  You then select Surface Area Configuration from the Facet Drop-Down box and there you go.  Access to some feature options that you might have thought you lost after upgrading to 2008, but low and behold, Microsoft still has you covered!  Interestingly enough, this works as a single replacement alternative for the 2005 Surface Area Configuration Tool as it works with SQL Server 2005 instances as well (if you’re using SSMS 2008).

Make sure you dig around a little in the View Facets form as there are some more interesting nuggets hiding in there for you to discover….

SAC_Facet_Example

Wichita, KS SQL Users Group

by admin on April 28th, 2010

I’m hoping to either find or startup a local MS SQL Server Users Group.

I’ve not found anything to date in the Wichita Metro, so I’m looking for interest in gathering with local SQL Server DBAs for tech discussions, networking, and possibly bringing in special speakers.  If you are a DBA in the Wichita Metro area and would be interested, or know of someone who is, please drop me a line via the contact page and let me know.  I’m not sure how quickly we could pull something together, but with the right people, anything is possible.

If you’re lurking, subscribe to this posts comments (or my entire blog feeds) and I’ll try to keep the progress up to date.

Thanks for tuning in…..

Locate Startup Stored Procedures

by admin on April 28th, 2010

Quick check for stored procedures run at startup.  This will help you determine what stored procedures you may have set to run at startup.  I use this quite often (in modified form) to locate SQL Servers in the domain, leveraging SQL Server CMS (Centralized Management Server), running the SQL Blackbox trace.

Tested to run on SQL 2000/2005/2008

Locate Startup SProcs:

exec master..sp_MSforeachdb
'Select ''?'' [Database Name], name as [Startup Proc Name]
From [?]..sysobjects
Where type = ''p'' and OBJECTPROPERTY(id, ''ExecIsStartup'') = 1;'