July 22, 2013 at 9:45 pm
Comments posted to this topic are about the item What’s going on, on my server, right now?
Thanks,
Kimberly Killian
Sr. DBA / DB Engineer
www.sitedataview.com
Follow me on Twitter
Follow me on Facebook
July 23, 2013 at 12:55 am
Nice article!
You might also want to look at "What SQL Statements Are Currently Executing?"
http://www.sqlservercentral.com/articles/DMV/64425/
Thanks
Ian
July 23, 2013 at 5:36 am
what version's of SS will support you did not mention I am getting 2 errors...
Msg 102, Level 15, State 1, Line 2
Incorrect syntax near '90'. ( I changed it to 90 as we are using SS2k5 Sp1)
Msg 102, Level 15, State 6, Line 1
Incorrect syntax near 'HONOR_BROKER_PRIORITY'.
July 23, 2013 at 5:39 am
Nicely done. Just curious why you aren't using the Dynamic Management Views (DMV) to retrieve a lot of that information?
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
July 23, 2013 at 6:07 am
what are you using to detect CPU is at 90%? the alert you create does not appear to have the required component of
@performance_condition=N'Resource Pool Stats|CPU usage %|default|>|90',
also, this code is bad;
SELECT
convert(varchar(50), program_name),
count(*),
sum(cpu),
sum(datediff(second, login_time, getdate()))
FROM master..sysprocesses
WHERE spid > 50
GROUP BY convert(varchar(50), program_name)
ORDER BY 7 DESC
you only have 4 columns.... you can't ORDER BY the 7th column.
It's an interesting approach overall. I am fan of email alerting on certain conditions occuring on the server.
July 23, 2013 at 6:11 am
Nice post, I think there is an issue in code line PROGRAM_NAME not in (''Microsoft SQL Server Management Studio '') but it's an simple mistake :).
Really glad to see such a nice post.
Thanks,
Anil Maharjan
July 23, 2013 at 6:27 am
Sorry, my bad! SQL Server 2008 R2 is what I have it running on.
Thanks,
Kimberly Killian
Sr. DBA / DB Engineer
www.sitedataview.com
Follow me on Twitter
Follow me on Facebook
July 23, 2013 at 6:30 am
I believe I said in my article that you can attach this to any alert you wanted, however good catch, i'll update my article.
Thanks,
Kimberly Killian
Sr. DBA / DB Engineer
www.sitedataview.com
Follow me on Twitter
Follow me on Facebook
July 23, 2013 at 6:31 am
You could definately use the DMV for this info as well. I just like to have an alternative. I always set up a batch of reports for my clients and these just fit in well with my personal solution.
Thanks,
Kimberly Killian
Sr. DBA / DB Engineer
www.sitedataview.com
Follow me on Twitter
Follow me on Facebook
July 23, 2013 at 6:54 am
@ian - great addition! I will add this to my daily use. Thanks.
Thanks,
Kimberly Killian
Sr. DBA / DB Engineer
www.sitedataview.com
Follow me on Twitter
Follow me on Facebook
July 23, 2013 at 7:14 am
Kim Killian-SiteDataView (7/22/2013)
Comments posted to this topic are about the item <A HREF="/articles/SQL+Monitoring/100615/">What’s going on, on my server, right now?</A>
Have you looked into sp_whoisActive .. it is much more powerful than sp_who2 ?
______________________________________________________________________________________________________________________________________________________________________________________
HTH !
Kin
MCTS : 2005, 2008
Active SQL Server Community Contributor 🙂
July 23, 2013 at 7:14 am
Kim Killian-SiteDataView (7/22/2013)
Comments posted to this topic are about the item <A HREF="/articles/SQL+Monitoring/100615/">What’s going on, on my server, right now?</A>
Have you looked into sp_whoisActive .. it is much more powerful than sp_who2 ?
______________________________________________________________________________________________________________________________________________________________________________________
HTH !
Kin
MCTS : 2005, 2008
Active SQL Server Community Contributor 🙂
July 23, 2013 at 8:09 am
Have a conscious strategy to deal with table locking on the system tables. You are probably better off getting an inconsistent view of the data then holding up the server with a lock.
July 23, 2013 at 8:28 am
Okay, I've been meaning to do something like this for a while, but to have it laid out as a copy/paste job! Must say I am impressed. Intend to use this!
July 23, 2013 at 3:21 pm
Great article. However, personallly I wouldn't use column numbers in the order by clause. It's a bit of a bad habit in my opinion and can cause issues later on down the track.
Viewing 15 posts - 1 through 15 (of 33 total)
You must be logged in to reply to this topic. Login to reply