<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title> &#187; Monitoring</title>
	<atom:link href="http://benchmarkitconsulting.com/category/sql-server/monitoring/feed/" rel="self" type="application/rss+xml" />
	<link>http://benchmarkitconsulting.com</link>
	<description></description>
	<lastBuildDate>Mon, 06 Feb 2012 16:34:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>SQL Bacon Nugget of Excellence Award @MladenPrajdic</title>
		<link>http://benchmarkitconsulting.com/colin-stasiuk/2011/11/14/sql-bacon-nugget-of-excellence-award-mladenprajdic/</link>
		<comments>http://benchmarkitconsulting.com/colin-stasiuk/2011/11/14/sql-bacon-nugget-of-excellence-award-mladenprajdic/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 14:40:23 +0000</pubDate>
		<dc:creator>Colin Stasiuk</dc:creator>
				<category><![CDATA[Benchmark IT Consulting]]></category>
		<category><![CDATA[Colin Stasiuk]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Bacon]]></category>
		<category><![CDATA[Deadlock Notification]]></category>
		<category><![CDATA[Mladen Prajdic]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL 2008]]></category>

		<guid isPermaLink="false">http://benchmarkitconsulting.com/?p=1985</guid>
		<description><![CDATA[Prior Winners: Lara Rubbelke &#8211; (post link &#124; blog &#124; @SQLGal) &#8211; Enterprise Policy Management Framework Tim Ford &#8211; (post link &#124; blog &#124; @SQLAgentMan) &#8211; Determine Free Space, Consumed Space, and Total Space Allocated for SQL Server databases This &#8220;award&#8221; has (unintentionally) not been handed out in a while but something that I&#8217;ve used [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-1986" title="BaNug" src="http://benchmarkitconsulting.com/wp-content/uploads/2011/11/BaNug.jpg" alt="" width="180" height="135" /></p>
<p>Prior Winners:</p>
<ul>
<li>Lara Rubbelke &#8211; (<a href="http://benchmarkitconsulting.com/colin-stasiuk/2009/08/26/sql-bacon-nugget-of-excellence-award-sqlgal/" target="_blank">post link</a> | <a href="http://sqlblog.com/blogs/lara_rubbelke/default.aspx" target="_blank">blog </a>| @<a href="http://twitter.com/#!/sqlgal" target="_blank">SQLGal</a>) &#8211; <a href="http://epmframework.codeplex.com/" target="_blank">Enterprise Policy Management Framework</a></li>
<li>Tim Ford &#8211; (<a href="http://benchmarkitconsulting.com/colin-stasiuk/2009/07/08/sql-bacon-nugget-of-excellence-award-sqlagentman/" target="_blank">post link</a> | <a href="http://thesqlagentman.com/" target="_blank">blog </a>| <a href="http://twitter.com/#!/SQLAgentMan/" target="_blank">@SQLAgentMan</a>) &#8211; <a href="http://www.mssqltips.com/sqlservertip/1629/determine-free-space-consumed-space-and-total-space-allocated-for-sql-server-databases/" target="_blank">Determine Free Space, Consumed Space, and Total Space Allocated for SQL Server databases</a></li>
</ul>
<p>This &#8220;award&#8221; has (unintentionally) not been handed out in a while but something that I&#8217;ve used (or a variation of) for a while now that I think needs to get bumped back up to the top of everyone&#8217;s RSS Feed is Mladen Prajdic&#8217;s I.D.N.W.C.E.C (a not so catchy acronym that I just came up with).</p>
<p><a href="http://weblogs.sqlteam.com/mladenp/archive/2008/07/18/Immediate-deadlock-notifications-without-changing-existing-code.aspx" target="_blank">Immediate Deadlock Notifications Without Changing Existing Code</a></p>
<p>Mladen describes how to use the server wide deadlock notification (<a href="http://msdn.microsoft.com/en-us/library/ms182602.aspx" target="_blank">Event Notifications</a>) to capture the deadlock graph (or deadlock chain, deadlock, escalation) to a table as soon as a deadlock occurs (as well as optionally to send an email at time of capture).</p>
<p><img class="alignnone size-full wp-image-1988" title="aaswsdw" src="http://benchmarkitconsulting.com/wp-content/uploads/2011/11/aaswsdw.png" alt="" width="121" height="107" /></p>
<p>Now what I like about this over the more &#8220;traditional&#8221; way of detecting deadlocks with Trace Flags 1204 and 1222 (<a href="http://msdn.microsoft.com/en-us/library/ms178104.aspx" target="_blank">MSDN Link</a>) is that we&#8217;re able to capture the deadlock graph event like we were running a Profiler trace against the server.  Using trace flags 1204 and 1222 you get all the same information but I&#8217;m a picture person&#8230;.</p>
<p><img class="alignnone size-full wp-image-1991" title="liger" src="http://benchmarkitconsulting.com/wp-content/uploads/2011/11/liger.jpg" alt="" width="300" height="300" /></p>
<p>and as a picture person I much prefer to see the deadlock graph over the &#8220;texty&#8221; / XMLish type of information you get back from Trace Flags 1204 and 1222.</p>
<p>Big thanks and props to Mladen for this blog post as I&#8217;ve come back to it time and time again <img src='http://benchmarkitconsulting.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If you&#8217;d like to chat with me about this or anything else (SQL or other) please leave a comment or hit me up on my Twitter: <a href="http://twitter.com/ColinStasiuk" target="_blank">@ColinStasiuk</a></p>
<p><a href="http://benchmarkitconsulting.com/" target="_blank"><img title="benchmark_sm" src="http://benchmarkitconsulting.com/wp-content/uploads/2009/02/benchmark_sm.jpg" alt="" width="157" height="74" /></a></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=SQL+Bacon+Nugget+of+Excellence+Award+%40MladenPrajdic+http://tinyurl.com/d3xzp6v" title="Post to Twitter"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-twitter-big4.png" alt="Post to Twitter" /></a> <a class="tt" href="http://delicious.com/post?url=http://benchmarkitconsulting.com/colin-stasiuk/2011/11/14/sql-bacon-nugget-of-excellence-award-mladenprajdic/&amp;title=SQL+Bacon+Nugget+of+Excellence+Award+%40MladenPrajdic" title="Post to Delicious"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-delicious-big4.png" alt="Post to Delicious" /></a> <a class="tt" href="http://digg.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2011/11/14/sql-bacon-nugget-of-excellence-award-mladenprajdic/&amp;title=SQL+Bacon+Nugget+of+Excellence+Award+%40MladenPrajdic" title="Post to Digg"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-digg-big4.png" alt="Post to Digg" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2011/11/14/sql-bacon-nugget-of-excellence-award-mladenprajdic/&amp;title=SQL+Bacon+Nugget+of+Excellence+Award+%40MladenPrajdic" title="Post to StumbleUpon"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-su-big4.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://benchmarkitconsulting.com/colin-stasiuk/2011/11/14/sql-bacon-nugget-of-excellence-award-mladenprajdic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Harder, Better, Faster, Stronger</title>
		<link>http://benchmarkitconsulting.com/colin-stasiuk/2011/10/28/harder-better-faster-stronger/</link>
		<comments>http://benchmarkitconsulting.com/colin-stasiuk/2011/10/28/harder-better-faster-stronger/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 12:00:16 +0000</pubDate>
		<dc:creator>Colin Stasiuk</dc:creator>
				<category><![CDATA[Benchmark IT Consulting]]></category>
		<category><![CDATA[Colin Stasiuk]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[DMV]]></category>
		<category><![CDATA[dm_server_services]]></category>
		<category><![CDATA[PASS]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[sqlpass]]></category>
		<category><![CDATA[sysprocesses]]></category>

		<guid isPermaLink="false">http://benchmarkitconsulting.com/?p=1943</guid>
		<description><![CDATA[OK maybe not &#8220;harder&#8221; but I just found a DMV that I didn&#8217;t know existed that is going to help me make &#8220;better, faster, stronger&#8221; an old way of doing things. I wrote a blog post back in 2009 called: Check SQL Server Agent Status on all SQL Servers This scripted used the sysprocesses table [...]]]></description>
			<content:encoded><![CDATA[<p><iframe width="420" height="315" src="http://www.youtube.com/embed/bl6RJyZdBSU" frameborder="0" allowfullscreen></iframe></p>
<p>OK maybe not &#8220;harder&#8221; but I just found a DMV that I didn&#8217;t know existed that is going to help me make &#8220;better, faster, stronger&#8221; an old way of doing things.</p>
<p>I wrote a blog post back in 2009 called: <a href="http://benchmarkitconsulting.com/colin-stasiuk/2009/07/20/check-sql-server-agent-status-on-all-sql-servers/" target="_blank">Check SQL Server Agent Status on all SQL Servers</a></p>
<p>This scripted used the sysprocesses table to check for the existence of a row where the program_name = &#8216;SQLAgent &#8211; Generic Refresher&#8217;.  If the row existed then that told me the SQL Server Agent was up and running.</p>
<p>While poking around SQL 2012 CTP3 I stumbled upon the <a href="http://msdn.microsoft.com/en-us/library/hh204542.aspx" target="_blank">sys.dm_server_services</a> DMV (which basically returns information about the SQL Server and SQL Server Agent services&#8230; information like whether or not they are running <img src='http://benchmarkitconsulting.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ).</p>
<p>I thought I&#8217;d check books online to see if this was something new introduced in SQL 2012 and apparently this has been around since SP1 of SQL 2008 R2.</p>
<p><img class="alignnone size-large wp-image-1944" title="29_01_05_11_8_28_32" src="http://benchmarkitconsulting.com/wp-content/uploads/2011/10/29_01_05_11_8_28_32-1024x454.png" alt="" width="368" height="163" /></p>
<p>Whenever I find something like this and can tweak / fix /modernize something I&#8217;ve used for what seems like forever I feel like I&#8217;m evolving <img src='http://benchmarkitconsulting.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If you&#8217;d like to chat with me about this or anything else (SQL or other) please leave a comment or hit me up on my Twitter: <a href="http://twitter.com/ColinStasiuk" target="_blank">@ColinStasiuk</a></p>
<p><a href="http://benchmarkitconsulting.com/" target="_blank"><img title="benchmark_sm" src="http://benchmarkitconsulting.com/wp-content/uploads/2009/02/benchmark_sm.jpg" alt="" width="157" height="74" /></a></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Harder%2C+Better%2C+Faster%2C+Stronger+http://tinyurl.com/3d8mqsr" title="Post to Twitter"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-twitter-big4.png" alt="Post to Twitter" /></a> <a class="tt" href="http://delicious.com/post?url=http://benchmarkitconsulting.com/colin-stasiuk/2011/10/28/harder-better-faster-stronger/&amp;title=Harder%2C+Better%2C+Faster%2C+Stronger" title="Post to Delicious"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-delicious-big4.png" alt="Post to Delicious" /></a> <a class="tt" href="http://digg.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2011/10/28/harder-better-faster-stronger/&amp;title=Harder%2C+Better%2C+Faster%2C+Stronger" title="Post to Digg"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-digg-big4.png" alt="Post to Digg" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2011/10/28/harder-better-faster-stronger/&amp;title=Harder%2C+Better%2C+Faster%2C+Stronger" title="Post to StumbleUpon"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-su-big4.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://benchmarkitconsulting.com/colin-stasiuk/2011/10/28/harder-better-faster-stronger/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jobs Jobs Jobs</title>
		<link>http://benchmarkitconsulting.com/colin-stasiuk/2011/04/07/jobs-jobs-jobs/</link>
		<comments>http://benchmarkitconsulting.com/colin-stasiuk/2011/04/07/jobs-jobs-jobs/#comments</comments>
		<pubDate>Thu, 07 Apr 2011 17:18:18 +0000</pubDate>
		<dc:creator>Colin Stasiuk</dc:creator>
				<category><![CDATA[Benchmark IT Consulting]]></category>
		<category><![CDATA[Colin Stasiuk]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Job Notification]]></category>
		<category><![CDATA[PBM]]></category>
		<category><![CDATA[Policy Based Management]]></category>
		<category><![CDATA[SQL Agent]]></category>

		<guid isPermaLink="false">http://benchmarkitconsulting.com/?p=1686</guid>
		<description><![CDATA[If a job fails in production and nobody is there to see it, does it get noticed? Deep huh? Well if the job actually does something important of course it will get noticed.  So the bigger question is: What can you do to make sure that YOU know about it before anyone else does?  Cause [...]]]></description>
			<content:encoded><![CDATA[<p>If a job fails in production and nobody is there to see it, does it get noticed?</p>
<p><img class="alignnone size-full wp-image-1687" title="deep" src="http://benchmarkitconsulting.com/wp-content/uploads/2011/04/deep.jpg" alt="" width="294" height="220" /></p>
<p>Deep huh? <img src='http://benchmarkitconsulting.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Well if the job actually does something important of course it will get noticed. </p>
<p>So the bigger question is:</p>
<p>What can you do to make sure that <strong>YOU</strong> know about it before anyone else does? </p>
<p>Cause who likes surprise phone calls?</p>
<p><img class="alignnone size-full wp-image-1695" title="nonono" src="http://benchmarkitconsulting.com/wp-content/uploads/2011/04/nonono.jpg" alt="" width="300" height="198" /></p>
<p>This is a multipart-answer so bare with me&#8230;</p>
<p><strong>Step 1.</strong>  Setup a Policy Based Management condition to find SQL Server Agent Jobs with NO notification on Failure</p>
<p><a href="http://benchmarkitconsulting.com/wp-content/uploads/2011/04/Condition.txt" target="_blank">DOWNLOAD CONDITION</a></p>
<p><strong>Step 2.</strong>  Setup a Policy Based Management policy to check the condition created in <strong>Step 1</strong></p>
<p><a href="http://benchmarkitconsulting.com/wp-content/uploads/2011/04/Policy.txt" target="_blank">DOWNLOAD POLICY</a></p>
<p>OK so this will do nothing more then tell you whether or not the SQL Server you are evaluating this policy against has jobs that do not have a notification on failure configured. </p>
<p>What if my SQL Server Agent has 500 jobs? How do I find the ones without failure notifications configured?</p>
<p><strong>Step 3.</strong> </p>

<div class="wp_syntax"><div class="code"><pre class="t-sql" style="font-family:monospace;">SELECT * 
FROM msdb.dbo.sysjobs 
WHERE [enabled] = 1 AND notify_level_email NOT IN (1,2,3)</pre></div></div>

<p>Fantastic <img src='http://benchmarkitconsulting.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  so what if you have 500 jobs and 499 of these jobs DO NOT have any notification on failure configured?</p>
<p><strong>Step4.</strong>  Script to update all jobs to include a notification on failure</p>
<p><strong>*** MAKE SURE YOU UNDERSTAND WHAT THIS IS DOING BEFORE RUNNING THE OUTPUT ***</strong></p>
<p><img class="alignnone size-full wp-image-1697" title="SafetyFirst" src="http://benchmarkitconsulting.com/wp-content/uploads/2011/04/SafetyFirst.jpg" alt="" width="240" height="240" /></p>
<p>What this script will do is provide you with the commands to update <strong>ALL</strong> your jobs to notify <strong>BY EMAIL </strong>to the operator you provide in the <strong>@NotifyOperator</strong> variable</p>

<div class="wp_syntax"><div class="code"><pre class="t-sql" style="font-family:monospace;">USE [msdb] 
DECLARE @NotifyOperator nvarchar(100) 
SELECT @NotifyOperator = 'DBA' 
SELECT 'EXEC msdb.dbo.sp_update_job @job_id=N''' + convert(nvarchar(50),job_id) + ''', @notify_level_email=2, @notify_email_operator_name=N''' + @NotifyOperator + '''' FROM msdb.dbo.sysjobs</pre></div></div>

<p>Tweak this as you see fit:</p>
<ul>
<li>Include a WHERE clause to exclude or include only certain jobs</li>
<li>Change additional notification options (page? net send? etc?)</li>
</ul>
<p> So there you go&#8230; you now have:</p>
<ul>
<li>A check condition and policy to identify jobs that <strong>DO NOT</strong> have some level of notification</li>
<li>A script to identify which jobs those are</li>
<li>A script to blanket update all jobs to a particular notification level and settings.</li>
</ul>
<p>Enjoy!! (Follow me on Twitter: <a href="http://twitter.com/ColinStasiuk" target="_blank">@ColinStasiuk</a>)</p>
<p><a href="http://benchmarkitconsulting.com/" target="_blank"><img title="benchmark_sm" src="http://benchmarkitconsulting.com/wp-content/uploads/2009/02/benchmark_sm.jpg" alt="" width="157" height="74" /></a></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Jobs+Jobs+Jobs+http://tinyurl.com/64gz33g" title="Post to Twitter"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-twitter-big4.png" alt="Post to Twitter" /></a> <a class="tt" href="http://delicious.com/post?url=http://benchmarkitconsulting.com/colin-stasiuk/2011/04/07/jobs-jobs-jobs/&amp;title=Jobs+Jobs+Jobs" title="Post to Delicious"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-delicious-big4.png" alt="Post to Delicious" /></a> <a class="tt" href="http://digg.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2011/04/07/jobs-jobs-jobs/&amp;title=Jobs+Jobs+Jobs" title="Post to Digg"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-digg-big4.png" alt="Post to Digg" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2011/04/07/jobs-jobs-jobs/&amp;title=Jobs+Jobs+Jobs" title="Post to StumbleUpon"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-su-big4.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://benchmarkitconsulting.com/colin-stasiuk/2011/04/07/jobs-jobs-jobs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quest POW Webcast &#8211; Audits, Audits, Audits</title>
		<link>http://benchmarkitconsulting.com/colin-stasiuk/2010/12/07/quest-pow-webcast-audits-audits-audits/</link>
		<comments>http://benchmarkitconsulting.com/colin-stasiuk/2010/12/07/quest-pow-webcast-audits-audits-audits/#comments</comments>
		<pubDate>Tue, 07 Dec 2010 15:14:02 +0000</pubDate>
		<dc:creator>Colin Stasiuk</dc:creator>
				<category><![CDATA[Benchmark IT Consulting]]></category>
		<category><![CDATA[Colin Stasiuk]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Audits]]></category>
		<category><![CDATA[CDC]]></category>
		<category><![CDATA[Change Data Capture]]></category>
		<category><![CDATA[Extended Events]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[XEvents]]></category>

		<guid isPermaLink="false">http://benchmarkitconsulting.com/?p=1595</guid>
		<description><![CDATA[I&#8217;m excited to announce that I&#8217;m doing my second Quest webcast coming up this Thursday (Dec 9th 8 a.m. Pacific / 11 a.m. Eastern)!! I&#8217;ll be doing a Pain-Of-The-Week webcast with Kevin Kline and Iain Kick on some of the auditing options that are available to you in SQL Server 2008.  Microsoft has come a [...]]]></description>
			<content:encoded><![CDATA[<p><strong></strong>I&#8217;m excited to announce that I&#8217;m doing my second Quest webcast coming up this Thursday (Dec 9th 8 a.m. Pacific / 11 a.m. Eastern)!!</p>
<p>I&#8217;ll be doing a Pain-Of-The-Week webcast with Kevin Kline and Iain Kick on some of the auditing options that are available to you in SQL Server 2008.  Microsoft has come a LONG way in providing DBAs the tools needed to audit SQL Server activity so if you haven&#8217;t had a chance to investigate this on your own hopefully this webcast will give you some motivation to give them a try.</p>
<p>Here is the abstract and link to the POW page:</p>
<p><strong><a href="http://www.quest.com/events/listdetails.aspx?contentid=12781&amp;technology=&amp;prod=&amp;prodfamily=&amp;loc=" target="_blank">Audits, Audits, Audits.</a>  </strong></p>
<p> Microsoft has given DBAs many options when it comes to auditing SQL Server activity, so it&#8217;s important to understand what methodologies you have available to you.  Your options vary depending on your version and edition and the type of information you&#8217;re looking to capture. </p>
<p> Join Kevin Kline, Iain Kick, and Colin Stasiuk as they discuss some of their experiences, how-to’s, and do&#8217;s and dont&#8217;s for some of the more common and popular auditing options, including change data capture, trigger-based auditing, and other techniques.</p>
<p><a href="http://www.quest.com/events/listdetails.aspx?contentid=12781&amp;technology=&amp;prod=&amp;prodfamily=&amp;loc=" target="_blank">Register Here</a></p>
<p>Enjoy!! (Follow me on Twitter: <a href="http://twitter.com/ColinStasiuk" target="_blank">@ColinStasiuk</a> and <a href="http://twitter.com/Tier1OnSQL" target="_blank">@Tier1OnSQL</a>)</p>
<p><a href="http://benchmarkitconsulting.com" target="_blank"><img class="alignnone size-full wp-image-402" title="benchmark_sm" src="http://benchmarkitconsulting.com/wp-content/uploads/2009/02/benchmark_sm.jpg" alt="" width="157" height="74" /></a> <a href="http://Tier1OnSQL.com"><img class="alignnone size-full wp-image-1596" title="Tier1OnSQL" src="http://benchmarkitconsulting.com/wp-content/uploads/2010/12/Tier1OnSQL.jpg" alt="" width="224" height="51" /></a></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Quest+POW+Webcast+%26%238211%3B+Audits%2C+Audits%2C+Audits+http://tinyurl.com/25yz7dt" title="Post to Twitter"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-twitter-big4.png" alt="Post to Twitter" /></a> <a class="tt" href="http://delicious.com/post?url=http://benchmarkitconsulting.com/colin-stasiuk/2010/12/07/quest-pow-webcast-audits-audits-audits/&amp;title=Quest+POW+Webcast+%26%238211%3B+Audits%2C+Audits%2C+Audits" title="Post to Delicious"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-delicious-big4.png" alt="Post to Delicious" /></a> <a class="tt" href="http://digg.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2010/12/07/quest-pow-webcast-audits-audits-audits/&amp;title=Quest+POW+Webcast+%26%238211%3B+Audits%2C+Audits%2C+Audits" title="Post to Digg"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-digg-big4.png" alt="Post to Digg" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2010/12/07/quest-pow-webcast-audits-audits-audits/&amp;title=Quest+POW+Webcast+%26%238211%3B+Audits%2C+Audits%2C+Audits" title="Post to StumbleUpon"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-su-big4.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://benchmarkitconsulting.com/colin-stasiuk/2010/12/07/quest-pow-webcast-audits-audits-audits/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Most Recent Job Status of All Enabled Jobs</title>
		<link>http://benchmarkitconsulting.com/colin-stasiuk/2009/11/17/most-recent-job-status-of-all-enabled-jobs/</link>
		<comments>http://benchmarkitconsulting.com/colin-stasiuk/2009/11/17/most-recent-job-status-of-all-enabled-jobs/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 18:50:03 +0000</pubDate>
		<dc:creator>Colin Stasiuk</dc:creator>
				<category><![CDATA[Benchmark IT Consulting]]></category>
		<category><![CDATA[Colin Stasiuk]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Central Management Server]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[Job Status]]></category>
		<category><![CDATA[Jobs]]></category>
		<category><![CDATA[Most Recent Job Status]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://benchmarkitconsulting.com/?p=1255</guid>
		<description><![CDATA[ Seems easy enough&#8230; and maybe it is easy and someone is going to comment with something fantastical *hint hint hint* but until that happens&#8230; I would like&#8230; if I may&#8230; to take you on a strange journey Use Case: I want to be able (using CMS- Central Management Server)  connect to all my SQL Servers (2000, [...]]]></description>
			<content:encoded><![CDATA[<p> Seems easy enough&#8230; and maybe it is easy and someone is going to comment with something fantastical *hint hint hint* but until that happens&#8230; I would like&#8230; if I may&#8230; to take you on a strange journey <img src='http://benchmarkitconsulting.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Use Case</strong>: I want to be able (using CMS- Central Management Server)  connect to all my SQL Servers (2000, 2005, and 2008) and get the most recent job execution status for all enabled SQL Server Agent Jobs.</p>
<p>At first I thought I was going to be smart (keep your jokes to yourself and try to concentrate <img src='http://benchmarkitconsulting.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )&#8230;. so like I was saying&#8230; at first I thought I was going to be smart and create a temp table to store the value of sp_help_job and then work with the data from there.</p>
<p>Apparently sp_help_job uses INSERT EXEC itself so when I tried to run my fancy code I got this:</p>
<div><span style="font-size: xx-small;"><span style="color: #ff0000;">Msg 8164, Level 16, State 1, Procedure sp_get_composite_job_info, Line 67</span></span></div>
<p><span style="font-size: xx-small;"><span style="color: #ff0000;">An INSERT EXEC statement cannot be nested.</span></span></p>
<p>Fail <img src='http://benchmarkitconsulting.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>So yeah&#8230; that pretty well stopped me in my tracks with that idea.   There are a couple tricks to get around that one but I either couldn&#8217;t use them cause I&#8217;m querying against SQL 2000 still or I wasn&#8217;t comfortable with the &#8220;workaround&#8221; as it felt a bit hack-fu.</p>
<p>So this is what I came up with&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="t-sql" style="font-family:monospace;">SELECT	A.Name as 'JobName', Sub5.MaxRunDate, Sub5.MaxRunTime, Sub5.MostRecentJobStatus
FROM	msdb.dbo.sysJobs A LEFT OUTER JOIN
		(SELECT	A.Job_ID, Sub4.MaxRunDate, Sub4.MaxRunTime,
				CASE	A.run_status
						WHEN 0 THEN 'Failed'
						WHEN 1 THEN 'Successful'
						WHEN 2 THEN 'Retry'
						WHEN 3 THEN 'Cancelled'
						WHEN 4 THEN 'In Progress'
				END as 'MostRecentJobStatus'
		FROM	msdb.dbo.sysJobHistory A INNER JOIN
				(	SELECT	A.Job_ID, Sub3.MaxRunDate, Sub3.MaxRunTime, Sub3.MaxStepID, MAX(A.Instance_ID) as 'MaxInstanceID'
					FROM msdb.dbo.sysJobHistory A INNER JOIN
						(	SELECT	A.Job_ID, Sub2.MaxRunDate, Sub2.MaxRunTime, MAX(A.Step_ID) as 'MaxStepID'
							FROM msdb.dbo.sysJobHistory A INNER JOIN
								(	SELECT	A.Job_ID, Sub1.MaxRunDate, MAX(A.run_time) as 'MaxRunTime'
									FROM	msdb.dbo.sysJobHistory A INNER JOIN
									(	SELECT	A.Job_ID, MAX(A.run_date) as 'MaxRunDate'
										FROM	msdb.dbo.sysJobHistory A
										GROUP BY A.Job_ID) Sub1 ON
											A.Job_ID = Sub1.Job_ID AND
											A.run_date = Sub1.MaxRunDate
									GROUP BY A.Job_ID, Sub1.MaxRunDate) Sub2 ON
										A.Job_ID = Sub2.Job_ID AND
										A.run_date = Sub2.MaxRunDate AND
										A.run_time = Sub2.MaxRunTime
							GROUP BY A.Job_ID, Sub2.MaxRunDate, Sub2.MaxRunTime) Sub3 ON
									A.Job_ID = Sub3.Job_ID AND
									A.run_date = Sub3.MaxRunDate AND
									A.run_time = Sub3.MaxRunTime AND
									A.Step_ID = Sub3.MaxStepID
						GROUP BY A.Job_ID, Sub3.MaxRunDate, Sub3.MaxRunTime, Sub3.MaxStepID) Sub4 ON
							A.Job_ID = Sub4.Job_ID AND
							A.run_date = Sub4.MaxRunDate AND
							A.run_time = Sub4.MaxRunTime AND
							A.Step_ID = Sub4.MaxStepID AND
							A.Instance_ID = Sub4.MaxInstanceID) Sub5 ON
		A.Job_ID = Sub5.Job_ID
WHERE	A.[Enabled] = 1
ORDER BY A.Name</pre></div></div>

<p>Now I&#8217;m the first to admit that this looks&#8230; well horrible&#8230;but it seems to work and get me the information I want.</p>
<p>Add in a simple <span style="color: #0000ff;">Sub5</span><span style="color: #0000ff;">.MostRecentJobStatus = &#8216;Failed&#8217;</span> and now you&#8217;re querying your whole environment for any job that has failed.</p>
<p>I do have notifications setup to email me whenever a job fails, but being a bit on the anal retentive side I like to have a script like this ready to go just in case I ever want a quick ad-hoc view of things</p>
<p>Like I said at the start of this post&#8230; I&#8217;m hoping that someone has something much easier to look at and use&#8230; so if you got it&#8230; flaunt it and comment below!!</p>
<p>Enjoy!!</p>
<p><a href="http://benchmarkitconsulting.com" target="_blank"><img class="alignnone size-full wp-image-402" title="benchmark_sm" src="http://benchmarkitconsulting.com/wp-content/uploads/2009/02/benchmark_sm.jpg" alt="" width="157" height="74" /></a><a href="http://sqlserverpedia.com/wiki/Editors#Colin_Stasiuk" target="_blank"><img src="http://sqlserverpedia.com/badges/SQLServerPedia_Badge_Blogger.jpg" alt="" width="120" height="60" /> </a></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Most+Recent+Job+Status+of+All+Enabled+Jobs+http://tinyurl.com/yz9huyx" title="Post to Twitter"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-twitter-big4.png" alt="Post to Twitter" /></a> <a class="tt" href="http://delicious.com/post?url=http://benchmarkitconsulting.com/colin-stasiuk/2009/11/17/most-recent-job-status-of-all-enabled-jobs/&amp;title=Most+Recent+Job+Status+of+All+Enabled+Jobs" title="Post to Delicious"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-delicious-big4.png" alt="Post to Delicious" /></a> <a class="tt" href="http://digg.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2009/11/17/most-recent-job-status-of-all-enabled-jobs/&amp;title=Most+Recent+Job+Status+of+All+Enabled+Jobs" title="Post to Digg"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-digg-big4.png" alt="Post to Digg" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2009/11/17/most-recent-job-status-of-all-enabled-jobs/&amp;title=Most+Recent+Job+Status+of+All+Enabled+Jobs" title="Post to StumbleUpon"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-su-big4.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://benchmarkitconsulting.com/colin-stasiuk/2009/11/17/most-recent-job-status-of-all-enabled-jobs/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Heard it from a friend who&#8230; heard it from a friend who&#8230;</title>
		<link>http://benchmarkitconsulting.com/colin-stasiuk/2009/09/25/heard-it-from-a-friend-who-heard-it-from-a-friend-who/</link>
		<comments>http://benchmarkitconsulting.com/colin-stasiuk/2009/09/25/heard-it-from-a-friend-who-heard-it-from-a-friend-who/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 14:53:31 +0000</pubDate>
		<dc:creator>Colin Stasiuk</dc:creator>
				<category><![CDATA[Benchmark IT Consulting]]></category>
		<category><![CDATA[Colin Stasiuk]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Data Purity]]></category>
		<category><![CDATA[DBINFO]]></category>
		<category><![CDATA[PBM]]></category>
		<category><![CDATA[Policy Based Management]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL 2008]]></category>

		<guid isPermaLink="false">http://benchmarkitconsulting.com/?p=1150</guid>
		<description><![CDATA[Background music while you read this post Have  I mentioned how much I love the SQL community&#8230;. Hey&#8230; have you heard that Jonathan Kehayis wrote a blog post about some uses for DBINFO and the dbi_version and dbi_createVersion values? Yeah but did you hear that Paul Randal wrote a blog post about Checking if Data Purity [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blip.fm/profile/ShockerStasiuk/blip/23352828/REO_SPEEDWAGON-TAKE_IT_ON_THE_RUN" target="_blank">Background music while you read this post</a></p>
<p>Have  I mentioned how much I love the SQL community&#8230;.</p>
<p>Hey&#8230; have you heard that <strong>Jonathan Kehayis</strong> wrote a <a href="http://sqlblog.com/blogs/jonathan_kehayias/archive/2009/07/28/database-version-vs-database-compatibility-level.aspx" target="_blank">blog post</a> about some uses for DBINFO and the dbi_version and dbi_createVersion values?</p>
<p>Yeah but did you hear that <strong>Paul Randal</strong> wrote a <a href="http://www.sqlskills.com/BLOGS/PAUL/post/CHECKDB-From-Every-Angle-How-to-tell-if-data-purity-checks-will-be-run.aspx" target="_blank">blog post</a> about Checking if Data Purity check will be run based off of the dbi_createVersion ?</p>
<p>Yeah but did you hear that <strong>Sankar Reddy</strong> wrote a <a href="http://sankarreddy.spaces.live.com/blog/cns!1F1B61765691B5CD!463.entry" target="_blank">blog post</a> about pulling the dbi_createVersion, dbi_version, and dbi_crdate for all databases in a single script?</p>
<p>Yeah but did you hear that <strong>Ken Simmons</strong> wrote a <a href="http://cybersql.blogspot.com/2009/09/query-to-make-sure-data-purity-checks.html" target="_blank">blog post</a> about checking every databases data purity flag and identifying which databases will not perform the data purity check?</p>
<p>Like I said&#8230; I love the community&#8230; a single persons blog post spawns multiple variations and building of ideas and thoughts&#8230; and even though each persons blog post is different then the rest each author makes sure to call out the others posts as excellent related reading and &#8220;inspiration&#8221; for their post.</p>
<p>Hey&#8230; did you hear that Colin Stasiuk (thanks to an idea and email request from Ken Simmons <img src='http://benchmarkitconsulting.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) added a Policy Based Management Check Condition and Policy to check every database&#8217;s data purity check value in his environment&#8230;</p>
<p><strong>CONDITION</strong></p>
<p>Download .sql file: <a href="http://benchmarkitconsulting.com/wp-content/uploads/2009/09/DataPurityFlag_Cdn.sql">DataPurityFlag_Cdn</a></p>
<p><strong>POLICY</strong></p>
<p>Download .sql file: <a href="http://benchmarkitconsulting.com/wp-content/uploads/2009/09/DataPurityFlag_Ply.sql">DataPurityFlag_Ply</a></p>
<p>(Yeah I know I said I&#8217;d do a non-PBM post this time around but it wasn&#8217;t TOTALLY my fault hehehe <img src='http://benchmarkitconsulting.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</p>
<p>Enjoy!!</p>
<p><span><a href="http://benchmarkitconsulting.com" target="_blank"><img class="alignnone size-full wp-image-402" title="benchmark_sm" src="http://benchmarkitconsulting.com/wp-content/uploads/2009/02/benchmark_sm.jpg" alt="" width="157" height="74" /></a><a href="http://sqlserverpedia.com/wiki/Editors#Colin_Stasiuk" target="_blank"><img src="http://sqlserverpedia.com/badges/SQLServerPedia_Badge_Blogger.jpg" alt="" width="120" height="60" /> </a></span></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Heard+it+from+a+friend+who%26%238230%3B+heard+it+from+a+friend+who%26%238230%3B+http://tinyurl.com/yehouse" title="Post to Twitter"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-twitter-big4.png" alt="Post to Twitter" /></a> <a class="tt" href="http://delicious.com/post?url=http://benchmarkitconsulting.com/colin-stasiuk/2009/09/25/heard-it-from-a-friend-who-heard-it-from-a-friend-who/&amp;title=Heard+it+from+a+friend+who%26%238230%3B+heard+it+from+a+friend+who%26%238230%3B" title="Post to Delicious"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-delicious-big4.png" alt="Post to Delicious" /></a> <a class="tt" href="http://digg.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2009/09/25/heard-it-from-a-friend-who-heard-it-from-a-friend-who/&amp;title=Heard+it+from+a+friend+who%26%238230%3B+heard+it+from+a+friend+who%26%238230%3B" title="Post to Digg"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-digg-big4.png" alt="Post to Digg" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2009/09/25/heard-it-from-a-friend-who-heard-it-from-a-friend-who/&amp;title=Heard+it+from+a+friend+who%26%238230%3B+heard+it+from+a+friend+who%26%238230%3B" title="Post to StumbleUpon"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-su-big4.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://benchmarkitconsulting.com/colin-stasiuk/2009/09/25/heard-it-from-a-friend-who-heard-it-from-a-friend-who/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Categorizing your Policies&#8230; yes ANOTHER PBM post</title>
		<link>http://benchmarkitconsulting.com/colin-stasiuk/2009/09/23/categorizing-your-policies-yes-another-pbm-post/</link>
		<comments>http://benchmarkitconsulting.com/colin-stasiuk/2009/09/23/categorizing-your-policies-yes-another-pbm-post/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 15:07:54 +0000</pubDate>
		<dc:creator>Colin Stasiuk</dc:creator>
				<category><![CDATA[Benchmark IT Consulting]]></category>
		<category><![CDATA[Colin Stasiuk]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Category]]></category>
		<category><![CDATA[PBM]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL 2008]]></category>

		<guid isPermaLink="false">http://benchmarkitconsulting.com/?p=1133</guid>
		<description><![CDATA[I&#8217;m sorry but I&#8217;m loving me some PBM right now. Something that I&#8217;ve found to be very useful is creating a custom Policy Category.  I have scheduled jobs that evaluates all the policies that belong to a specific category.  So what I do is I categorize the Policies that I want ran based on when [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-1134" title="beahfjd" src="http://benchmarkitconsulting.com/wp-content/uploads/2009/09/beahfjd.gif" alt="beahfjd" width="230" height="138" /></p>
<p>I&#8217;m sorry but I&#8217;m loving me some PBM right now.</p>
<p>Something that I&#8217;ve found to be very useful is creating a custom Policy Category.  I have scheduled jobs that evaluates all the policies that belong to a specific category.  So what I do is I categorize the Policies that I want ran based on when I want them run.  Currently I have 2 custom categories (Daily and Weekly).</p>
<p>A question you may be asking is why wouldn&#8217;t you just check all your policies every day?  If you&#8217;ve played with Policy Based Management and have been running it against multiple server, multiple dbs, etc you&#8217;ll know that it doesn&#8217;t take long before your job takes 15, 20, 30 minutes to finish&#8230; I&#8217;m a fan of minimizing the amount of &#8220;admin&#8221; work being done on my instances so if there are some policies that I don&#8217;t feel are critical then I wont run them every day.</p>
<p>Some Examples Below:</p>
<p><strong>Daily &#8211; </strong>Last Successful Full Backup Date, Database has less then 10 Pct Free Space</p>
<p><strong>Weekly</strong> -  Database Auto Shrink, Data and Log File Location</p>
<p>Now these aren&#8217;t ALL my policies that I check but just some examples. </p>
<p>The daily policies are what I consider to be the most critical and I want to know the status every day so that if something does not conform it can be immediately actioned.  Now I would have alerts and notifications setup for some of these scenarios as well but some things are important enough (backups) that I don&#8217;t like relying on only one check.</p>
<p>The weekly policies are ones that I consider to be VERY unlikely to change but still want and like the weekly sniff test to make sure things are inline with what my expectations are. </p>
<p>Creating a new Policy Category is as easy as right clicking on a Policy and going to the properties.  If you click on the Description page on the left hand side you&#8217;ll see the following window:</p>
<p><img class="alignnone size-full wp-image-1139" title="pbmcatg" src="http://benchmarkitconsulting.com/wp-content/uploads/2009/09/pbmcatg.png" alt="pbmcatg" width="426" height="355" /></p>
<p>If you click on the &#8220;New&#8221; button you can enter a new category and then start assigning policies to that category.</p>
<p>And once you&#8217;ve started going &#8220;Category-Crazy&#8221; you might be wanting a query to see your categories and the policies assigned to those categories so I&#8217;ll save you some trouble:</p>

<div class="wp_syntax"><div class="code"><pre class="t-sql" style="font-family:monospace;">SELECT	B.name as 'CategoryName', A.name as 'PolicyName', A.is_enabled
FROM	msdb.dbo.syspolicy_policies_internal A INNER JOIN
		msdb.dbo.syspolicy_policy_categories_internal B ON A.policy_category_id = B.policy_category_id
ORDER BY B.name, A.name</pre></div></div>

<p>(I promise the next post will not be about PBM&#8230;. well I&#8217;ll try at least <img src='http://benchmarkitconsulting.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  LOL )</p>
<p>Enjoy!!</p>
<p><span><a href="http://benchmarkitconsulting.com" target="_blank"><img class="alignnone size-full wp-image-402" title="benchmark_sm" src="http://benchmarkitconsulting.com/wp-content/uploads/2009/02/benchmark_sm.jpg" alt="" width="157" height="74" /></a><a href="http://sqlserverpedia.com/wiki/Editors#Colin_Stasiuk" target="_blank"><img src="http://sqlserverpedia.com/badges/SQLServerPedia_Badge_Blogger.jpg" alt="" width="120" height="60" /> </a></span></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Categorizing+your+Policies%26%238230%3B+yes+ANOTHER+PBM+post+http://tinyurl.com/lzx699" title="Post to Twitter"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-twitter-big4.png" alt="Post to Twitter" /></a> <a class="tt" href="http://delicious.com/post?url=http://benchmarkitconsulting.com/colin-stasiuk/2009/09/23/categorizing-your-policies-yes-another-pbm-post/&amp;title=Categorizing+your+Policies%26%238230%3B+yes+ANOTHER+PBM+post" title="Post to Delicious"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-delicious-big4.png" alt="Post to Delicious" /></a> <a class="tt" href="http://digg.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2009/09/23/categorizing-your-policies-yes-another-pbm-post/&amp;title=Categorizing+your+Policies%26%238230%3B+yes+ANOTHER+PBM+post" title="Post to Digg"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-digg-big4.png" alt="Post to Digg" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2009/09/23/categorizing-your-policies-yes-another-pbm-post/&amp;title=Categorizing+your+Policies%26%238230%3B+yes+ANOTHER+PBM+post" title="Post to StumbleUpon"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-su-big4.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://benchmarkitconsulting.com/colin-stasiuk/2009/09/23/categorizing-your-policies-yes-another-pbm-post/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fail Whale for SSMS and CMS for PBM using PS</title>
		<link>http://benchmarkitconsulting.com/colin-stasiuk/2009/09/22/failwhaleforssmsandcms/</link>
		<comments>http://benchmarkitconsulting.com/colin-stasiuk/2009/09/22/failwhaleforssmsandcms/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 21:56:50 +0000</pubDate>
		<dc:creator>Colin Stasiuk</dc:creator>
				<category><![CDATA[Benchmark IT Consulting]]></category>
		<category><![CDATA[Colin Stasiuk]]></category>
		<category><![CDATA[Maintenance]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[PBM]]></category>
		<category><![CDATA[Policy Based Management]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[PS]]></category>
		<category><![CDATA[SQL Server Management Studio]]></category>
		<category><![CDATA[SSMS]]></category>

		<guid isPermaLink="false">http://benchmarkitconsulting.com/?p=1126</guid>
		<description><![CDATA[Translation: Fail Whale for SQL Server Management Studio and Central Management Server for Policy Based Managment using PowerShell&#8230;. lol simple eh? So this is a Microsoft Connect Item in the making&#8230; I had created a PowerShell script to run a bunch of policies against a list of servers that I defined in a ServerList.txt file.  [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-1127" title="fwwwwww" src="http://benchmarkitconsulting.com/wp-content/uploads/2009/09/fwwwwww.png" alt="fwwwwww" width="240" height="180" /></p>
<p>Translation: Fail Whale for SQL Server Management Studio and Central Management Server for Policy Based Managment using PowerShell&#8230;. lol simple eh?</p>
<p>So this is a Microsoft Connect Item in the making&#8230;</p>
<p>I had created a PowerShell script to run a bunch of policies against a list of servers that I defined in a ServerList.txt file.  I decided that I didn&#8217;t like the idea of needing to maintain a text file and instead of storing the Instance Names in a table somewhere I decided to hook into the Central Managment Server.</p>
<p>So I logged into the server that is currently running the SQL Server Agent job that was doing all this using a ServerList.txt file.  I changed the PowerShell Script to point to my CMS server instead and ran the .ps1 directly on the server using &#8220;sqlps F:\PBM\EvaluatePolicies.ps1&#8243;.  The script ran as expected, used my CMS server, and everything was tickidyboo.  Or so I thought&#8230;.</p>
<p>I decided to do my final check and run the SQL Server Agent job itself&#8230; and it failed.</p>
<p><img class="alignnone size-full wp-image-1129" title="toslkdsl" src="http://benchmarkitconsulting.com/wp-content/uploads/2009/09/toslkdsl.jpg" alt="toslkdsl" width="168" height="132" /></p>
<p>Hmmmm that&#8217;s weird&#8230; so I confirmed that the SQL Server Agent account had access to the CMS server and even granted it explicit sysadmin rights (just for my troubleshooting).</p>
<p><strong>FAIL</strong></p>
<p>I started tweeting about the problem and got some immediate advice from @<a href="http://twitter.com/afernandez" target="_blank">afernandez</a>, <a href="http://twitter.com/russjohnson">@russjohnson</a>, <a href="http://twitter.com/wendy_dance">@wendy_dance</a>, and <a href="http://twitter.com/sqlchicken">@SQLChicken</a>.  While none of the advice solved my problem it was great to have some other &#8220;eyes&#8221; reading my problem and confirming the stuff that I had already thought of and tested.</p>
<p>The SQL Server Agent Service Account is a secure account that I don&#8217;t even have access or the password for so I asked for some help from one of our Server Admins for my troubleshooting&#8230; he logged into the server for me and I tried to run the ps1 file&#8230;.</p>
<p><strong>FAIL</strong></p>
<p>So I opened up SSMS and checked if I could connect to the CMS directly&#8230;.</p>
<p><strong><span style="text-decoration: underline;">SOLUTION:  </span></strong>In order to use a PowerShell script to connect to the Central Management Server using the SQL Server Agent the service account that SQL Server Agent is running under must REGISTER the CMS Server through SSMS on the Server that is running the job.</p>
<p>Did you get all that&#8230;. because I had never Remote Desktopped onto the Server using the SQL Server Agent service account and Registered the CMS Server in SSMS using that account when I tried to access the CMS Server through my PowerShell script it failed.</p>
<p>I registered the CMS Server using the SQL Server Agent Service Account and everything started sizzling like bacon on a hot pan.</p>
<p>Enjoy!!</p>
<p><span><a href="http://benchmarkitconsulting.com" target="_blank"><img class="alignnone size-full wp-image-402" title="benchmark_sm" src="http://benchmarkitconsulting.com/wp-content/uploads/2009/02/benchmark_sm.jpg" alt="" width="157" height="74" /></a><a href="http://sqlserverpedia.com/wiki/Editors#Colin_Stasiuk" target="_blank"><img src="http://sqlserverpedia.com/badges/SQLServerPedia_Badge_Blogger.jpg" alt="" width="120" height="60" /> </a></span></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Fail+Whale+for+SSMS+and+CMS+for+PBM+using+PS+http://tinyurl.com/npkg83" title="Post to Twitter"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-twitter-big4.png" alt="Post to Twitter" /></a> <a class="tt" href="http://delicious.com/post?url=http://benchmarkitconsulting.com/colin-stasiuk/2009/09/22/failwhaleforssmsandcms/&amp;title=Fail+Whale+for+SSMS+and+CMS+for+PBM+using+PS" title="Post to Delicious"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-delicious-big4.png" alt="Post to Delicious" /></a> <a class="tt" href="http://digg.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2009/09/22/failwhaleforssmsandcms/&amp;title=Fail+Whale+for+SSMS+and+CMS+for+PBM+using+PS" title="Post to Digg"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-digg-big4.png" alt="Post to Digg" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2009/09/22/failwhaleforssmsandcms/&amp;title=Fail+Whale+for+SSMS+and+CMS+for+PBM+using+PS" title="Post to StumbleUpon"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-su-big4.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://benchmarkitconsulting.com/colin-stasiuk/2009/09/22/failwhaleforssmsandcms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Look what I can do!! (w/Policy Based Management)</title>
		<link>http://benchmarkitconsulting.com/colin-stasiuk/2009/09/18/look-what-i-can-do-wpolicy-based-management/</link>
		<comments>http://benchmarkitconsulting.com/colin-stasiuk/2009/09/18/look-what-i-can-do-wpolicy-based-management/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 14:24:13 +0000</pubDate>
		<dc:creator>Colin Stasiuk</dc:creator>
				<category><![CDATA[Benchmark IT Consulting]]></category>
		<category><![CDATA[Colin Stasiuk]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Email Notification]]></category>
		<category><![CDATA[ExecuteSQL]]></category>
		<category><![CDATA[Jobs]]></category>
		<category><![CDATA[PBM]]></category>
		<category><![CDATA[Policy Based Management]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL 2008]]></category>
		<category><![CDATA[SQL Agent]]></category>

		<guid isPermaLink="false">http://benchmarkitconsulting.com/?p=1100</guid>
		<description><![CDATA[If you&#8217;ve never watched Stuart from MadTV the Title of this blog post will probably be lost on you but if you want to get up to speed just Watch This Video on YouTube So if you read my blog (first thanks!! ) you know that I&#8217;ve been having a love affair lately with Policy [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-1101" title="StuMafjdkf" src="http://benchmarkitconsulting.com/wp-content/uploads/2009/09/StuMafjdkf.jpg" alt="StuMafjdkf" width="259" height="287" /></p>
<p>If you&#8217;ve never watched Stuart from MadTV the Title of this blog post will probably be lost on you but if you want to get up to speed just <a href="http://www.youtube.com/watch?v=I4aAUq_AiPg&amp;feature=related" target="_blank">Watch This Video on YouTube</a></p>
<p>So if you read my blog (first thanks!! <img src='http://benchmarkitconsulting.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) you know that I&#8217;ve been having a love affair lately with Policy Based Management.  I&#8217;m starting to look outside of the canned Policies and working on creating my own.  I wanted to start simple just to get something going so I came up with an idea for a policy:</p>
<p><strong>Jobs That Do Not Have Email Operator On Failure Enabled</strong></p>
<p>So first I created my Condition:</p>
<ul>
<li>Name: SQLAgentJobsWithNoNotificationOnFailure</li>
<li>Facet: Server (I picked server because the query I&#8217;m going to be only needs to be ran once vs msdb)</li>
</ul>
<p>I built my SQL Statement:</p>

<div class="wp_syntax"><div class="code"><pre class="t-sql" style="font-family:monospace;">SELECT	COUNT(*)
FROM	msdb.dbo.sysjobs
WHERE	[enabled]  = 1 AND
		notify_level_email != 2</pre></div></div>

<p>and went to add it to the &#8220;Field&#8221; column of my condition but I remembered the <a href="http://thomaslarock.com/2009/08/policy-based-management-podcast-part-2/" target="_blank">Podcast by Brent Ozar and Thomas LaRock</a> where they demoed the ExecuteSQL() function within Policy Based Management.</p>
<p>So my code in my field column ended up looking like this instead:</p>

<div class="wp_syntax"><div class="code"><pre class="t-sql" style="font-family:monospace;">EXECUTESQL('numeric', 'SELECT	COUNT(*)
FROM	msdb.dbo.sysjobs
WHERE	name NOT LIKE ''%TestDatabaseMail%'' AND
		[enabled]  = 1 AND
		notify_level_email != 2')</pre></div></div>

<p> So then I populated the expected value&#8230;.   = 0 and I was ready to go.</p>
<p>I next created my Policy using my new Check condition and voila, I just built my first custom Policy.  I evaluated the Policy and saw immediate value as there were a couple production jobs that did NOT have any email notification set on failure.</p>
<p>My love affair with Policy Based Management continues&#8230; I think I&#8217;m ready to commit and start picking out china together. <img src='http://benchmarkitconsulting.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Happy Friday!!!</p>
<p>P.S. Already working on v.2 of the policy&#8230; I want to be able to filter particular jobs as well as return the list of non conforming jobs <img src='http://benchmarkitconsulting.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  stay tuned LOL</p>
<p>Enjoy!!</p>
<p><span><a href="http://benchmarkitconsulting.com" target="_blank"><img class="alignnone size-full wp-image-402" title="benchmark_sm" src="http://benchmarkitconsulting.com/wp-content/uploads/2009/02/benchmark_sm.jpg" alt="" width="157" height="74" /></a><a href="http://sqlserverpedia.com/wiki/Editors#Colin_Stasiuk" target="_blank"><img src="http://sqlserverpedia.com/badges/SQLServerPedia_Badge_Blogger.jpg" alt="" width="120" height="60" /> </a></span></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Look+what+I+can+do%21%21+%28w%2FPolicy+Based+Management%29+http://tinyurl.com/nl6mdq" title="Post to Twitter"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-twitter-big4.png" alt="Post to Twitter" /></a> <a class="tt" href="http://delicious.com/post?url=http://benchmarkitconsulting.com/colin-stasiuk/2009/09/18/look-what-i-can-do-wpolicy-based-management/&amp;title=Look+what+I+can+do%21%21+%28w%2FPolicy+Based+Management%29" title="Post to Delicious"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-delicious-big4.png" alt="Post to Delicious" /></a> <a class="tt" href="http://digg.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2009/09/18/look-what-i-can-do-wpolicy-based-management/&amp;title=Look+what+I+can+do%21%21+%28w%2FPolicy+Based+Management%29" title="Post to Digg"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-digg-big4.png" alt="Post to Digg" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2009/09/18/look-what-i-can-do-wpolicy-based-management/&amp;title=Look+what+I+can+do%21%21+%28w%2FPolicy+Based+Management%29" title="Post to StumbleUpon"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-su-big4.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://benchmarkitconsulting.com/colin-stasiuk/2009/09/18/look-what-i-can-do-wpolicy-based-management/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Hiding Your &#8220;Kibbles and Bits&#8221;</title>
		<link>http://benchmarkitconsulting.com/colin-stasiuk/2009/09/17/hiding-your-kibbles-and-bits/</link>
		<comments>http://benchmarkitconsulting.com/colin-stasiuk/2009/09/17/hiding-your-kibbles-and-bits/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 15:10:35 +0000</pubDate>
		<dc:creator>Colin Stasiuk</dc:creator>
				<category><![CDATA[Benchmark IT Consulting]]></category>
		<category><![CDATA[Colin Stasiuk]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[PBM]]></category>
		<category><![CDATA[SAC]]></category>
		<category><![CDATA[SQL 2008]]></category>
		<category><![CDATA[Surface Area]]></category>

		<guid isPermaLink="false">http://benchmarkitconsulting.com/?p=1090</guid>
		<description><![CDATA[One guess on who&#8217;s having WAY TOO MUCH FUN blogging these day?? LOL Too often DBAs don&#8217;t take the time to review their environments and their surface area exposure.  You want to evaluate the features that you&#8217;ve enabled and determine if they are required.  The less features enabled, the less likelyhood that you will have a [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-1089" title="DBSGoneWild" src="http://benchmarkitconsulting.com/wp-content/uploads/2009/09/DBSGoneWild.png" alt="DBSGoneWild" width="290" height="397" /></p>
<p>One guess on who&#8217;s having WAY TOO MUCH FUN blogging these day?? LOL</p>
<p>Too often DBAs don&#8217;t take the time to review their environments and their surface area exposure.  You want to evaluate the features that you&#8217;ve enabled and determine if they are required.  The less features enabled, the less likelyhood that you will have a successful attack on your environment.</p>
<p>In SQL Server 2005 the SQL Server Surface Area Configuration Tool was used by DBAs to review and manually turn on/off features in the product.  The Surface Area Configuration Tool has been removed in SQL Server 2008.  So where would one go now to review their surface area exposure?</p>
<p>Enter one of my new best friends&#8230; Policy Based Management.</p>
<p>SQL Server 2008 Policy Based Management comes with 4 policies for Surface Area evaluation</p>
<ul>
<li>Surface Area Configuration for Database Engine 2005 and 2000 features</li>
<li>Surface Area Configuration for Database Engine 2008 features</li>
<li>Surface Area Configuration for Service Broker Endpoints</li>
<li>Surface Area Configuration for SOAP Endpoints</li>
</ul>
<p>The Policy we&#8217;re going to look at in this post is the Surface Area Configuration for Database Engine 2008 Features.  This Policy uses the condition Surface Area Configuration for Database Engine 2008 Features which ties to the Surface Area Configuration facet.</p>
<p>By default the following settings are used:</p>
<ul>
<li>AdHocRemoteQueriesEnabled &#8211; False</li>
<li>ClrIntegrationEnabled &#8211; False</li>
<li>DatabaseMailEnabled &#8211; False</li>
<li>OleAutomationEnabled &#8211; False</li>
<li>RemoteDacEnabled &#8211; False</li>
<li>ServiceBrokerEndpointActive &#8211; False</li>
<li>SoapEndpointsEnabled &#8211; False</li>
<li>SQLMailEnabled &#8211; False</li>
<li>xpcmdshellEnabled &#8211; False</li>
</ul>
<p>Now keep in mind that these are configurable (from within the check condition) and in your environment you might not be able to conform to the point where this Policy will come back with the nice happy green arrow.  I for one use DatabaseMail so this is something that I&#8217;ve had to change in the check condition.</p>
<p>The idea here is that Policy Based Managment can give you a great look into your surface area exposure and where you might be able to investigate and possibly disable some features to minimize the likelyhood of a successful attack&#8230; and don&#8217;t you SQL 2000 and SQL 2005 DBAs fret as noted above there is a policy built as well just for you (Surface Area Configuration for Database Engine 2005 and 2000 features).</p>
<p>So do your best review and to minimize your surface area exposure and not have your &#8220;kibbles and bits&#8221; out there for the world to see <img src='http://benchmarkitconsulting.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Enjoy!!</p>
<p><span><a href="http://benchmarkitconsulting.com" target="_blank"><img class="alignnone size-full wp-image-402" title="benchmark_sm" src="http://benchmarkitconsulting.com/wp-content/uploads/2009/02/benchmark_sm.jpg" alt="" width="157" height="74" /></a><a href="http://sqlserverpedia.com/wiki/Editors#Colin_Stasiuk" target="_blank"><img src="http://sqlserverpedia.com/badges/SQLServerPedia_Badge_Blogger.jpg" alt="" width="120" height="60" /> </a></span></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Hiding+Your+%26%238220%3BKibbles+and+Bits%26%238221%3B+http://tinyurl.com/mpgk9j" title="Post to Twitter"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-twitter-big4.png" alt="Post to Twitter" /></a> <a class="tt" href="http://delicious.com/post?url=http://benchmarkitconsulting.com/colin-stasiuk/2009/09/17/hiding-your-kibbles-and-bits/&amp;title=Hiding+Your+%26%238220%3BKibbles+and+Bits%26%238221%3B" title="Post to Delicious"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-delicious-big4.png" alt="Post to Delicious" /></a> <a class="tt" href="http://digg.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2009/09/17/hiding-your-kibbles-and-bits/&amp;title=Hiding+Your+%26%238220%3BKibbles+and+Bits%26%238221%3B" title="Post to Digg"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-digg-big4.png" alt="Post to Digg" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://benchmarkitconsulting.com/colin-stasiuk/2009/09/17/hiding-your-kibbles-and-bits/&amp;title=Hiding+Your+%26%238220%3BKibbles+and+Bits%26%238221%3B" title="Post to StumbleUpon"><img class="nothumb" src="http://benchmarkitconsulting.com/wp-content/plugins/tweet-this/icons/tt-su-big4.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://benchmarkitconsulting.com/colin-stasiuk/2009/09/17/hiding-your-kibbles-and-bits/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

