<?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>The SQL UPDATE Statement &#187; Policy Based Management</title>
	<atom:link href="http://sqlchicken.com/category/policy-based-management/feed/" rel="self" type="application/rss+xml" />
	<link>http://sqlchicken.com</link>
	<description>SQL Server DBA Tips &#38; Tricks</description>
	<lastBuildDate>Mon, 23 Jan 2012 20:32:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Expiring Databases and Policy-Based Management</title>
		<link>http://sqlchicken.com/2011/10/expiring-databases-and-policy-based-management/</link>
		<comments>http://sqlchicken.com/2011/10/expiring-databases-and-policy-based-management/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 14:30:46 +0000</pubDate>
		<dc:creator>Jorge Segarra</dc:creator>
				<category><![CDATA[Policy Based Management]]></category>
		<category><![CDATA[Syndication]]></category>

		<guid isPermaLink="false">http://sqlchicken.com/?p=1740</guid>
		<description><![CDATA[Today on Twitter my friend Jes “Run Forrest Run” Schultz Borland (Blog &#124; Twitter) asked the Community “How do you clean up your dev environments? Let DBs sit out there forever? Delete after X months? Other? This seemed like an interesting issue to tackle and me being the PBM freak that I am, immediately I [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsqlchicken.com%2F2011%2F10%2Fexpiring-databases-and-policy-based-management%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsqlchicken.com%2F2011%2F10%2Fexpiring-databases-and-policy-based-management%2F&amp;source=sqlchicken&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8d158ff2dba4d5aff99dc83fde7e6c2d&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Today on Twitter my friend Jes “Run Forrest Run” Schultz Borland (<a href="http://blogs.lessthandot.com/index.php?disp=authdir&amp;author=420">Blog </a>| <a href="http://twitter.com/#!/grrl_geek" target="_blank">Twitter</a>) asked the Community “How do you clean up your dev environments? Let DBs sit out there forever? Delete after X months? Other? This seemed like an interesting issue to tackle and me being the PBM freak that I am, immediately I had a light bulb moment for a policy. In this post I’ll show you a policy you can run against your databases (can work in dev or whatever environment suits you) and will tell you which databases are older than 30 days old. As an added bonus, I’ll also show you how to add a custom extended property to set a custom expiration date.</p>
<p><span id="more-1740"></span></p>
<h2>Custom Expiration Date</h2>
<p>First we’re going to modify our existing databases to define an expiration date. How are we going to do this? We’re going to add an <a href="http://msdn.microsoft.com/en-us/library/ms190243.aspx" target="_blank">extended property</a> to our database. To do so on one database use the stored procedure sys.sp_addextendedproperty. The following code uses this stored procedure to add an extended property called ‘ExpDate’ with a value of ‘11/11/2011’.</p>
<pre class="”prettyprint">EXEC AdventureWorks.sys.sp_addextendedproperty @name=N'ExpDate', @value=N'11/11/2011'</pre>
<p>Why are we only doing this on one database? Well it will make more sense later when we run our policy against all our databases in our instance. Next up, the policy itself. As always I’m providing both the T-SQL for the policy or you can download the XML and import the policy directly.</p>
<p><a href="https://skydrive.live.com/?cid=54dc52b8716783a2&amp;sc=documents&amp;uc=1&amp;id=54DC52B8716783A2%21627#" target="_blank">Download ‘Expire Development Databases’ Policy Here</a></p>
<p>T-SQL:</p>
<pre class="”prettyprint">--Create condition first
Declare @condition_id int
EXEC msdb.dbo.sp_syspolicy_add_condition @name=N'Databases older than 1 month', @description=N'', @facet=N'Database', @expression=N'&lt;Operator&gt;
  &lt;TypeClass&gt;Bool&lt;/TypeClass&gt;
  &lt;OpType&gt;OR&lt;/OpType&gt;
  &lt;Count&gt;2&lt;/Count&gt;
  &lt;Operator&gt;
    &lt;TypeClass&gt;Bool&lt;/TypeClass&gt;
    &lt;OpType&gt;GE&lt;/OpType&gt;
    &lt;Count&gt;2&lt;/Count&gt;
    &lt;Attribute&gt;
      &lt;TypeClass&gt;DateTime&lt;/TypeClass&gt;
      &lt;Name&gt;CreateDate&lt;/Name&gt;
    &lt;/Attribute&gt;
    &lt;Function&gt;
      &lt;TypeClass&gt;DateTime&lt;/TypeClass&gt;
      &lt;FunctionType&gt;DateAdd&lt;/FunctionType&gt;
      &lt;ReturnType&gt;DateTime&lt;/ReturnType&gt;
      &lt;Count&gt;3&lt;/Count&gt;
      &lt;Constant&gt;
        &lt;TypeClass&gt;String&lt;/TypeClass&gt;
        &lt;ObjType&gt;System.String&lt;/ObjType&gt;
        &lt;Value&gt;day&lt;/Value&gt;
      &lt;/Constant&gt;
      &lt;Constant&gt;
        &lt;TypeClass&gt;Numeric&lt;/TypeClass&gt;
        &lt;ObjType&gt;System.Double&lt;/ObjType&gt;
        &lt;Value&gt;-30&lt;/Value&gt;
      &lt;/Constant&gt;
      &lt;Function&gt;
        &lt;TypeClass&gt;DateTime&lt;/TypeClass&gt;
        &lt;FunctionType&gt;GetDate&lt;/FunctionType&gt;
        &lt;ReturnType&gt;DateTime&lt;/ReturnType&gt;
        &lt;Count&gt;0&lt;/Count&gt;
      &lt;/Function&gt;
    &lt;/Function&gt;
  &lt;/Operator&gt;
  &lt;Operator&gt;
    &lt;TypeClass&gt;Bool&lt;/TypeClass&gt;
    &lt;OpType&gt;GT&lt;/OpType&gt;
    &lt;Count&gt;2&lt;/Count&gt;
    &lt;Function&gt;
      &lt;TypeClass&gt;DateTime&lt;/TypeClass&gt;
      &lt;FunctionType&gt;ExecuteSql&lt;/FunctionType&gt;
      &lt;ReturnType&gt;DateTime&lt;/ReturnType&gt;
      &lt;Count&gt;2&lt;/Count&gt;
      &lt;Constant&gt;
        &lt;TypeClass&gt;String&lt;/TypeClass&gt;
        &lt;ObjType&gt;System.String&lt;/ObjType&gt;
        &lt;Value&gt;DateTime&lt;/Value&gt;
      &lt;/Constant&gt;
      &lt;Constant&gt;
        &lt;TypeClass&gt;String&lt;/TypeClass&gt;
        &lt;ObjType&gt;System.String&lt;/ObjType&gt;
        &lt;Value&gt;SELECT value FROM sys.extended_properties&amp;lt;?char 13?&amp;gt;
WHERE name = ''''ExpDate''''&lt;/Value&gt;
      &lt;/Constant&gt;
    &lt;/Function&gt;
    &lt;Function&gt;
      &lt;TypeClass&gt;DateTime&lt;/TypeClass&gt;
      &lt;FunctionType&gt;GetDate&lt;/FunctionType&gt;
      &lt;ReturnType&gt;DateTime&lt;/ReturnType&gt;
      &lt;Count&gt;0&lt;/Count&gt;
    &lt;/Function&gt;
  &lt;/Operator&gt;
&lt;/Operator&gt;', @is_name_condition=0, @obj_name=N'', @condition_id=@condition_id OUTPUT
Select @condition_id

GO

--Now create the policy itself using the newly created condition
Declare @object_set_id int
EXEC msdb.dbo.sp_syspolicy_add_object_set @object_set_name=N'Expire Development Databases_ObjectSet', @facet=N'Database', @object_set_id=@object_set_id OUTPUT
Select @object_set_id

Declare @target_set_id int
EXEC msdb.dbo.sp_syspolicy_add_target_set @object_set_name=N'Expire Development Databases_ObjectSet', @type_skeleton=N'Server/Database', @type=N'DATABASE', @enabled=True, @target_set_id=@target_set_id OUTPUT
Select @target_set_id

EXEC msdb.dbo.sp_syspolicy_add_target_set_level @target_set_id=@target_set_id, @type_skeleton=N'Server/Database', @level_name=N'Database', @condition_name=N'', @target_set_level_id=0
GO

Declare @policy_id int
EXEC msdb.dbo.sp_syspolicy_add_policy @name=N'Expire Development Databases', @condition_name=N'Databases older than 1 month', @policy_category=N'', @description=N'', @help_text=N'', @help_link=N'', @schedule_uid=N'00000000-0000-0000-0000-000000000000', @execution_mode=0, @is_enabled=False, @policy_id=@policy_id OUTPUT, @root_condition_name=N'', @object_set=N'Expire Development Databases_ObjectSet'
Select @policy_id
GO</pre>
<p>So let’s talk about this policy first before we run it. The condition on this policy is checking for two things. The first is to see if the creation date of the database is more than 30 days from the current date. Of course you can go into the condition and modify it to whatever you’d like but for the purposes of this post we’re using 30 days. Additionally we also have another clause using OR that is checking the value of the extended property field to see if that custom date is greater than the current date. How did we do this? We use the advanced editor in the condition creator and use the executesql function to query the database for the value of the ExpDate property. If no extended property exists for that database then the policy will simply use the 30 day condition clause mentioned earlier.</p>
<p><a href="http://sqlchicken.com/wp-content/uploads/2011/10/image.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://sqlchicken.com/wp-content/uploads/2011/10/image_thumb.png" alt="image" width="526" height="322" border="0" /></a><a href="http://sqlchicken.com/wp-content/uploads/2011/10/image1.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://sqlchicken.com/wp-content/uploads/2011/10/image_thumb1.png" alt="image" width="298" height="322" border="0" /></a></p>
<p>So now that we&#8217;ve seen the policy and its condition let&#8217;s see it in action! I&#8217;ve run this policy against the databases on my instance and we get mixed results here. Overall we see a bunch of databases that don&#8217;t pass the policy but we have one that does.</p>
<p><a href="http://sqlchicken.com/wp-content/uploads/2011/10/image2.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border: 0px;" title="image" src="http://sqlchicken.com/wp-content/uploads/2011/10/image_thumb2.png" alt="image" width="388" height="322" border="0" /></a></p>
<p><a href="http://sqlchicken.com/wp-content/uploads/2011/10/image3.png"><img class="aligncenter" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" src="http://sqlchicken.com/wp-content/uploads/2011/10/image_thumb3.png" alt="image" width="549" height="322" border="0" /></a><a href="http://sqlchicken.com/wp-content/uploads/2011/10/image4.png"><img class="aligncenter" style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" src="http://sqlchicken.com/wp-content/uploads/2011/10/image_thumb4.png" alt="image" width="523" height="320" border="0" /></a></p>
<p>As you can see from the screenshots above, the policy that passed did so because it passed our secondary clause in our policy. The policy was run (at the time of this posting) on October 6th 2011. The expected expiration date from the first clause expects a date 30 days ago, which is September 6th. Our second clause, however, instead looks at the value of the extended property we set earlier. Since today’s date is less than that of the property set value of November 11th, the database is still considered to be current and active!</p>
<h2>Next Steps</h2>
<p>While this policy evaluation doesn’t let you take any action against the databases, this does give you a listing of what databases you should be paying attention to. This method lets you quickly identify which databases you should be “cleaning up” in your environments. You can schedule a policy like this to run only against your development environments by using the Central Management Server’s (CMS) functionality in conjunction with the <a href="http://epmframework.codeplex.com/" target="_blank">Enterprise Policy Management Framework</a>. The nice thing about using EPMFramework here is that results are saved in a database and you&#8217;re able to see those results in the great built-in reports. To see how to use CMS with Policy-Based Management, check out my webinar from the <a href="http://www.sqlpass.org/LearningCenter/SessionRecordings/24HoursFall2011.aspx" target="_blank">recent 24 Hours of PASS event</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://sqlchicken.com/2011/10/expiring-databases-and-policy-based-management/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Make It Simple With Policy-Based Management</title>
		<link>http://sqlchicken.com/2011/07/make-it-simple-with-policy-based-management/</link>
		<comments>http://sqlchicken.com/2011/07/make-it-simple-with-policy-based-management/#comments</comments>
		<pubDate>Wed, 13 Jul 2011 14:00:09 +0000</pubDate>
		<dc:creator>Jorge Segarra</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Policy Based Management]]></category>
		<category><![CDATA[Syndication]]></category>

		<guid isPermaLink="false">http://sqlchicken.com/?p=1635</guid>
		<description><![CDATA[At work recently, I explained to a coworker the reasons and benefits of having databases in Simple mode in your development environment. Funnily enough, a few hours later, I see my friend Andie Letourneau (Blog &#124; Twitter) posted a blog on how to adjust your recovery modes in development. While Andie&#8217;s homework assignment is to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsqlchicken.com%2F2011%2F07%2Fmake-it-simple-with-policy-based-management%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsqlchicken.com%2F2011%2F07%2Fmake-it-simple-with-policy-based-management%2F&amp;source=sqlchicken&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8d158ff2dba4d5aff99dc83fde7e6c2d&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>At work recently, I explained to a coworker the reasons and benefits of having databases in Simple mode in your development environment. Funnily enough, a few hours later, I see my friend Andie Letourneau (<a href="http://ladyruna.blogspot.com">Blog </a>| <a href="http://twitter.com/ladyruna">Twitter</a>) posted a blog on <a href="http://ladyruna.blogspot.com/2011/07/sql-recovery-mode-adjustment.html">how to adjust your recovery modes in development</a>. While Andie&#8217;s homework assignment is to substitute it with a WHILE loop, I have MUCH simpler solution using Policy-Based Management!</p>
<p>First, let’s create the condition and policy. As always you can either use this T-SQL or you can simply download the XML policy and import it:</p>
<p><a href="https://skydrive.live.com/?cid=54dc52b8716783a2&amp;sc=documents&amp;uc=1&amp;id=54DC52B8716783A2%21627#" target="_blank">Download Policy Here</a></p>
<p><strong>TSQL</strong>:</p>
<pre class="sql">--Create Condition First
Declare @condition_id int
EXEC msdb.dbo.sp_syspolicy_add_condition @name=N'Simple Recovery Mode', @description=N'Ensures databases are set to SIMPLE recovery mode', @facet=N'Database', @expression=N'
  Bool
  EQ
  2

    Numeric
    RecoveryModel

    Numeric
    Enum
    Numeric
    2

      String
      System.String
      Microsoft.SqlServer.Management.Smo.RecoveryModel

      String
      System.String
      Simple

', @is_name_condition=0, @obj_name=N'', @condition_id=@condition_id OUTPUT
Select @condition_id

GO

--Create Policy
Declare @object_set_id int
EXEC msdb.dbo.sp_syspolicy_add_object_set @object_set_name=N'Simple Mode Check_ObjectSet', @facet=N'Database', @object_set_id=@object_set_id OUTPUT
Select @object_set_id

Declare @target_set_id int
EXEC msdb.dbo.sp_syspolicy_add_target_set @object_set_name=N'Simple Mode Check_ObjectSet', @type_skeleton=N'Server/Database', @type=N'DATABASE', @enabled=True, @target_set_id=@target_set_id OUTPUT
Select @target_set_id

EXEC msdb.dbo.sp_syspolicy_add_target_set_level @target_set_id=@target_set_id, @type_skeleton=N'Server/Database', @level_name=N'Database', @condition_name=N'', @target_set_level_id=0

GO

Declare @policy_id int
EXEC msdb.dbo.sp_syspolicy_add_policy @name=N'Simple Mode Check', @condition_name=N'Simple Recovery Mode', @policy_category=N'', @description=N'This policy ensures that the databases evaluated against are set to SIMPLE recovery mode.', @help_text=N'', @help_link=N'', @schedule_uid=N'00000000-0000-0000-0000-000000000000', @execution_mode=0, @is_enabled=False, @policy_id=@policy_id OUTPUT, @root_condition_name=N'', @object_set=N'Simple Mode Check_ObjectSet'
Select @policy_id

GO</pre>
<p>Now that you’ve created your policy, you can either evaluate it directly on that server or we can leverage the <a href="http://msdn.microsoft.com/en-us/library/bb895144.aspx" target="_blank">Central Management Server feature</a> to evaluate this policy against one or more servers in your environment! Since we’re looking at this from an enterprise-level standpoint, we’re going to go over the CMS way of doing this.</p>
<p>Once you’ve established your CMS, you’re going to want to register servers to it. You could register everything directly under the CMS but then it becomes one giant list and that’s not very nice. One method I like to implement in my CMS is to create new server groups for each environment (e.g. DEV, QA, PROD). Within each group, I also create additional groupings for each version of SQL Server (e.g. 2000, 2005, 2008). Once the groups/folders have been created I then register my servers in their appropriate spots.</p>
<p><a href="http://sqlchicken.com/wp-content/uploads/2011/07/CMS-example.png"><img class="size-thumbnail wp-image-1638" title="CMS example" src="http://sqlchicken.com/wp-content/uploads/2011/07/CMS-example-150x150.png" alt="" width="150" height="150" /></a></p>
<p>The advantage of breaking groups up like this is that CMS allows you to query against multiple servers at once. For instance if you were to right-click the folder for DEV, which in my case contains two registered servers in groups beneath it, SSMS will connect to both instances so that you can query them at the same time. It is this mechanism that we’ll use with Policy-Based Management since that feature allows us to evaluate policies against multiple servers in the same way.</p>
<p><a href="http://sqlchicken.com/wp-content/uploads/2011/07/CMS-example2.png"><img class="aligncenter size-thumbnail wp-image-1639" title="CMS example2" src="http://sqlchicken.com/wp-content/uploads/2011/07/CMS-example2-150x150.png" alt="" width="150" height="150" /></a></p>
<p>To evaluate this policy, right-click the DEV folder and select Evaluate Policies. For source, click on the ellipses button and select either the folder location of the XML file or select the SQL Server instance which you imported the policy to. Once you&#8217;ve selected the policy&#8217;s location, you&#8217;ll see the Evaluate Policies screen with a list. Tick the box for the Simple Mode Check and then click the Evaluate button.</p>
<p><a href="http://sqlchicken.com/wp-content/uploads/2011/07/CMS-example3.png"><img class="aligncenter size-medium wp-image-1640" title="CMS example3" src="http://sqlchicken.com/wp-content/uploads/2011/07/CMS-example3-300x211.png" alt="" width="300" height="211" /></a></p>
<p>Check that out, you just evaluated policies against all of the databases in DEV! The databases that are NOT in simple mode (per our condition check) fail the policy evaluation and show up with red X&#8217;s. To quickly switch those to simple mode simply check the boxes for those that failed the check, then click the Apply button. This will enforce the policy on those databases and switch them for you to Simple mode! Imagine doing this that quickly and easily against hundreds of databases!</p>
<p>If you&#8217;re wondering if you can automate this process, the answer is absolutely! Check out the great open-source project <a href="http://epmframework.codeplex.com">Enterprise Policy-Management Framework over at Codeplex</a>. This project allows you not only automate this process and policy enforcement but it also offers some really nice reporting of all this as well!</p>
<p><strong>UPDATE</strong>: After chatting with Andie it looks like I forgot to mention a few things. Namely that for those wondering if this works on down-level servers (2000, 2005, etc.) the answer is YES! So long as you have a SQL Server 2008 server acting as your CMS, you can evaluate (certain) policies against down-level servers. Given this confusion I&#8217;ll write up a post on how all this works and what the caveats are.</p>
<p>The other point to make is that CMS uses Windows authentication only. If you have multiple domains, and there is no trust established between the domains, then this solution won&#8217;t work. If you DO have multiple domains and trust established, so long as your credentials allow you to traverse domains and the proper security authorizations are in place on the target SQL Servers then it will work.</p>
]]></content:encoded>
			<wfw:commentRss>http://sqlchicken.com/2011/07/make-it-simple-with-policy-based-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Server Denali CTP3: Policy Based Management</title>
		<link>http://sqlchicken.com/2011/07/sql-server-denali-ctp3-policy-based-management/</link>
		<comments>http://sqlchicken.com/2011/07/sql-server-denali-ctp3-policy-based-management/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 15:36:11 +0000</pubDate>
		<dc:creator>Jorge Segarra</dc:creator>
				<category><![CDATA[Policy Based Management]]></category>
		<category><![CDATA[Syndication]]></category>

		<guid isPermaLink="false">http://sqlchicken.com/?p=1628</guid>
		<description><![CDATA[Whether you know it or not, Policy-Based Management is an integral part of the new release of SQL Server &#8220;Denali&#8221;. Did you know that the HADR feature actually leverages PBM for checks? Yup, that&#8217;s right folks. If you&#8217;re an administrator and you&#8217;re NOT using Policy-Based Management yet, I highly recommend you pick up a book [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsqlchicken.com%2F2011%2F07%2Fsql-server-denali-ctp3-policy-based-management%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsqlchicken.com%2F2011%2F07%2Fsql-server-denali-ctp3-policy-based-management%2F&amp;source=sqlchicken&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8d158ff2dba4d5aff99dc83fde7e6c2d&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Whether you know it or not, Policy-Based Management is an integral part of the new release of SQL Server &#8220;Denali&#8221;. Did you know that the HADR feature actually leverages PBM for checks? Yup, that&#8217;s right folks. If you&#8217;re an administrator and you&#8217;re NOT using Policy-Based Management yet, I highly <a href="http://www.amazon.com/gp/product/1430229101?ie=UTF8&amp;tag=httpsqlchicco-20&amp;link_code=as3&amp;camp=211189&amp;creative=373489&amp;creativeASIN=1430229101">recommend you pick up a book and check it out</a>!</p>
<p>So what&#8217;s new in <a href="https://www.microsoft.com/betaexperience/pd/SQLDCTP3CTA/enus/default.aspx">SQL Server &#8220;Denali&#8221; CTP3</a> for Policy-Based Management? I just got the shrink wrap off of it (I&#8217;m not <a href="http://sqlvariant.com/wordpress/index.php/2011/07/new-powershell-cmdlets-in-sql-denali-ctp3/">quite the go-getter that Aaron Nelson is</a>) but at a quick glance here&#8217;s the changes I see. These comparisons were made with listing of facets between SQL Server 2008 R2 and the new &#8220;Denali&#8221; CTP3 release.</p>
<p>&nbsp;</p>
<p>We now have 84 facets (as opposed to 76 in 2008 R2). These are our new facets and their applicable target types!</p>
<table width="938" border="0" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="936"><strong>Availability Database</strong> &#8211; Exposes properies of the Availability Database object</td>
</tr>
<tr>
<td valign="top" width="936"><em>Applicable Target Types</em>: AvailabilityDatabase</td>
</tr>
<tr>
<td valign="top" width="936"></td>
</tr>
<tr>
<td valign="top" width="936"><strong>Availability Group</strong> &#8211; Exposes properies of the Availability Group object</td>
</tr>
<tr>
<td valign="top" width="936"><em>Applicable Target Types</em>: AvailabilityGroup</td>
</tr>
<tr>
<td valign="top" width="936"></td>
</tr>
<tr>
<td valign="top" width="936"><strong>Availability Group State</strong> &#8211; Exposes properies of the Availability Group</td>
</tr>
<tr>
<td valign="top" width="936"><em>Applicable Target Types</em>: AvailabilityGroup</td>
</tr>
<tr>
<td valign="top" width="936"></td>
</tr>
<tr>
<td valign="top" width="936"><strong>Availability Replica</strong> &#8211; Exposes properties of the Availability Replica object.</td>
</tr>
<tr>
<td valign="top" width="936"><em>Applicable Target Types</em>: AvailabilityReplica</td>
</tr>
<tr>
<td valign="top" width="936"></td>
</tr>
<tr>
<td valign="top" width="936"><strong>Database Replica State</strong> &#8211; Exposes the properties of physical database replicas participating in an availability group.</td>
</tr>
<tr>
<td valign="top" width="936"><em>Applicable Target Types</em>: DatabaseReplicaState</td>
</tr>
<tr>
<td valign="top" width="936"></td>
</tr>
<tr>
<td valign="top" width="936"><strong>Search Property List</strong> &#8211; Exposes properties of the Search Property List object</td>
</tr>
<tr>
<td valign="top" width="936"><em>Applicable Target Types</em>: SearchPropertyList</td>
</tr>
<tr>
<td valign="top" width="936"></td>
</tr>
<tr>
<td valign="top" width="936"><strong>Sequence</strong> &#8211; Exposes properties of the sequence object.</td>
</tr>
<tr>
<td valign="top" width="936"><em>Applicable Target Types</em>: Sequence</td>
</tr>
<tr>
<td valign="top" width="936"></td>
</tr>
<tr>
<td valign="top" width="936"><strong>Server Role</strong> &#8211; Exposes properties of the ServerRole object.</td>
</tr>
<tr>
<td valign="top" width="936"><em>Applicable Target Types</em>: ServerRole</td>
</tr>
<tr>
<td valign="top" width="936"></td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>Again, this still has that new install smell so I haven’t had time to mess around with it but I’ll soon be posting some new policies using these facets so you can get an idea of what you can do administratively using Policy-Based Management and these new facets.</p>
]]></content:encoded>
			<wfw:commentRss>http://sqlchicken.com/2011/07/sql-server-denali-ctp3-policy-based-management/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Policy-Based Management and Local Password Policy</title>
		<link>http://sqlchicken.com/2011/05/policy-based-management-and-local-password-policy/</link>
		<comments>http://sqlchicken.com/2011/05/policy-based-management-and-local-password-policy/#comments</comments>
		<pubDate>Wed, 04 May 2011 21:07:52 +0000</pubDate>
		<dc:creator>Jorge Segarra</dc:creator>
				<category><![CDATA[Policy Based Management]]></category>
		<category><![CDATA[Syndication]]></category>

		<guid isPermaLink="false">http://sqlchicken.com/?p=1506</guid>
		<description><![CDATA[This post is based on an interesting question/situation that was posted over at ASKSSC.com today. The user asked how to create a policy condition that enforces local sql accounts to adhere to password expiration policies. First off, to create the condition itself is relatively easy. Below I’ve provided the T-SQL code so that you can [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsqlchicken.com%2F2011%2F05%2Fpolicy-based-management-and-local-password-policy%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsqlchicken.com%2F2011%2F05%2Fpolicy-based-management-and-local-password-policy%2F&amp;source=sqlchicken&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8d158ff2dba4d5aff99dc83fde7e6c2d&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>This post is based on an interesting question/situation that was <a href="http://ask.sqlservercentral.com/questions/36948/how-to-create-custom-password-policy-policy-based-management">posted over at ASKSSC.com today</a>. The user asked how to create a policy condition that enforces local sql accounts to adhere to password expiration policies.</p>
<p>First off, to create the condition itself is relatively easy. Below I’ve provided the T-SQL code so that you can create the condition that way. I’ve also included a quick list on how to create it via SSMS GUI.</p>
<p>T-SQL method:</p>
<pre class="csharpcode"><span class="kwrd">Declare</span> @condition_id <span class="kwrd">int</span>
<span class="kwrd">EXEC</span> msdb.dbo.sp_syspolicy_add_condition
    @name=N<span class="str">'Password Policy Enforced'</span>, @description=N<span class="str">''</span>, @facet=N<span class="str">'Login'</span>,
    @expression=N<span class="str">'&lt;Operator&gt;
  &lt;TypeClass&gt;Bool&lt;/TypeClass&gt;
  &lt;OpType&gt;AND&lt;/OpType&gt;
  &lt;Count&gt;2&lt;/Count&gt;
  &lt;Operator&gt;
    &lt;TypeClass&gt;Bool&lt;/TypeClass&gt;
    &lt;OpType&gt;EQ&lt;/OpType&gt;
    &lt;Count&gt;2&lt;/Count&gt;
    &lt;Attribute&gt;
      &lt;TypeClass&gt;Bool&lt;/TypeClass&gt;
      &lt;Name&gt;PasswordExpirationEnabled&lt;/Name&gt;
    &lt;/Attribute&gt;
    &lt;Function&gt;
      &lt;TypeClass&gt;Bool&lt;/TypeClass&gt;
      &lt;FunctionType&gt;True&lt;/FunctionType&gt;
      &lt;ReturnType&gt;Bool&lt;/ReturnType&gt;
      &lt;Count&gt;0&lt;/Count&gt;
    &lt;/Function&gt;
  &lt;/Operator&gt;
  &lt;Operator&gt;
    &lt;TypeClass&gt;Bool&lt;/TypeClass&gt;
    &lt;OpType&gt;EQ&lt;/OpType&gt;
    &lt;Count&gt;2&lt;/Count&gt;
    &lt;Attribute&gt;
      &lt;TypeClass&gt;Bool&lt;/TypeClass&gt;
      &lt;Name&gt;PasswordPolicyEnforced&lt;/Name&gt;
    &lt;/Attribute&gt;
    &lt;Function&gt;
      &lt;TypeClass&gt;Bool&lt;/TypeClass&gt;
      &lt;FunctionType&gt;True&lt;/FunctionType&gt;
      &lt;ReturnType&gt;Bool&lt;/ReturnType&gt;
      &lt;Count&gt;0&lt;/Count&gt;
    &lt;/Function&gt;
  &lt;/Operator&gt;
&lt;/Operator&gt;'</span>, @is_name_condition=0, @obj_name=N<span class="str">''</span>,
@condition_id=@condition_id <span class="kwrd">OUTPUT</span>

<span class="kwrd">Select</span> @condition_id

GO</pre>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<p>SSMS method:</p>
<ol>
<li>Under PBM node, right-click conditions folder and select New Condition</li>
<li>Name your new condition something useful</li>
<li>Select Login facet from drop-down menu</li>
<li>Click on field box and select @PasswordExpirationEnabled from properties list</li>
<li>Set the operator value to True</li>
<li>Click on &#8216;Click here to add clause&#8217; to add another clause to policy</li>
<li>Click on field box and select @PasswordPolicyEnforced from properties list</li>
<li>Set the operator value to True</li>
<li>Click OK. You&#8217;ve now just created a new condition!</li>
</ol>
<p>Now we’re left with another question: Where does this password policy come from? For details on that you can refer to the Books Online article about it (<a href="http://msdn.microsoft.com/en-us/library/ms161959.aspx">link</a>). If your box is on a domain that has Active Directory policies regarding password expiration, when you select the box for ‘Enforce password policy’ as well as ‘Enforce password expiration’, these settings will come from that policy. Don’t have an Active Directory policy? No problem! If a policy isn’t provided from Active Directory, Windows then looks to its local security policies for these values.</p>
<p><a href="http://sqlchicken.com/wp-content/uploads/2011/05/image.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border: 0px;" title="image" src="http://sqlchicken.com/wp-content/uploads/2011/05/image_thumb.png" border="0" alt="image" width="244" height="143" /></a></p>
<p>To see the local values, click on your Start button, then type in ‘secpol.msc’ (don’t type type the single-quotes). This will open up the Local Security Policy MMC Snap-in. Expand the Account Policies folder and then click on the Password Policy folder. In the right side pane you will see the various password-related options you can set such as Maximum password age or password length.</p>
<p><a href="http://sqlchicken.com/wp-content/uploads/2011/05/image1.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border: 0px;" title="image" src="http://sqlchicken.com/wp-content/uploads/2011/05/image_thumb1.png" border="0" alt="image" width="433" height="156" /></a></p>
<p>While policy-based management can help you check whether or not the accounts have the option enabled to enforce the policy checks, Policy-based management itself has not bearing on the Local Security Policy settings. This is something you, as an administrator, will have to set and configure outside of SQL Server.</p>
]]></content:encoded>
			<wfw:commentRss>http://sqlchicken.com/2011/05/policy-based-management-and-local-password-policy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find Table Heaps Using Policy-Based Management</title>
		<link>http://sqlchicken.com/2011/04/find-table-heaps-using-policy-based-management/</link>
		<comments>http://sqlchicken.com/2011/04/find-table-heaps-using-policy-based-management/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 20:35:29 +0000</pubDate>
		<dc:creator>Jorge Segarra</dc:creator>
				<category><![CDATA[Policy Based Management]]></category>
		<category><![CDATA[Syndication]]></category>

		<guid isPermaLink="false">http://sqlchicken.com/?p=1428</guid>
		<description><![CDATA[This is just a quick post in regards to a conversation I just had via Twitter. If you don&#8217;t already use Twitter, the SQL Community has setup a great resource on there using the hashtag of #sqlhelp. Today a conversation came up due to a forum question over at SQLServerCentral regarding applying policies to databases [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsqlchicken.com%2F2011%2F04%2Ffind-table-heaps-using-policy-based-management%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsqlchicken.com%2F2011%2F04%2Ffind-table-heaps-using-policy-based-management%2F&amp;source=sqlchicken&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8d158ff2dba4d5aff99dc83fde7e6c2d&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>This is just a quick post in regards to a conversation I just had via Twitter. If you don&#8217;t already use Twitter, the SQL Community has setup a great resource on there using <a href="http://twitter.com/#!/search?q=%23sqlhelp">the hashtag of #sqlhelp</a>.</p>
<p>Today a conversation came up due to a forum question over at SQLServerCentral regarding <a href="http://www.sqlservercentral.com/Forums/Topic1090893-391-1.aspx">applying policies to databases with tables that have heaps</a>. If you&#8217;re not familiar with the term, a heap is a table that has no clustered index on it. This can be problematic from a performance stand point so it might benefit you to find a way to identify these potential problem children. Enter Policy-Based Management.</p>
<p>This is a simple policy that you can run against your servers and it will identify your tables that are heaps. Just to clarify this policy identifies if your table has a clustered index on it. If it doesn&#8217;t then it will fail policy check. I&#8217;ve provided two ways to get the policy.</p>
<p><a href="http://cid-54dc52b8716783a2.office.live.com/self.aspx/.Public/Policies/Find%20Table%20Heaps.xml">Download policy by clicking here</a></p>
<p>OR (Updated 4/15/11 to include creation script for condition)</p>
<pre class="”prettyprint">--CREATE CONDITION</pre>
<pre class="”prettyprint">Declare @condition_id intEXEC msdb.dbo.sp_syspolicy_add_condition @name=N'Find heaps', @description=N'', @facet=N'Table', @expression=N'&lt;Operator&gt;  &lt;TypeClass&gt;Bool&lt;/TypeClass&gt;  &lt;OpType&gt;EQ&lt;/OpType&gt;  &lt;Count&gt;2&lt;/Count&gt;  &lt;Attribute&gt;    &lt;TypeClass&gt;Bool&lt;/TypeClass&gt;    &lt;Name&gt;HasClusteredIndex&lt;/Name&gt;  &lt;/Attribute&gt;  &lt;Function&gt;    &lt;TypeClass&gt;Bool&lt;/TypeClass&gt;    &lt;FunctionType&gt;True&lt;/FunctionType&gt;    &lt;ReturnType&gt;Bool&lt;/ReturnType&gt;    &lt;Count&gt;0&lt;/Count&gt;  &lt;/Function&gt;&lt;/Operator&gt;', @is_name_condition=0, @obj_name=N'', @condition_id=@condition_id OUTPUTSelect @condition_id
GO

--CREATE POLICY
Declare @object_set_id int
EXEC msdb.dbo.sp_syspolicy_add_object_set @object_set_name=N'Find Table Heaps_ObjectSet', @facet=N'Table', @object_set_id=@object_set_id OUTPUT
Select @object_set_id

Declare @target_set_id int
EXEC msdb.dbo.sp_syspolicy_add_target_set @object_set_name=N'Find Table Heaps_ObjectSet', @type_skeleton=N'Server/Database/Table', @type=N'TABLE', @enabled=True, @target_set_id=@target_set_id OUTPUT
Select @target_set_id

EXEC msdb.dbo.sp_syspolicy_add_target_set_level @target_set_id=@target_set_id, @type_skeleton=N'Server/Database/Table', @level_name=N'Table', @condition_name=N'', @target_set_level_id=0
EXEC msdb.dbo.sp_syspolicy_add_target_set_level @target_set_id=@target_set_id, @type_skeleton=N'Server/Database', @level_name=N'Database', @condition_name=N'', @target_set_level_id=0

GO

Declare @policy_id int
EXEC msdb.dbo.sp_syspolicy_add_policy @name=N'Find Table Heaps', @condition_name=N'Find heaps', @policy_category=N'', @description=N'Heaps are tables without clustered indexes. Read the link below to learn more about heaps.', @help_text=N'Fragmentation (part 4):what are heaps? by Paul Randal', @help_link=N'http://blogs.msdn.com/b/sqlserverstorageengine/archive/2006/09/19/761437.aspx', @schedule_uid=N'00000000-0000-0000-0000-000000000000', @execution_mode=0, @is_enabled=False, @policy_id=@policy_id OUTPUT, @root_condition_name=N'', @object_set=N'Find Table Heaps_ObjectSet'
Select @policy_id

GO</pre>
]]></content:encoded>
			<wfw:commentRss>http://sqlchicken.com/2011/04/find-table-heaps-using-policy-based-management/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Policy for Ad-hoc Workloads</title>
		<link>http://sqlchicken.com/2011/01/policy-for-ad-hoc-workloads/</link>
		<comments>http://sqlchicken.com/2011/01/policy-for-ad-hoc-workloads/#comments</comments>
		<pubDate>Thu, 20 Jan 2011 18:30:05 +0000</pubDate>
		<dc:creator>Jorge Segarra</dc:creator>
				<category><![CDATA[Policy Based Management]]></category>
		<category><![CDATA[Syndication]]></category>

		<guid isPermaLink="false">http://sqlchicken.com/?p=1243</guid>
		<description><![CDATA[During my presentation at SQLSaturday 62 in Tampa I was asked by an attendee about having a policy to check the setting for ad-hoc optimization settings. At the time since I was in a bit of a time crunch (and I couldn&#8217;t remember the exact facet to look under) I couldn&#8217;t properly demo how to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsqlchicken.com%2F2011%2F01%2Fpolicy-for-ad-hoc-workloads%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsqlchicken.com%2F2011%2F01%2Fpolicy-for-ad-hoc-workloads%2F&amp;source=sqlchicken&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8d158ff2dba4d5aff99dc83fde7e6c2d&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>During my presentation at <a href="http://sqlsaturday.com/62/eventhome.aspx">SQLSaturday 62 in Tampa</a> I was asked by an attendee about having a policy to check the setting for ad-hoc optimization settings. At the time since I was in a bit of a time crunch (and I couldn&#8217;t remember the exact facet to look under) I couldn&#8217;t properly demo how to check for it. In this post I&#8217;ll show you how to check for that specific setting. In a future post I&#8217;ll show you how to check on many more settings.</p>
<p>Before we begin, I <strong>highly</strong> recommend you familiarize yourself with what exactly this setting changes and how it affects your SQL Server environment. Remember this setting affects the entire instance so all databases installed here will be affected by this change. Read this great post by Bob Pusateri (<a href="http://www.bobpusateri.com">Blog </a>| <a href="http://twitter.com/sqlbob">Twitter</a>) to get an understanding of what <a href="http://www.bobpusateri.com/archive/2010/07/optimizing-for-ad-hoc-workloads/">Optimizing for Ad Hoc Workloads</a> really does.</p>
<h2>Creating the Policy/Condition</h2>
<ul>
<li>In SQL Server Management Studio browse down to and expand your management node, expand the Policy-Based Management node, right-click the Policies folder and select New Policy.</li>
<li>Name your new policy and then from the Check Conditions drop down menu select New Condition.</li>
<li>Give your new condition a name and from the Facet drop down menu select the Server Configuration facet.</li>
<li>In the Expression editor, click the area below the column title of field and you will be presented with a drop-down of all the properties available for this facet. Select @OptimizeAdhocWorkloads.</li>
</ul>
<div id="attachment_1247" class="wp-caption aligncenter" style="width: 310px"><a href="http://sqlchicken.com/wp-content/uploads/2011/01/adhoc-check.png"><img class="size-medium wp-image-1247" title="adhoc-check" src="http://sqlchicken.com/wp-content/uploads/2011/01/adhoc-check-300x168.png" alt="" width="300" height="168" /></a><p class="wp-caption-text">Creating our new condition</p></div>
<p style="text-align: center;">
<ul>
<li>Under the heading of Value, you will have two options: True or False. When you create a policy you want to establish a condition you want so for the purposes of this demonstration we want our servers to have this setting set to off (which is default setting) so we&#8217;ll select the option for FALSE. Click OK to create your condition and return to the new policy window.</li>
<li>Next we&#8217;ll select our Evaluation Mode. This policy, based on the facets and properties we&#8217;ve selected offer us three options: On demand, on schedule and On Change: log only. The last option, if enabled, will allow this policy to be active and log any changes made to this particular setting. One cool thing you can do with this is you can create alerts to automatically email you if this particular condition is violated. Check out Ken Simmons (<a href="http://cybersql.blogspot.com/">Blog </a>| <a href="http://twitter.com/kensimmons">Twitter</a>) article on <a href="http://mssqltips.com/tip.asp?tip=2054">Configuring Alerts for Policy-Based Management</a> to learn more. Leave the Evaluation Mode to On Demand and click OK.</li>
</ul>
<p><a href="http://sqlchicken.com/wp-content/uploads/2011/01/evalmode.png"><img class="aligncenter size-medium wp-image-1258" title="evalmode" src="http://sqlchicken.com/wp-content/uploads/2011/01/evalmode-300x117.png" alt="" width="300" height="117" /></a></p>
<p>Now that we have our policy created simply right-click on it (located under your Policies folder) and select Evaluate to try it out!</p>
<h2>GUI? We Don&#8217;t Need No Stinking GUI!</h2>
<p>In this post I walked you through how to create this policy using the GUI but if you prefer to script this out, you can do that too! Here is the T-SQL script that you can run in lieu of walking through the SSMS screens, to create this particular policy:</p>
<pre class="brush: sql; title: ; wrap-lines: true; notranslate">
Declare @object_set_id int
EXEC msdb.dbo.sp_syspolicy_add_object_set @object_set_name=N'Ad-hoc Workload Check_ObjectSet', @facet=N'IServerConfigurationFacet', @object_set_id=@object_set_id OUTPUT
Select @object_set_id

Declare @target_set_id int
EXEC msdb.dbo.sp_syspolicy_add_target_set @object_set_name=N'Ad-hoc Workload Check_ObjectSet', @type_skeleton=N'Server', @type=N'SERVER', @enabled=True, @target_set_id=@target_set_id OUTPUT
Select @target_set_id
GO

Declare @policy_id int
EXEC msdb.dbo.sp_syspolicy_add_policy @name=N'Ad-hoc Workload Check', @condition_name=N'adhoc optimization check', @policy_category=N'', @description=N'This policy checks the server setting to see if Optimize for Ad-Hoc Workload is enabled. The default setting is disabled.', @help_text=N'To learn more about this policy check out Jorge Segarra''s blog post on this', @help_link=N'http://sqlchicken.com/2011/01/policy-for-ad-hoc-workloads/', @schedule_uid=N'00000000-0000-0000-0000-000000000000', @execution_mode=0, @is_enabled=False, @policy_id=@policy_id OUTPUT, @root_condition_name=N'', @object_set=N'Ad-hoc Workload Check_ObjectSet'
Select @policy_id
GO</pre>
<h2>Conclusion</h2>
<p>Again, I can&#8217;t iterate enough <strong>NOT</strong> to blindly go changing settings on your servers without <span style="text-decoration: underline;">understanding the effects of your actions</span>! Policy-Based Management is a very powerful and easy-to-use tool but be sure to use it wisely! In a later post I will show you how to modify even more server-level settings and let you customize policies to check exactly the settings you want audit.</p>
]]></content:encoded>
			<wfw:commentRss>http://sqlchicken.com/2011/01/policy-for-ad-hoc-workloads/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>EPM Framework and SQL 2008 R2</title>
		<link>http://sqlchicken.com/2011/01/epm-framework-and-sql-2008-r2/</link>
		<comments>http://sqlchicken.com/2011/01/epm-framework-and-sql-2008-r2/#comments</comments>
		<pubDate>Mon, 17 Jan 2011 14:15:35 +0000</pubDate>
		<dc:creator>Jorge Segarra</dc:creator>
				<category><![CDATA[Policy Based Management]]></category>
		<category><![CDATA[Syndication]]></category>

		<guid isPermaLink="false">http://sqlchicken.com/?p=1220</guid>
		<description><![CDATA[This weekend at SQLSaturday 62 in Tampa, I presented my policy-based management presentation. During my presentation one of the cool things I cover is how policy-based management can be extended utilizing Reporting Services and PowerShell through the use of an amazing tool called the Enterprise Policy-Management Framework available on Codeplex. Enterprise Policy Management Framework, or [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsqlchicken.com%2F2011%2F01%2Fepm-framework-and-sql-2008-r2%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsqlchicken.com%2F2011%2F01%2Fepm-framework-and-sql-2008-r2%2F&amp;source=sqlchicken&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8d158ff2dba4d5aff99dc83fde7e6c2d&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<div id="_mcePaste">This weekend at SQLSaturday 62 in Tampa, I presented my policy-based management presentation. During my presentation</div>
<div id="_mcePaste">one of the cool things I cover is how policy-based management can be extended utilizing Reporting Services and PowerShell</div>
<div id="_mcePaste">through the use of an amazing tool called the <a href="http://epmframework.codeplex.com">Enterprise Policy-Management Framework</a> available on Codeplex.</div>
</p>
<div>Enterprise Policy Management Framework, or EPMF, is completely free and was developed by the folks at Microsoft who created</div>
<div id="_mcePaste">policy-based management. I absolutely love telling folks about this project because it really helps sell the idea of</div>
<div id="_mcePaste">policy-based management&#8217;s application within an organization. What&#8217;s cool about this project is the built in reports make it easy to see the health state of your environment at a glance as well as let you drill down further in to each report piece to find more granular information on policy states.</div>
</p>
<div>One caveat of EPMF is that in order to run on SQL Server 2008 it requires <a href="http://support.microsoft.com/kb/2261464">SP1 Cumulative Update 3</a> or higher installed on your Central Management server in order to function properly. This requirement is in place in order for EPMF to be able to properly handle policy evaluation on down level systems (e.g. SQL Server 2000, 2005). An interesting question was asked during the presentation: &#8220;Does EPMF support SQL Server 2008 R2 RTM (10.50.1600)?&#8221; The answer is YES, it does!</div>
</p>
<div>I tested this on my local install of SQL Server 2008 R2 at RTM level and it works. Even though it works at RTM, I highly recommend you update your SQL Server 2008 R2 instance to at least Cumulative Update 3 or higher. I know, you&#8217;re thinking &#8220;but you just told me it works at RTM!&#8221; Yes, it does, however the RTM edition of R2 came with quite a nasty little bug that wasn&#8217;t fixed until the CU3 patch. This bug is<a href="https://connect.microsoft.com/SQLServer/feedback/details/557402/ssms-can-no-longer-create-or-edit-job-steps?wa=wsignin1.0"> outlined in this Connect issue</a> by Aaron Bertrand (<a href="http://sqlblog.com/blogs/aaron_bertrand/">Blog </a>| <a href="http://twitter.com/aaronbertrand">Twitter</a>). The bug is that SSMS will not allow you to edit or create a job step after you&#8217;ve created an initial one. How does this affect you? Well when you setup EPMF you need to create a new scheduled job that executes the PowerShell script that evaluates the policies against your environment. This particular bug will stop you from editing or creating new job steps which could severely affect you trying to fix things. There is a workaround wherein you can close/reopen SSMS to make the error disappear but this can become quite cumbersome very quickly.</div>
</p>
<div>Policy-based management is an extremely powerful and easy to use feature in SQL Server 2008 and EPM Framework extends its awesomeness even further. If you&#8217;d like to learn more about Policy-based management you can check out some webinars I&#8217;ve done over at Pragmatic Works (<a href="http://cms.pragmaticworks.com/Videos/Default.aspx?VidID=a399886a6c2a4a57ab2ad66a3407db78">webinar link</a>) or at SQLLunch (<a href="http://sqllunch.com/Lunches.aspx?Month=August%202010#">webinar link</a>) on the topic.</div>
]]></content:encoded>
			<wfw:commentRss>http://sqlchicken.com/2011/01/epm-framework-and-sql-2008-r2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PragmaticWorks Webinar &#8211; Policy-Based Management</title>
		<link>http://sqlchicken.com/2010/10/pragmaticworks-webinar-policy-based-management/</link>
		<comments>http://sqlchicken.com/2010/10/pragmaticworks-webinar-policy-based-management/#comments</comments>
		<pubDate>Mon, 25 Oct 2010 15:00:45 +0000</pubDate>
		<dc:creator>Jorge Segarra</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Policy Based Management]]></category>
		<category><![CDATA[Syndication]]></category>

		<guid isPermaLink="false">http://sqlchicken.com/?p=1078</guid>
		<description><![CDATA[This is just a quick note to remind everyone I&#8217;ll be presenting tomorrow, Tuesday October 26th 2010 for the PragmaticWorks Free Monthly Webinar Series. The topic (big surprise here) is Policy-Based Management! The webinar runs from 11:00 AM &#8211; 12:00 PM EDT and you can register for free here. Hope to see you all there!]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsqlchicken.com%2F2010%2F10%2Fpragmaticworks-webinar-policy-based-management%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsqlchicken.com%2F2010%2F10%2Fpragmaticworks-webinar-policy-based-management%2F&amp;source=sqlchicken&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8d158ff2dba4d5aff99dc83fde7e6c2d&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://www.amazon.com/gp/product/1430229101?ie=UTF8&amp;tag=httpsqlchicco-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1430229101"><img class="alignright size-full wp-image-891" title="PBMBookSmall" src="http://sqlchicken.com/wp-content/uploads/2010/07/PBMBookSmall.jpg" alt="" width="186" height="246" /></a>This is just a quick note to remind everyone I&#8217;ll be presenting tomorrow, Tuesday October 26th 2010 for the <a href="http://pragmaticworks.com/Resources/webinars/Month.aspx/21">PragmaticWorks Free Monthly Webinar Series</a>. The topic (big surprise here) is Policy-Based Management!</p>
<p>The webinar runs from 11:00 AM &#8211; 12:00 PM EDT and you can <a href="https://www1.gotomeeting.com/register/561952609">register for free here</a>. Hope to see you all there!</p>
]]></content:encoded>
			<wfw:commentRss>http://sqlchicken.com/2010/10/pragmaticworks-webinar-policy-based-management/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Join Me For Lunch?</title>
		<link>http://sqlchicken.com/2010/08/join-me-for-lunch/</link>
		<comments>http://sqlchicken.com/2010/08/join-me-for-lunch/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 15:29:46 +0000</pubDate>
		<dc:creator>Jorge Segarra</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Policy Based Management]]></category>
		<category><![CDATA[SQLLunch]]></category>
		<category><![CDATA[Syndicated]]></category>
		<category><![CDATA[Syndication]]></category>
		<category><![CDATA[sqllunch]]></category>

		<guid isPermaLink="false">http://sqlchicken.com/?p=992</guid>
		<description><![CDATA[Just a quick note that today at 12:30 EST (11:30 CST) I&#8217;ll be presenting on Policy-Based Management for SQLLunch. If you&#8217;re not familiar with SQLLunch it&#8217;s an awesome series of FREE webcasts setup by SQL MVP Patrick LeBlanc (Blog &#124; Twitter). Each webcast focuses on a different aspect of SQL Server. Free training? Can&#8217;t beat [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsqlchicken.com%2F2010%2F08%2Fjoin-me-for-lunch%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsqlchicken.com%2F2010%2F08%2Fjoin-me-for-lunch%2F&amp;source=sqlchicken&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8d158ff2dba4d5aff99dc83fde7e6c2d&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://sqlchicken.com/wp-content/uploads/2010/04/propbmcover_thumb.jpg"><img class="alignright size-full wp-image-651" title="propbmcover_thumb.jpg" src="http://sqlchicken.com/wp-content/uploads/2010/04/propbmcover_thumb.jpg" alt="" width="164" height="201" /></a>Just a quick note that today at 12:30 EST (11:30 CST) I&#8217;ll be presenting on <a href="http://sqllunch.com/Meeting.aspx?lunchid=29">Policy-Based Management for SQLLunch</a>. If you&#8217;re not familiar with SQLLunch it&#8217;s an awesome series of FREE webcasts setup by SQL MVP Patrick LeBlanc (<a href="http://sqldownsouth.blogspot.com/">Blog </a>| <a href="http://twitter.com/patrickdba">Twitter</a>). Each webcast focuses on a different aspect of SQL Server.</p>
<p>Free training? Can&#8217;t beat it, make sure to check it out! To find out latest news on SQLLunch and all upcoming webcasts <a href="http://sqllunch.com/Register.aspx">register on their site </a>for free. You can also join <a href="http://sqlpass.org">PASS </a>(free) directly from their registration, Win/Win!</p>
<p>Info on today&#8217;s webcast:</p>
<p><a href="http://sqllunch.com/Meeting.aspx?lunchid=29">SQLLunch #29: Policy-Based Management</a></p>
<p><strong>Topic: </strong>#29-Policy-Based Management in a Nutshell<br />
We will be learning an overview of this powerful new feature in SQL Server 2008 and how you can leverage it to help manage your existing SQL environment. This will include plenty of demos, best practices and Q&amp;A so by the end you should be able to walk away ready to take control of your SQL Servers!</p>
<p>Hope to see you there!</p>
]]></content:encoded>
			<wfw:commentRss>http://sqlchicken.com/2010/08/join-me-for-lunch/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Pro Server 2008 Policy-Based Management: It&#8217;s a Wrap!</title>
		<link>http://sqlchicken.com/2010/04/pro-server-2008-policy-based-management-its-a-wrap/</link>
		<comments>http://sqlchicken.com/2010/04/pro-server-2008-policy-based-management-its-a-wrap/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 14:00:58 +0000</pubDate>
		<dc:creator>Jorge Segarra</dc:creator>
				<category><![CDATA[Policy Based Management]]></category>
		<category><![CDATA[Syndication]]></category>
		<category><![CDATA[pbm]]></category>
		<category><![CDATA[writing]]></category>

		<guid isPermaLink="false">http://sqlchicken.com/?p=652</guid>
		<description><![CDATA[After months of deadlines, late night writing sessions, getting my ass handed to me by ADD and editors, and a loving wife pushing me to write some more the book is now done! A HUGE thank you to Ken Simmons for inviting Colin Stasiuk and myself to be a part of this project. Also huge [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsqlchicken.com%2F2010%2F04%2Fpro-server-2008-policy-based-management-its-a-wrap%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsqlchicken.com%2F2010%2F04%2Fpro-server-2008-policy-based-management-its-a-wrap%2F&amp;source=sqlchicken&amp;style=normal&amp;service=bit.ly&amp;service_api=R_8d158ff2dba4d5aff99dc83fde7e6c2d&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://www.amazon.com/gp/product/1430229101?ie=UTF8&amp;tag=httpsqlchicco-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1430229101"><img class="alignleft" style="display: inline; margin-left: 0px; margin-right: 0px; border: 0pt none;" title="Pro Server 2008 Policy-Based Management cover" src="http://sqlchicken.com/wp-content/uploads/2010/04/propbmcover_thumb.jpg" border="0" alt="Pro Server 2008 Policy-Based Management cover" width="131" height="161" align="left" /></a> After months of deadlines, late night writing sessions, getting my ass handed to me by ADD and editors, and a loving wife pushing me to write some more the book is now done! A HUGE thank you to <a href="http://cybersql.blogspot.com">Ken Simmons</a> for inviting <a href="http://benchmarkitconsulting.com">Colin Stasiuk</a> and myself to be a part of this project. Also huge thanks to all the folks at Apress for doing a great job pushing this along as well as <a href="http://tomlarock.com">Tom LaRock</a>, whose technical editing on this book was a great asset. <a href="http://www.amazon.com/gp/product/1430229101?ie=UTF8&amp;tag=httpsqlchicco-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1430229101" target="_blank">According to Amazon</a>, the book should be available April 27th so make sure you buy plenty of copies for you and your loved ones. After all, nothing says “I love you” like the gift of <span style="text-decoration: line-through;">policies that stop developers from horrendous naming conventions</span> Policy-Based Management. You can also get the book directly from Apress by going to <a href="http://www.policybasedmanagement.com">http://www.policybasedmanagement.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sqlchicken.com/2010/04/pro-server-2008-policy-based-management-its-a-wrap/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Database Caching 1/60 queries in 0.049 seconds using disk: basic
Object Caching 2286/2407 objects using disk: basic

Served from: sqlchicken.com @ 2012-02-10 10:35:40 -->
