Patrick Purviance – SQL Server DBA Blog

Blogging impactful solutions for SQL Server DBAs worldwide

Archive for the ‘Microsoft SQL Server’ Category

I got SSWUG Published ;)

Wednesday, 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

Monday, 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

Thursday, 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.

SQL Server Version/Build Lookup site
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?

Thursday, 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

Thursday, 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

Wednesday, 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

Wednesday, 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.

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;'

Tested to run on SQL 2000/2005/2008

Changing SQL Server Agent Jobs Owners

Tuesday, April 27th, 2010

Wrote a quick fix-it today for changing the owner of a SQL Agent Job from one login to another…..

Ever get annoyed by SQL Server Agent Jobs, whether created via a Maintenance Plan or any other method, defaulting the owner to the creator of the job?  I know I do.  The script below containing dynamic T-SQL will allow you to script out the change scripts needed to modify the jobs without the need of opening and modifying each job manually.  Big time saver!!!

Script to change job owner:

1
2
3
4
5
6
7
Select 'EXEC msdb.dbo.sp_update_job 
     @job_name = N''' + replace(name, '''', '''''' ) + ''', 
     owner_login_name = N''new_owner'''
From msdb..sysjobs
Where owner_sid = 
     (Select sid From master..syslogins 
      Where name like '%old_owner%')