Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

Data Management

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Your profile

    Search

    XML Feeds

    Google Ads

    « How to get data out of Microsoft Dynamics Great PlainsPush your DBA skills over the edge by becoming a better developer »
    comments

    As a DBA the word no comes out of us often. It's just the nature of our jobs that we will find ourselves not accepting requests and revoking bad choices already made. If you are a DBA and you're a yes type of person then you're in the wrong field. Protecting the company heart and soul in the form of data cannot be successful with the word yes. It's just not possible.

    Now what do you do when something happens out of your control? My first thought is, I hope you handled the situation well enough to prevent it in the first place. Here is a perfect example that happened recently. An email comes in stating one of the analysts needs permissions on a critical production database server. Permissions for what you say? Well this is the error they had attached

    Yes, they tried to run a trace on the production server. I hope the thought of that scares the hell out of you as a DBA. This leads into why the analyst even had the option of opening profiler. Well, they need SQL Tools in order to manage simple reports out of the test systems. This is all very locked down on security even in the test systems and only specific rights are allowed given the position they are in. Yes, you should lock down your test and dev systems as well. If we took a poll on time spent troubleshooting production vs. test instances, my money would be on test taking the most time of your day. So why allow more havoc to be run on those servers when you can prevent it as much as you do in production. Needless to say the analyst had to have tools installed in order to perform their job. That's understandable of course. SQL tools installations fly all around a normal IT group and we all see little thought going into if we should be installing them. So what's the issue then? If they need it, why am I writing this? Well, I want to talk about the red button in front of my mother’s face. See, my mother can't help herself from pushing that button. No matter how hard she tries, that damn button is getting pushed. One time she pushed the wrong button and paid the price. I can’t go into details. She’s my mother and I love her dearly and want to protect her from embarrassment. But, well...

    Should common sense of not knowing the consequences of that button being pushed have played an important role in not pushing it? Umm...yeah! So when the analyst had whatever support step that showed them the sweet path to open SQL Server Profiler, should they have even got to the point of clicking it? Honestly, I would hope not but that didn't happen here. They clicked away.

    Now how do you fix this problem after the damage is made? Probably around these lines...

    Let's take a look at the issue with that and what could have happened if they actually got that thing started. The options they chose were to write to a table and default events from Profiler. The table they were going to create and use was in the same database they were trying to mine out some code. Unfortunately they were not stopped at the table creation. This is due to horrible planning on the ERP systems side and having a database role that allows users to do just that. This database is part in log shipping and replication. First issue log growth. What happens when you insert a couple hundred thousand lines in a few minutes into a database? Now let's think about those log backups and sending them offsite to the other stand by instance. Not enough? How about IO when the log is growing and possibly the database, the CPU, Memory and other resources sucked down by the trace? Oh yeah, your mirror uncommit skyrockets and now you’re vulnerable to failure and losing data even with your sweet high availability setup. Now you have 500 really angry users across your WAN and who are they calling? Here comes the Google search for truncate log files from the not so great DBA.

    *sigh* All this happened because someone clicked something they had no prior training or knowledge on when they should have questioned the concept of what the consequences of that action would have been.

    I'm not sure if I need to say under any circumstances should you ever give someone other than a DBA sysadmin rights. If there is someone other than a DBA in that group then you may be so far in trouble that what I say may not help you. I'm guessing if you have non-DBA users in sysadmin roles or even worse, BUILTIN\Admins in the sysadmin role, then the sa password is probably written on your cube wall as well. I guess my only plea with anyone that reads this is to think before you click something. If you are a systems administrator, think before you click that button that alters the way AD works. Think before you add that disk to your server midday and during peak business hours. Think before you click a program that you've never clicked before. And to my fellow DBAs, secure your database servers. You’re the DBA. You should be the only one(s) with power to do those things. Prevent your users and peers from being able to get farther than this person did.

    About the Author

    Ted Krueger is a SQL Server MVP and has been working in development and database administration for 13+ years. Specialties range from High Availability and Disaster / Recovery setup and testing methods down to custom assembly development for SQL Server Reporting Services. Ted blogs and is also one of the founders of LessThanDot.com technology community. Some of the articles focused on are Backup / Recovery, Security, SSIS and working on SQL Server and using all of the SQL Server features available to create stable and scalable database services. @onpnt
    Social SitingsTwitterLinkedInLTD RSS Feed
    1935 views
    Instapaper

    7 comments

    Comment from: SQLDenis [Member] Email
    *****
    SQLDenis The reason to run traces on production can also be that, surprise!!!! there is no QA/testbed with the same amount of data.....happens all the time

    I must say I have never ran a trace on production after we went live with something
    07/10/09 @ 06:58
    Comment from: Michelle Ufford [Visitor] · http://sqlfool.com
    *****
    Michelle Ufford Nice article, Ted!

    On Denis' point, I have had to run traces on a production box before; it was necessary to track down weird performance issues. A good DBA knows how to run a trace to minimize the impact. Conversely, I have also seen a server become almost non-responsive because a SQL novice ran a trace for *everything*, so Ted's point is well made.
    07/10/09 @ 07:23
    Comment from: Ted Krueger (onpnt) [Member]
    Ted Krueger (onpnt) Thanks Michelle :)
    07/10/09 @ 07:36
    Comment from: Mike W alsh [Visitor] Email · http://www.straightpathsql.com/blog
    *****
    Mike W alsh Great points. You were, once again, On Point ;-)


    There are many times when traces have to be run on production as Michelle indicated. Gail just blogged about why trace/profiler is still a necessary tool. http://sqlinthewild.co.za/index.php/2009/07/10/why-the-dmvs-are-not-a-replacement-for-sql-trace/

    What doesn't always have to happen is using profiler (and certainly not to a table directly). I often have to run traces and when I do I trace through a query, results to file on a drive that is not utilized for anything important.

    I monitor performance during it and will sometimes even run a quick 15 - 45 second profiler trace to gauge the potential impact from what I am checking.

    Also one point to Michelle's. I am sure she knows what I am about to say but it can be misunderstood by those reading... Your filters to filter down what profiler or trace is grabbing do nothing to minimize the impact of what you are tracing. Yes it may make the file grow less rapidly and yes it may be less data to display on a screen if using the GUI based profiler. All events are still going through and the filter is being applied after the tracing mechanism has read the data.
    07/10/09 @ 07:38
    Comment from: SQLDenis [Member] Email
    *****
    SQLDenis Michelle..the key point is that you are a DBA and you know what you are doing...you will not move all the columns from the left to the right and hit the start trace button

    someone might have a trace template that will look for every database, every user, batch started/completed/parsed etc etc

    Then of course you got people running perfmon with cache hit/miss ration and life expectancy ate the same time :-(


    since 2005 we now also have the DMVs which give some good info that you could only get from perfmon and/or a trace before
    07/10/09 @ 07:42
    Comment from: Erik [Member] Email
    Erik >>> All events are still going through and the filter is being applied after the tracing mechanism has read the data.

    I'm not so certain that this global statement (which implies there is no cost difference between tracing everything and tracing only a few things) is truly accurate. Could we get some sources for this?
    07/10/09 @ 10:09
    Comment from: Mike Walsh [Visitor] · http://www.straightpathsql.com
    Mike Walsh Emtucifor -

    I can't seem to find any quick sources at present. The implication is not necessary what you interpreted it, and I apologize for that. Yes a filtered trace in profiler or trace will have less of an impact. You are recording less information on the GUI or in a file.

    Even still, a "well filtered" profiler session (and to a lesser degree a server side trace) is not free. Those events are still read at some level (how else could you filter duration if the code behind the profiling process didn't have the ability to know and interpret/apply the filter conditions?).

    I have seen performance issues caused by even well intentioned and well filtered traces on boxes that were underpowered and quite busy.
    07/22/09 @ 21:06

    Leave a comment


    Your email address will not be revealed on this site.

    Your URL will be displayed.
    (Line breaks become <br />)
    (Name, email & website)
    (Allow users to contact you through a message form (your email will not be revealed.)