<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Kevin Holman's OpsMgr Blog : grooming</title><link>http://blogs.technet.com/kevinholman/archive/tags/grooming/default.aspx</link><description>Tags: grooming</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Tuning tip – turning off some over-collection of events</title><link>http://blogs.technet.com/kevinholman/archive/2009/11/25/tuning-tip-turning-off-some-over-collection-of-events.aspx</link><pubDate>Wed, 25 Nov 2009 22:34:47 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3296381</guid><dc:creator>kevinhol</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.technet.com/kevinholman/comments/3296381.aspx</comments><wfw:commentRss>http://blogs.technet.com/kevinholman/commentrss.aspx?PostID=3296381</wfw:commentRss><wfw:comment>http://blogs.technet.com/kevinholman/rsscomments.aspx?PostID=3296381</wfw:comment><description>&lt;p&gt;We often think of tuning OpsMgr by way of tuning “Alert Noise”…. by disabling rules that generate alerts that we don't care about, or modifying thresholds on monitors to make the alert more actionable for our specific environment.&lt;/p&gt;  &lt;p&gt;However – one area of OpsMgr that often goes overlooked, is event overcollection.&amp;#160; This has a cost… because these events are collected and create LAN/WAN traffic, agent overhead, OpsDB size bloat, and especially, DataWarehouse size bloat.&amp;#160; I have worked with customers who had a data warehouse that was over one third event data….. and they had ZERO requirement for this nor did they want it.&amp;#160; They were paying for disk storage, and backup expense, plus added time and resources on the framework, all for data they cared nothing about.&lt;/p&gt;  &lt;p&gt;MOST of these events, are enabled out of the box, and are default OpsMgr collect rules from the “System Center Core Monitoring” MP.&amp;#160; These events are items like &amp;quot;config requested”, “config delivered”, “new config active”.&amp;#160; They might be interesting, but there is no advanced analysis included to use these to detect a problem.&amp;#160; In small environments, they are not usually a big deal.&amp;#160; But in large agent count environments, these events can account for a &lt;strong&gt;&lt;em&gt;LOT&lt;/em&gt;&lt;/strong&gt; of data, and provide little value unless you are doing something advanced in analyzing them.&amp;#160; I have yet to see a customer who did that.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;At a high level – here is how I like to review these events:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;strong&gt;Review the Most Common Events query that your OpsDB has.&lt;/strong&gt; &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Create a “My Workspace” view for each event that has a HIGH event count.&lt;/strong&gt; &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Examine the event details for value to YOU.&lt;/strong&gt; &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;View the rule that collected the event.&lt;/strong&gt;       &lt;ol&gt;       &lt;li&gt;&lt;strong&gt;Does the rule also alert or do anything special, or does it simply collect the event?&lt;/strong&gt; &lt;/li&gt;        &lt;li&gt;&lt;strong&gt;Do you think the event is required for any special reporting you do?&lt;/strong&gt; &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Create an Override, in an Override MP for the rule source management pack, to disable the rule.&lt;/strong&gt; &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Continue to the next event in the query output, and evaluate it.&lt;/strong&gt;&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;So, what I like to do – is to run the “Most Common Events” query against the OpsDB, and examine the top events, and consider disabling these event collection rules:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;Most common events by event number and event publishername: &lt;/strong&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;SELECT top 20 Number as EventID, COUNT(*) AS TotalEvents, Publishername as EventSource      &lt;br /&gt;FROM EventAllView eav with (nolock)       &lt;br /&gt;GROUP BY Number, Publishername       &lt;br /&gt;ORDER BY TotalEvents DESC&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The trick is – to run this query periodically – and to examine the most common events for YOUR environment.&amp;#160; The easiest way to view these events – to determine their value – is to create a new Events view in My Workspace, for each event – and then look at the event data, and the rule that collected it:&amp;#160; (I will use a common event 21024 as an example:)&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/Tuningtipturningoffsomeovercollectionofe_D307/image_2.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/Tuningtipturningoffsomeovercollectionofe_D307/image_thumb.png" width="461" height="518" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/Tuningtipturningoffsomeovercollectionofe_D307/image_4.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/Tuningtipturningoffsomeovercollectionofe_D307/image_thumb_1.png" width="635" height="253" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;What we can see – is that this is a very typical event, and there is likely no real value for collecting and storing this event in the OpsDB or Warehouse.&lt;/p&gt;  &lt;p&gt;Next – I will examine the rule.&amp;#160; I will look at the Data Source section, and the Response section.&amp;#160; The purpose here is to get a good idea of where this collection rule is looking, what events it is collecting, and if there is also an alert in the response section.&amp;#160; If there is an alert in the response section – I assume this is important, and will generally leave these rules enabled.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;If the &lt;em&gt;rule&lt;/em&gt; simply collected the event (no alerting), is not used in any reports that I know about (rare condition) and I have determined the event provides little to no value to me, I disable it.&amp;#160; You will find you can disable most of the top consumers in the database.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Here is why I consider it totally cool to disable these uninteresting event collection rules:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;If they are really important – there will be different alert generating rule to fire an alert&lt;/li&gt;    &lt;li&gt;They fill the databases, agent queues, agent load, and network traffic with unimportant information.&lt;/li&gt;    &lt;li&gt;While troubleshooting a real issue – we would examine the agent event log – we wouldn’t search through the database for collected events.&lt;/li&gt;    &lt;li&gt;Reporting on events is really slow – because we cannot aggregate them, so any views are reports dont work well with events.&lt;/li&gt;    &lt;li&gt;If we find we do need one later – simply remove the override.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Here is an example of this one:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/Tuningtipturningoffsomeovercollectionofe_D307/image_6.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/Tuningtipturningoffsomeovercollectionofe_D307/image_thumb_2.png" width="442" height="450" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;So – I create an override in my “Overrides – System Center Core” MP, and disable this rule “for all objects of class”.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Here are some very common event ID’s that I will generally end up disabling their corresponding event collection rules:&lt;/strong&gt;&lt;/p&gt;  &lt;p align="left"&gt;&amp;#160;&lt;/p&gt;  &lt;blockquote&gt;   &lt;h5&gt;1206&lt;/h5&gt;    &lt;h5&gt;1210&lt;/h5&gt;    &lt;h5&gt;1215&lt;/h5&gt;    &lt;h5&gt;1216&lt;/h5&gt;    &lt;h5&gt;10102&lt;/h5&gt;    &lt;h5&gt;10401&lt;/h5&gt;    &lt;h5&gt;10403&lt;/h5&gt;    &lt;h5&gt;10409&lt;/h5&gt;    &lt;h5&gt;10457&lt;/h5&gt;    &lt;h5&gt;10720&lt;/h5&gt;    &lt;h5&gt;11771&lt;/h5&gt;    &lt;h5&gt;21024&lt;/h5&gt;    &lt;h5&gt;21025&lt;/h5&gt;    &lt;h5&gt;21402&lt;/h5&gt;    &lt;h5&gt;21403&lt;/h5&gt;    &lt;h5&gt;21404&lt;/h5&gt;    &lt;h5&gt;21405&lt;/h5&gt;    &lt;h5&gt;29102&lt;/h5&gt;    &lt;h5&gt;29103&lt;/h5&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I don't recommend everyone disable all of these rules… I recommend you periodically view your top 10 or 20 events… and then review them for value.&amp;#160; Just knocking out the top 10 events will often free up 90% of the space they were consuming.&lt;/p&gt;  &lt;p&gt;The above events are the ones I run into in most of my customers… and I generally turn these off, as we get no value from them.&amp;#160; You might find you have some other events as your top consumers.&amp;#160; I recommend you review them in the same manner as above – methodically.&amp;#160; Then revisit this every month or two to see if anything changed.&lt;/p&gt;  &lt;p&gt;I’d also love to hear if you have other events that you see as your top consumer that isn't my list above… SOME events are created from script (conversion MP’s) and unfortunately you cannot do much about those, because you would have to disable the script to fix them.&amp;#160; I’d be happy to give feedback on those, or add any new ones to my list.&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3296381" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/kevinholman/archive/tags/management+pack/default.aspx">management pack</category><category domain="http://blogs.technet.com/kevinholman/archive/tags/grooming/default.aspx">grooming</category></item><item><title>Boosting OpsMgr performance - by reducing the OpsDB data retention</title><link>http://blogs.technet.com/kevinholman/archive/2008/11/04/boosting-opsmgr-performance-by-reducing-the-opsdb-data-retention.aspx</link><pubDate>Wed, 05 Nov 2008 02:24:40 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3147538</guid><dc:creator>kevinhol</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.technet.com/kevinholman/comments/3147538.aspx</comments><wfw:commentRss>http://blogs.technet.com/kevinholman/commentrss.aspx?PostID=3147538</wfw:commentRss><wfw:comment>http://blogs.technet.com/kevinholman/rsscomments.aspx?PostID=3147538</wfw:comment><description>&lt;p&gt;Here is a little tip I often advise my customers on.....&lt;/p&gt;  &lt;p&gt;The default data retention in OpsMgr is 7 days for most data types:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/BoostingOpsMgrperformancebyreducingtheOp_F454/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="556" alt="image" src="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/BoostingOpsMgrperformancebyreducingtheOp_F454/image_thumb.png" width="556" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;These are default settings which work well for a large cross section of different agent counts.&amp;#160; In MOM 2005 - we defaulted to 4 days.&amp;#160; Many customers, especially with large agent counts, would have to reduce that in MOM 2005 down to 2 days to keep a manageable Onepoint DB size.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;That being said - &lt;strong&gt;to boost UI performance, and reduce OpsDB database size&lt;/strong&gt; - consider reducing these values down to your &lt;strong&gt;real business requirements&lt;/strong&gt;.&amp;#160; For a new, out of the box management group - I advise my customers to set these to &lt;strong&gt;2 days&lt;/strong&gt;.&amp;#160; This will keep less noise in your database as you deploy, and tune, agents and management packs.&amp;#160; This keeps a smaller DB, and a more responsive UI, in large agent count environments.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Essentially - set each value to &amp;quot;2&amp;quot; except for Performance Signature&lt;/strong&gt;, which we will change to 1.&amp;#160; Performance Signature is unique.... the setting here isnt actually &amp;quot;Days&amp;quot; of retention.&amp;#160; It is &amp;quot;business cycles&amp;quot;.&amp;#160; This is for self-tuning threshold ONLY.&amp;#160; This data is used for calculating business cycle based self-tuning thresholds.&amp;#160; There is NO REASON for this ever to be larger than the default of &amp;quot;2&amp;quot; business cycles.... and large agent count environments can see a performance benefit by bumping this down to only keeping &amp;quot;1&amp;quot; business cycle.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/BoostingOpsMgrperformancebyreducingtheOp_F454/image_4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="558" alt="image" src="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/BoostingOpsMgrperformancebyreducingtheOp_F454/image_thumb_1.png" width="555" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Then - once your Management group is fully deployed, and you have tuned your alert, performance, event, and state data.... IF you have a business requirement to keep this data for longer - bump it up.&lt;/p&gt;  &lt;p&gt;Keep in mind - this will NOT cause you to groom out Alerts that are open - only closed alerts, and still will keep your closed alerts around for a couple days.&lt;/p&gt;  &lt;p&gt;These settings have no impact on the data that is being written to the data warehouse - so any alert, event, or perf data needed will always be there.&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3147538" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/kevinholman/archive/tags/database/default.aspx">database</category><category domain="http://blogs.technet.com/kevinholman/archive/tags/self+tuning/default.aspx">self tuning</category><category domain="http://blogs.technet.com/kevinholman/archive/tags/grooming/default.aspx">grooming</category></item><item><title>What SQL maintenance should I perform on my OpsMgr databases?</title><link>http://blogs.technet.com/kevinholman/archive/2008/04/12/what-sql-maintenance-should-i-perform-on-my-opsmgr-databases.aspx</link><pubDate>Sat, 12 Apr 2008 02:38:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3035376</guid><dc:creator>kevinhol</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.technet.com/kevinholman/comments/3035376.aspx</comments><wfw:commentRss>http://blogs.technet.com/kevinholman/commentrss.aspx?PostID=3035376</wfw:commentRss><wfw:comment>http://blogs.technet.com/kevinholman/rsscomments.aspx?PostID=3035376</wfw:comment><description>&lt;p&gt;&lt;strong&gt;This question comes up a lot.&amp;#160; The answer is really - not what maintenance you should be performing... but what maintenance you should be *excluding*.... or when.&amp;#160; Here is why:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Most SQL DBA's will set up some pretty basic default maintenance on all SQL DB's they support.&amp;#160; This often includes, but is not limited to:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;DBCC CHECKDB&lt;/strong&gt;&amp;#160; (to look for DB errors and report on them)&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;UPDATE STATISTICS&lt;/strong&gt;&amp;#160; (to boost query performance)&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;DBCC DBREINDEX&lt;/strong&gt;&amp;#160; (to rebuild the table indexes to boost performance)&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;BACKUP&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;SQL DBA's might schedule these to run via the SQL Agent to execute nightly, weekly, or some combination of the above depending on DB size and requirements.&lt;/p&gt;  &lt;p&gt;On the other side of the coin.... in some companies, the MOM/OpsMgr team installs and owns the SQL server.... and they dont do ANY default maintenance to SQL.&amp;#160; Because of this - a focus in OpsMgr was to have the Ops DB and Datawarehouse DB to be fully self-maintaining.... providing a good level of SQL performance whether or not any default maintenance was being done.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;Operational Database:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Reindexing is already taking place against the OperationsManager database for some of the tables.&amp;#160; This is built into the product.&amp;#160; What we need to ensure - is that any default DBA maintenance tasks are not redundant nor conflicting with our built-in maintenance, and our built-in schedules:&lt;/p&gt;  &lt;p&gt;There is a rule in OpsMgr that is targeted at the &lt;strong&gt;Root Management Server&lt;/strong&gt;:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/WhatSQLmaintenanceshouldIperformonmyOpsM_10632/image_2.png" mce_href="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/WhatSQLmaintenanceshouldIperformonmyOpsM_10632/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="232" alt="image" src="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/WhatSQLmaintenanceshouldIperformonmyOpsM_10632/image_thumb.png" width="478" border="0" mce_src="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/WhatSQLmaintenanceshouldIperformonmyOpsM_10632/image_thumb.png" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The rule executes the &amp;quot;p_OptimizeIndexes&amp;quot; stored procedure, every day at 2:30AM:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/WhatSQLmaintenanceshouldIperformonmyOpsM_10632/image_4.png" mce_href="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/WhatSQLmaintenanceshouldIperformonmyOpsM_10632/image_4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="427" alt="image" src="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/WhatSQLmaintenanceshouldIperformonmyOpsM_10632/image_thumb_1.png" width="606" border="0" mce_src="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/WhatSQLmaintenanceshouldIperformonmyOpsM_10632/image_thumb_1.png" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/WhatSQLmaintenanceshouldIperformonmyOpsM_10632/image_6.png" mce_href="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/WhatSQLmaintenanceshouldIperformonmyOpsM_10632/image_6.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="346" alt="image" src="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/WhatSQLmaintenanceshouldIperformonmyOpsM_10632/image_thumb_2.png" width="729" border="0" mce_src="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/WhatSQLmaintenanceshouldIperformonmyOpsM_10632/image_thumb_2.png" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;This rule cannot be changed or modified.&amp;#160; Therefore - we need to ensure there is not other SQL maintenance (including backups) running at 2:30AM, or performance will be impacted.&lt;/p&gt;  &lt;p&gt;If you want to view the built-in UPDATE STATISTICS and DBCC DBREINDEX jobs history - just run the following queries:&lt;/p&gt;  &lt;p&gt;select *    &lt;br /&gt;from DomainTable dt     &lt;br /&gt;inner join DomainTableIndexOptimizationHistory dti     &lt;br /&gt;on dt.domaintablerowID = dti.domaintableindexrowID     &lt;br /&gt;ORDER BY optimizationdurationseconds DESC &lt;/p&gt;  &lt;p&gt;select *    &lt;br /&gt;from DomainTable dt     &lt;br /&gt;inner join DomainTableStatisticsUpdateHistory dti     &lt;br /&gt;on dt.domaintablerowID = dti.domaintablerowID     &lt;br /&gt;ORDER BY UpdateDurationSeconds DESC&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Take note of the update/optimization duration seconds column&lt;/strong&gt;.&amp;#160; This will show you how long your maintenance is typically running.&amp;#160; In a healthy environment these should not take very long.&lt;/p&gt;  &lt;p mce_keep="true"&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;If you want to view the fragmentation levels of the current tables in the database, run:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;DBCC SHOWCONTIG WITH FAST&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Here is some sample output:&lt;/p&gt;  &lt;p&gt;----------------------------------------------------------------------------------------------&lt;/p&gt;  &lt;p&gt;DBCC SHOWCONTIG scanning 'Alert' table...    &lt;br /&gt;Table: 'Alert' (1771153355); index ID: 1, database ID: 5     &lt;br /&gt;TABLE level scan performed.     &lt;br /&gt;- Pages Scanned................................: 936     &lt;br /&gt;- Extent Switches..............................: 427     &lt;br /&gt;- &lt;strong&gt;Scan Density [Best Count:Actual Count].......: 27.34%&lt;/strong&gt; [117:428]     &lt;br /&gt;- &lt;strong&gt;Logical Scan Fragmentation ..................: 60.90%&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;----------------------------------------------------------------------------------------------&lt;/p&gt;  &lt;p&gt;In general - we would like the &amp;quot;&lt;strong&gt;Scan density&lt;/strong&gt;&amp;quot; to be &lt;strong&gt;&lt;em&gt;high&lt;/em&gt;&lt;/strong&gt; (Above 80%), and the &amp;quot;&lt;strong&gt;Logical Scan Fragmentation&lt;/strong&gt;&amp;quot; to be &lt;strong&gt;&lt;em&gt;low&lt;/em&gt;&lt;/strong&gt; (below 30%).&amp;#160; What you might find... is that *some* of the tables are more fragmented than others, because our built-in maintenance does not reindex all tables.&amp;#160; Especially tables like the raw perf, event, and localizedtext tables.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;That said - there is nothing wrong with running a DBA's default maintenance against the Operational database&lt;/strong&gt;..... reindexing these tables in the database might also help console performance.&amp;#160; We just dont want to run any DBA maintenance during the same time that we run our own internal maintenance, so try not to conflict with this schedule.&amp;#160; Care should also be taken in any default DBA maintenance, that it does not run too long, or impact normal operations of OpsMgr.&amp;#160; Maintenance jobs should be monitored, and should not conflict with the backup schedules as well.&lt;/p&gt;  &lt;p&gt;Here is a reindex job you can schedule with SQL agent.... for the OpsDB:&lt;/p&gt;  &lt;p&gt;USE OperationsManager    &lt;br /&gt;go     &lt;br /&gt;SET ANSI_NULLS ON     &lt;br /&gt;SET ANSI_PADDING ON     &lt;br /&gt;SET ANSI_WARNINGS ON     &lt;br /&gt;SET ARITHABORT ON     &lt;br /&gt;SET CONCAT_NULL_YIELDS_NULL ON     &lt;br /&gt;SET QUOTED_IDENTIFIER ON     &lt;br /&gt;SET NUMERIC_ROUNDABORT OFF     &lt;br /&gt;EXEC SP_MSForEachTable &amp;quot;Print 'Reindexing '+'?' DBCC DBREINDEX ('?')&amp;quot;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;em&gt;Data Warehouse Database:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The data warehouse DB is also fully self maintaining.&amp;#160; This is called out by a rule &amp;quot;&lt;strong&gt;Standard Data Warehouse Data Set maintenance rule&lt;/strong&gt;&amp;quot; which is targeted to the &amp;quot;&lt;strong&gt;Standard Data Set&lt;/strong&gt;&amp;quot; object type.&amp;#160; This stored procedure is called on the data warehouse &lt;strong&gt;&lt;em&gt;every 60 seconds&lt;/em&gt;&lt;/strong&gt;.&amp;#160; It performs many, many tasks, of which Index optimization is but one.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/WhatSQLmaintenanceshouldIperformonmyOpsM_10632/image_8.png" mce_href="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/WhatSQLmaintenanceshouldIperformonmyOpsM_10632/image_8.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="186" alt="image" src="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/WhatSQLmaintenanceshouldIperformonmyOpsM_10632/image_thumb_3.png" width="691" border="0" mce_src="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/WhatSQLmaintenanceshouldIperformonmyOpsM_10632/image_thumb_3.png" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;This SP calls the StandardDatasetOptimize stored procedure, which handles any index operations.&lt;/p&gt;  &lt;p&gt;To examine the index and statistics history - run the following query for the Alert, Event, Perf, and State tables:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;select basetablename, optimizationstartdatetime, optimizationdurationseconds,    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; beforeavgfragmentationinpercent, afteravgfragmentationinpercent,     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; optimizationmethod, onlinerebuildlastperformeddatetime     &lt;br /&gt;from StandardDatasetOptimizationHistory sdoh     &lt;br /&gt;inner join StandardDatasetAggregationStorageIndex sdasi     &lt;br /&gt;on sdoh.StandardDatasetAggregationStorageIndexRowId = sdasi.StandardDatasetAggregationStorageIndexRowId     &lt;br /&gt;inner join StandardDatasetAggregationStorage sdas     &lt;br /&gt;on sdasi.StandardDatasetAggregationStorageRowId = sdas.StandardDatasetAggregationStorageRowId     &lt;br /&gt;ORDER BY optimizationdurationseconds DESC&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Then examine the default domain tables optimization history.... run the same two queries as listed above for the OperationsDB.&lt;/p&gt;  &lt;p&gt;In the data warehouse - we can see that all the necessary tables are being updated and reindexed as needed.&amp;#160; When a table is 10% fragmented - we reorganize.&amp;#160; When it is 30% or more, we rebuild the index.&lt;/p&gt;  &lt;p&gt;Therefore - &lt;strong&gt;there is no need for a DBA to execute any UPDATE STATISTICS or DBCC DBREINDEX maintenance against this database&lt;/strong&gt;.&amp;#160; Furthermore, since we run our maintenance every 60 seconds, and only execute maintenance when necessary, there is no &amp;quot;set window&amp;quot; where we will run our maintenance jobs.&amp;#160; This means that if a DBA team also sets up a UPDATE STATISTICS or DBCC DBREINDEX job - it can conflict with our jobs and execute concurrently.&amp;#160; This should not be performed.&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;For the above reasons, I would recommend against any maintenance jobs on the &lt;strong&gt;Data Warehouse DB&lt;/strong&gt;, beyond a CHECKDB (only if DBA's mandate it) and a good backup schedule.&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;For the OpsDB:&lt;/strong&gt; any standard maintenance is fine, as long as it does not conflict with the built-in maintenance, or impact production by taking too long, or having an impact on I/O.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Lastly - I'd like to discuss the recovery model of the SQL database.&amp;#160; We default to &amp;quot;&lt;strong&gt;simple&lt;/strong&gt;&amp;quot; for all our DB's.&amp;#160; This should be left alone.... unless you have *&lt;strong&gt;very&lt;/strong&gt;* specific reasons to change this.&amp;#160; Some SQL teams automatically assume all databases should be set to &amp;quot;&lt;strong&gt;full&lt;/strong&gt;&amp;quot; recovery model.&amp;#160; This requires that they back up the transaction logs on a very regular basis, but give the added advantage of restoring up to the time of the last t-log backup.&amp;#160; For OpsMgr, this is of very little value, as the data changing on an hourly basis is of little value compared to the complexity added by moving from simple to full.&amp;#160; Also, changing to full will mean that your transaction logs will only checkpoint once a t-log backup is performed.&amp;#160; What I have seen, is that many companies aren't prepared for the amount of data written to these databases.... and their standard transaction log backups (often hourly) are not frequent enough to keep them from filling.&amp;#160; The only valid reason to change to FULL, in my opinion, is when you are using an advanced replication strategy, like log shipping, which requires full recovery model.&amp;#160; When in doubt - &lt;strong&gt;&lt;em&gt;keep it simple&lt;/em&gt;&lt;/strong&gt;.&amp;#160; :-)&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;P.S....&amp;#160; The Operations Database needs 50% free space at all times.&amp;#160; This is for growth, and for re-index operations to be successful.&amp;#160; This is a general supportability recommendation, but the OpsDB will alert when this falls below 40%.&amp;#160; &lt;/p&gt;  &lt;p&gt;For the Data warehouse.... we do not require the same 50% free space.&amp;#160; This would be a temendous requireemnts if we had a multiple-terabyte database!&lt;/p&gt;  &lt;p&gt;Think of the data warehouse to have 2 stages... a &amp;quot;growth&amp;quot; stage (while it is adding data and not yet grooming much (havent hit the default 400 days retention) and a &amp;quot;maturity stage&amp;quot; where agent count is steady, MP's are not changing, and the grooming is happening because we are at 400 days retention.&amp;#160; During &amp;quot;growth&amp;quot; we need to watch and maintain free space, and monitor for available disk space.&amp;#160; In &amp;quot;maturity&amp;quot; we only need enough free space to handle our index operations.&amp;#160; when you start talking 1 Terabyte of data.... that means 500GB of free space, which is expensive, and.&amp;#160; If you cannot allocate it.... then just allow auto-grow and monitor the database.... but always plan for it from a volume size perspective.&lt;/p&gt;  &lt;p&gt;For transaction log sizing - we don't have any hard rules.&amp;#160; A good rule of thumb for the OpsDB is ~20% to 50% of the database size.... this all depends on your environment.&amp;#160; For the Data warehouse, it depends on how large the warehouse is - but you will probably find steady state to require somewhere around 10% to 20% of the warehouse size.&amp;#160; Any time we are doing any additional grooming of an alert/event/perf storm.... or changin grooming from 400 days to 300 days - this will require a LOT more transaction log space - so keep that in mind as your databases grow.&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3035376" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/kevinholman/archive/tags/database/default.aspx">database</category><category domain="http://blogs.technet.com/kevinholman/archive/tags/grooming/default.aspx">grooming</category></item><item><title>Grooming process in the Operations Database</title><link>http://blogs.technet.com/kevinholman/archive/2008/02/13/grooming-process-in-the-operations-database.aspx</link><pubDate>Wed, 13 Feb 2008 05:51:47 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:2881422</guid><dc:creator>kevinhol</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.technet.com/kevinholman/comments/2881422.aspx</comments><wfw:commentRss>http://blogs.technet.com/kevinholman/commentrss.aspx?PostID=2881422</wfw:commentRss><wfw:comment>http://blogs.technet.com/kevinholman/rsscomments.aspx?PostID=2881422</wfw:comment><description>&lt;p&gt;This is a continuation of my other post, on general alert grooming:&lt;/p&gt;  &lt;p&gt;&lt;a title="How grooming and auto-resolution work in the OpsMgr 2007 Operational database" href="http://blogs.technet.com/kevinholman/archive/2007/12/13/how-grooming-and-auto-resolution-work-in-the-opsmgr-2007-operational-database.aspx"&gt;How grooming and auto-resolution work in the OpsMgr 2007 Operational database&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Grooming of the OpsDB is called once per day at 12:00am&amp;#8230;. by the rule:&amp;#160; &amp;#8220;&lt;strong&gt;Partitioning and Grooming&lt;/strong&gt;&amp;#8221; You can search for this rule in the Authoring space of the console, under Rules. It is targeted to the &amp;#8220;&lt;strong&gt;Root Management Server&lt;/strong&gt;&amp;#8221; and is part of the System Center Internal Library.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/GroomingprocessintheOperationsDatabase_1255A/image_4.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="166" alt="image" src="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/GroomingprocessintheOperationsDatabase_1255A/image_thumb_1.png" width="440" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;It calls the &amp;#8220;&lt;strong&gt;p_PartitioningAndGrooming&lt;/strong&gt;&amp;#8221; stored procedure.&amp;#160; This SP calls two other SP's:&amp;#160; &lt;strong&gt;p_Partitioning&lt;/strong&gt; and then &lt;strong&gt;p_Grooming&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;p_Partitioning&lt;/strong&gt; inspects the table &lt;strong&gt;PartitionAndGroomingSettings&lt;/strong&gt;, and then calls the SP &lt;strong&gt;p_PartitionObject&lt;/strong&gt; for each object in the &lt;strong&gt;PartitionAndGroomingSettings&lt;/strong&gt; table where &amp;quot;&lt;strong&gt;IsPartitioned = 1&lt;/strong&gt;&amp;quot;&amp;#160;&amp;#160; (note - we partition event and perf into 61 daily tables - just like MOM 2005)&lt;/p&gt;  &lt;p&gt;The &lt;strong&gt;PartitionAndGroomingSettings&lt;/strong&gt; table:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/GroomingprocessintheOperationsDatabase_1255A/image_6.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="234" alt="image" src="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/GroomingprocessintheOperationsDatabase_1255A/image_thumb_2.png" width="678" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The &lt;strong&gt;p_PartitionObject&lt;/strong&gt; SP first identifies the next partition in the sequence, truncates it to make sure it is empty, and then updates the &lt;strong&gt;PartitionTables&lt;/strong&gt; table in the database, to update the &lt;strong&gt;IsCurrent&lt;/strong&gt; field to the next numeric table for events and perf.&amp;#160; Then it calls the &lt;strong&gt;p_PartitionAlterInsertView&lt;/strong&gt; sproc, to make new data start writing to the current event and perf table.&lt;/p&gt;  &lt;p&gt;To review which tables you are writing to - execute the following query:&amp;#160;&amp;#160; &lt;em&gt;&lt;strong&gt;select * from partitiontables where IsCurrent = '1'&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;A &lt;strong&gt;&lt;em&gt;select * from partitiontables &lt;/em&gt;&lt;/strong&gt;will show you all 61 event and perf tables, and when they were used.&amp;#160; You should see a &lt;strong&gt;PartitionStartTime&lt;/strong&gt; updated every day - around midnight (time is stored in UTC in the database).&amp;#160; If partitioning is failing to run, then we wont see this date changing every day.&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Ok - that's the first step of the &lt;strong&gt;p_PartitioningAndGrooming&lt;/strong&gt; sproc - Partitioning.&amp;#160; Now - if that is all successful, we will start grooming!&lt;/p&gt;  &lt;p&gt;The &lt;strong&gt;p_Grooming&lt;/strong&gt; is called after partitioning is successful.&amp;#160; One of the first things it does - is to update the InternalJobHistory table.&amp;#160; In this able - we keep a record of all partitioning and grooming jobs.&amp;#160; It is a good spot check to see what's going on with grooming.&amp;#160; To have a peek at this table - execute a &lt;strong&gt;&lt;em&gt;select * from InternalJobHistory order by InternalJobHistoryId&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/GroomingprocessintheOperationsDatabase_1255A/image_8.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="137" alt="image" src="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/GroomingprocessintheOperationsDatabase_1255A/image_thumb_3.png" width="670" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The &lt;strong&gt;p_Grooming&lt;/strong&gt; sproc then calls &lt;strong&gt;p_GroomPartitionedObjects&amp;#160; &lt;/strong&gt;This sproc will first examine the &lt;strong&gt;PartitionAndGroomingSettings&lt;/strong&gt; and compare the days to keep column, against the current date, to figure out how many partitions to groom.&amp;#160; It will then inspect the partitions to ensure they have data, and then truncate the partition, by calling &lt;strong&gt;p_PartitionTruncate.&amp;#160; &lt;/strong&gt;The &lt;strong&gt;p_GroomPartitionedObjects &lt;/strong&gt;sproc will then update the &lt;strong&gt;PartitionAndGroomingSettings &lt;/strong&gt;table with the current time, under the &lt;strong&gt;GroomingRunTime&lt;/strong&gt; column.&amp;#160; &lt;/p&gt;  &lt;p&gt;Next - the &lt;strong&gt;p_Grooming&lt;/strong&gt; sproc continues, by calling &lt;strong&gt;p_GroomNonPartitionedObjects.&amp;#160; p_GroomNonPartitionedObjects &lt;/strong&gt;is a short, but complex sproc - in that is calls all the individual sprocs listed in the &lt;strong&gt;PartitionAndGroomingSettings&lt;/strong&gt; table where IsPartitioned = 0.&amp;#160; (see my other post at the link above to follow the logic of one of these non-partitioned sprocs)&lt;/p&gt;  &lt;p&gt;Next - the &lt;strong&gt;p_Grooming&lt;/strong&gt; sproc continues, by updating the InternalJobHistory table, to give it a status of success (StatusCode of 1 = success, 2= failed, 0 appears to be never completed?)&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;If you ever have a problem with grooming - or need to get your OpsDB database size under control - simply reduce the data retention days, in the console, under Administration, Settings, Database Grooming.&amp;#160; To start with - I recommend setting all these to just 2 days, fromt he default of 7.&amp;#160; This keeps your OpsDB under control until you have time to tune all the noise fromt he MP's you import.&amp;#160; So just reduce this number, then open up query analyzer, and execute &lt;strong&gt;p_PartitioningAndGrooming&lt;/strong&gt;&amp;#160; When it is done, check the job status by executing &lt;strong&gt;&lt;em&gt;select * from InternalJobHistory order by InternalJobHistoryId&amp;#160;&amp;#160; &lt;/em&gt;&lt;/strong&gt;The last groom job should be present, and successful.&amp;#160; The OpsDB size should be smaller, with more free space.&amp;#160; And to validate, you can always run my large table query, found at:&amp;#160;&amp;#160; &lt;a title="Useful Operations Manager 2007 SQL queries" href="http://blogs.technet.com/kevinholman/archive/2007/10/18/useful-operations-manager-2007-sql-queries.aspx"&gt;Useful Operations Manager 2007 SQL queries&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=2881422" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/kevinholman/archive/tags/database/default.aspx">database</category><category domain="http://blogs.technet.com/kevinholman/archive/tags/grooming/default.aspx">grooming</category></item><item><title>Print Server management pack fills the Operational DB with TONS of perf data</title><link>http://blogs.technet.com/kevinholman/archive/2008/02/12/print-server-management-pack-fills-the-operational-db-with-tons-of-perf-data.aspx</link><pubDate>Tue, 12 Feb 2008 03:19:51 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:2872547</guid><dc:creator>kevinhol</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.technet.com/kevinholman/comments/2872547.aspx</comments><wfw:commentRss>http://blogs.technet.com/kevinholman/commentrss.aspx?PostID=2872547</wfw:commentRss><wfw:comment>http://blogs.technet.com/kevinholman/rsscomments.aspx?PostID=2872547</wfw:comment><description>&lt;p&gt;This is something I have noticed in MOM 2005, and seems to be the same in the conversion MP for OpsMgr 2007.&amp;#160; (Version 6.0.5000.0 of the Microsoft.Windows.Server.Printserver (Converted) MP).&amp;#160; When you import this MP, it will fill the Operational and reporting databases with performance data about print jobs and queues, if you have a large number of print servers/queues in your environment.&lt;/p&gt;  &lt;p&gt;If reporting on this perf data is not critical to your environment, you should disable these rules:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/PrintServermanagementpackfillstheOperati_101C0/clip_image002_2.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="453" alt="clip_image002" src="http://blogs.technet.com/blogfiles/kevinholman/WindowsLiveWriter/PrintServermanagementpackfillstheOperati_101C0/clip_image002_thumb.jpg" width="702" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=2872547" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/kevinholman/archive/tags/database/default.aspx">database</category><category domain="http://blogs.technet.com/kevinholman/archive/tags/management+pack/default.aspx">management pack</category><category domain="http://blogs.technet.com/kevinholman/archive/tags/grooming/default.aspx">grooming</category></item><item><title>Failed tasks aren't groomed from the Operational Database</title><link>http://blogs.technet.com/kevinholman/archive/2008/02/05/failed-tasks-aren-t-groomed-from-the-operational-database.aspx</link><pubDate>Tue, 05 Feb 2008 20:02:59 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:2832480</guid><dc:creator>kevinhol</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.technet.com/kevinholman/comments/2832480.aspx</comments><wfw:commentRss>http://blogs.technet.com/kevinholman/commentrss.aspx?PostID=2832480</wfw:commentRss><wfw:comment>http://blogs.technet.com/kevinholman/rsscomments.aspx?PostID=2832480</wfw:comment><description>&lt;p&gt;This appears to be present up to RC-SP1 version, build 6.0.6246.0&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;In the Task Status console view - I noticed an old failed task from 2 months ago..... however, my task grooming is set to 7 days.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;To view the grooming process:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.technet.com/kevinholman/archive/2007/12/13/how-grooming-and-auto-resolution-work-in-the-opsmgr-2007-operational-database.aspx"&gt;http://blogs.technet.com/kevinholman/archive/2007/12/13/how-grooming-and-auto-resolution-work-in-the-opsmgr-2007-operational-database.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Basically &amp;#8211; select * from PartitionAndGroomingSettings will show you all grooming going on.&lt;/p&gt;  &lt;p&gt;Tasks are kept in the jobstatus table.&lt;/p&gt;  &lt;p&gt;Select * from jobstatus will show all tasks.&lt;/p&gt;  &lt;p&gt;p_jobstatusgrooming is called to groom this table.&lt;/p&gt;  &lt;p&gt;Here is the text of that SP:&lt;/p&gt;  &lt;p&gt;--------------------------------&lt;/p&gt;  &lt;p&gt;USE [OperationsManager]&lt;/p&gt;  &lt;p&gt;GO&lt;/p&gt;  &lt;p&gt;/****** Object:&amp;#160; StoredProcedure [dbo].[p_JobStatusGrooming]&amp;#160;&amp;#160;&amp;#160; Script Date: 02/05/2008 10:49:32 ******/&lt;/p&gt;  &lt;p&gt;SET ANSI_NULLS ON&lt;/p&gt;  &lt;p&gt;GO&lt;/p&gt;  &lt;p&gt;SET QUOTED_IDENTIFIER ON&lt;/p&gt;  &lt;p&gt;GO&lt;/p&gt;  &lt;p&gt;ALTER PROCEDURE [dbo].[p_JobStatusGrooming]&lt;/p&gt;  &lt;p&gt;AS&lt;/p&gt;  &lt;p&gt;BEGIN&lt;/p&gt;  &lt;p&gt;SET NOCOUNT ON&lt;/p&gt;  &lt;p&gt;DECLARE @Err int&lt;/p&gt;  &lt;p&gt;DECLARE @Ret int&lt;/p&gt;  &lt;p&gt;DECLARE @RowCount int&lt;/p&gt;  &lt;p&gt;DECLARE @SaveTranCount int&lt;/p&gt;  &lt;p&gt;DECLARE @GroomingThresholdLocal datetime&lt;/p&gt;  &lt;p&gt;DECLARE @GroomingThresholdUTC datetime&lt;/p&gt;  &lt;p&gt;DECLARE @TimeGroomingRan datetime&lt;/p&gt;  &lt;p&gt;DECLARE @MaxTimeGroomed datetime&lt;/p&gt;  &lt;p&gt;SET @SaveTranCount = @@TRANCOUNT&lt;/p&gt;  &lt;p&gt;SET @TimeGroomingRan = getutcdate()&lt;/p&gt;  &lt;p&gt;SELECT @GroomingThresholdLocal = dbo.fn_GroomingThreshold(DaysToKeep, getdate())&lt;/p&gt;  &lt;p&gt;FROM dbo.PartitionAndGroomingSettings&lt;/p&gt;  &lt;p&gt;WHERE ObjectName = 'JobStatus'&lt;/p&gt;  &lt;p&gt;EXEC dbo.p_ConvertLocalTimeToUTC @GroomingThresholdLocal, @GroomingThresholdUTC OUT&lt;/p&gt;  &lt;p&gt;IF (@@ERROR &amp;lt;&amp;gt; 0)&lt;/p&gt;  &lt;p&gt;BEGIN&lt;/p&gt;  &lt;p&gt;GOTO Error_Exit&lt;/p&gt;  &lt;p&gt;END&lt;/p&gt;  &lt;p&gt;-- Selecting the max time to be groomed to update the table&lt;/p&gt;  &lt;p&gt;SELECT @MaxTimeGroomed = MAX(LastModified)&lt;/p&gt;  &lt;p&gt;FROM dbo.JobStatus &lt;/p&gt;  &lt;p&gt;WHERE TimeFinished IS NOT NULL&lt;/p&gt;  &lt;p&gt;AND LastModified &amp;lt; @GroomingThresholdUTC&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;IF @MaxTimeGroomed IS NULL&lt;/p&gt;  &lt;p&gt;GOTO Success_Exit&lt;/p&gt;  &lt;p&gt;BEGIN TRAN&lt;/p&gt;  &lt;p&gt;-- Change the Statement below to reflect the new item &lt;/p&gt;  &lt;p&gt;-- that needs to be groomed&lt;/p&gt;  &lt;p&gt;DELETE FROM dbo.JobStatus&lt;/p&gt;  &lt;p&gt;WHERE TimeFinished IS NOT NULL&lt;/p&gt;  &lt;p&gt;AND LastModified &amp;lt; @GroomingThresholdUTC&lt;/p&gt;  &lt;p&gt;SET @Err = @@ERROR&lt;/p&gt;  &lt;p&gt;IF (@Err &amp;lt;&amp;gt; 0)&lt;/p&gt;  &lt;p&gt;BEGIN&lt;/p&gt;  &lt;p&gt;GOTO Error_Exit&lt;/p&gt;  &lt;p&gt;END&lt;/p&gt;  &lt;p&gt;UPDATE dbo.PartitionAndGroomingSettings&lt;/p&gt;  &lt;p&gt;SET GroomingRunTime = @TimeGroomingRan,&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; DataGroomedMaxTime = @MaxTimeGroomed&lt;/p&gt;  &lt;p&gt;WHERE ObjectName = 'JobStatus'&lt;/p&gt;  &lt;p&gt;SELECT @Err = @@ERROR, @RowCount = @@ROWCOUNT&lt;/p&gt;  &lt;p&gt;IF (@Err &amp;lt;&amp;gt; 0 OR @RowCount &amp;lt;&amp;gt; 1)&lt;/p&gt;  &lt;p&gt;BEGIN&lt;/p&gt;  &lt;p&gt;GOTO Error_Exit&lt;/p&gt;  &lt;p&gt;END&lt;/p&gt;  &lt;p&gt;COMMIT TRAN&lt;/p&gt;  &lt;p&gt;Success_Exit:&lt;/p&gt;  &lt;p&gt;RETURN 0&lt;/p&gt;  &lt;p&gt;Error_Exit:&lt;/p&gt;  &lt;p&gt;-- If there was an error and there is a transaction&lt;/p&gt;  &lt;p&gt;-- pending, rollback.&lt;/p&gt;  &lt;p&gt;IF (@@TRANCOUNT &amp;gt; @SaveTranCount)&lt;/p&gt;  &lt;p&gt;ROLLBACK TRAN&lt;/p&gt;  &lt;p&gt;RETURN 1&lt;/p&gt;  &lt;p&gt;END&lt;/p&gt;  &lt;p&gt;------------------------------------&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Here is the problem in the SP:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;DELETE FROM dbo.JobStatus&lt;/p&gt;  &lt;p&gt;WHERE TimeFinished IS NOT NULL&lt;/p&gt;  &lt;p&gt;AND LastModified &amp;lt; @GroomingThresholdUTC&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;We only delete (groom) tasks that have a timestamp in TimeFinished.&amp;#160; If a failed task doesn&amp;#8217;t finish &amp;#8211; this field will be NULL and never gets groomed.&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=2832480" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/kevinholman/archive/tags/database/default.aspx">database</category><category domain="http://blogs.technet.com/kevinholman/archive/tags/grooming/default.aspx">grooming</category></item><item><title>How grooming and auto-resolution work in the OpsMgr 2007 Operational database</title><link>http://blogs.technet.com/kevinholman/archive/2007/12/13/how-grooming-and-auto-resolution-work-in-the-opsmgr-2007-operational-database.aspx</link><pubDate>Fri, 14 Dec 2007 02:22:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:2644996</guid><dc:creator>kevinhol</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.technet.com/kevinholman/comments/2644996.aspx</comments><wfw:commentRss>http://blogs.technet.com/kevinholman/commentrss.aspx?PostID=2644996</wfw:commentRss><wfw:comment>http://blogs.technet.com/kevinholman/rsscomments.aspx?PostID=2644996</wfw:comment><description>&lt;H1 style="MARGIN: 24pt 0in 0pt"&gt;&lt;FONT face=Cambria color=#365f91 size=5&gt;How Grooming and Auto-Resolution works in the OpsMgr 2007 Operations DB&lt;/FONT&gt;&lt;/H1&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;FONT face=Cambria color=#4f81bd size=4&gt;Warning – don’t read this if you are bored easily.&amp;nbsp;&lt;/FONT&gt;&lt;/H2&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;In a simplified view to groom alerts…..&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;Grooming of the ops DB is called once per day at 12:00am…. by the rule:&amp;nbsp; “&lt;STRONG&gt;Partitioning and Grooming&lt;/STRONG&gt;”&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You can search for this rule in the Authoring space of the console, under Rules.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;It is targeted to the “&lt;STRONG&gt;Root Management Server&lt;/STRONG&gt;” and is part of the System Center Internal Library.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;It calls the “&lt;STRONG&gt;p_PartitioningAndGrooming&lt;/STRONG&gt;” stored procedure, which calls &lt;STRONG&gt;p_Grooming&lt;/STRONG&gt;, which calls &lt;STRONG&gt;p_GroomNonPartitionedObjects&lt;/STRONG&gt; (Alerts are not partitioned) which inspects the &lt;STRONG&gt;PartitionAndGroomingSetting&lt;/STRONG&gt;s table… and executes each stored procedure.&amp;nbsp; The Alerts stored procedure in that table is referenced as &lt;STRONG&gt;p_AlertGrooming&lt;/STRONG&gt; which has the following sql statement:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;SELECT&lt;/SPAN&gt; AlertId &lt;SPAN style="COLOR: blue"&gt;INTO&lt;/SPAN&gt; #AlertsToGroom&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;FROM&lt;/SPAN&gt; dbo&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;Alert&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;WHERE&lt;/SPAN&gt; TimeResolved &lt;SPAN style="COLOR: gray"&gt;IS&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;NOT&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;NULL&lt;/SPAN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;AND&lt;/SPAN&gt; TimeResolved &lt;SPAN style="COLOR: gray"&gt;&amp;lt;&lt;/SPAN&gt; @GroomingThresholdUTC&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;AND&lt;/SPAN&gt; ResolutionState &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; 255&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;So…. the criteria for what is groomed is pretty simple:&amp;nbsp; In a resolution state of “Closed” (255) and older than the 7 day default setting (or your custom setting referenced in the table above)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;We won’t groom any alerts that are in &lt;STRONG&gt;New&lt;/STRONG&gt; (0), or any &lt;STRONG&gt;custom resolution-states&lt;/STRONG&gt; (custom ID #).&amp;nbsp; Those will have to be set to “&lt;STRONG&gt;Closed&lt;/STRONG&gt;” (255)…. either by autoresolution of a monitor returning to healthy, direct user interaction, our built in autoresolution mechanism, or your own custom script.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;Ok – that covers grooming.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;However – I can see that brings up the question – how does auto-resolution work?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;IMG style="WIDTH: 539px; HEIGHT: 307px" height=307 src="http://blogs.technet.com/photos/kevinholman/images/2645011/original.aspx" width=539 mce_src="http://blogs.technet.com/photos/kevinholman/images/2645011/original.aspx"&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;That specifically states “&lt;STRONG&gt;alerts in the new resolution state&lt;/STRONG&gt;”.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I don’t think that is completely correct:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;That is called upon by the rule “&lt;STRONG&gt;Alert Auto Resolve Execute All&lt;/STRONG&gt;” which runs &lt;STRONG&gt;p_AlertAutoResolveExecuteAll&lt;/STRONG&gt; once per day at &lt;STRONG&gt;4:00&lt;/STRONG&gt;am.&amp;nbsp; This calls &lt;STRONG&gt;p_AlertAutoResolve&lt;/STRONG&gt; twice…. once with a variable of “&lt;STRONG&gt;0&lt;/STRONG&gt;” and once with a “&lt;STRONG&gt;1&lt;/STRONG&gt;”. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;Here is the sql statement: &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;@AutoResolveType &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; 0&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;BEGIN&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;SELECT&lt;/SPAN&gt; @AlertResolvePeriodInDays &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; [SettingValue]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;FROM&lt;/SPAN&gt; dbo&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;[GlobalSettings]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;WHERE&lt;/SPAN&gt; [ManagedTypePropertyId] &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; dbo&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;fn_ManagedTypePropertyId_MicrosoftSystemCenterManagementGroup_HealthyAlertAutoResolvePeriod&lt;SPAN style="COLOR: gray"&gt;()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;SET&lt;/SPAN&gt; @AutoResolveThreshold &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: fuchsia"&gt;DATEADD&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;dd&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;-&lt;/SPAN&gt;@AlertResolvePeriodInDays&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: fuchsia"&gt;getutcdate&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;())&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;SET&lt;/SPAN&gt; @RootMonitorId &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; dbo&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;fn_ManagedTypeId_SystemHealthEntityState&lt;SPAN style="COLOR: gray"&gt;()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;-- We will resolve all alerts that have green state and are un-resolved&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;-- and haven't been modified for N number of days.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;INSERT&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;INTO&lt;/SPAN&gt; @AlertsToBeResolved&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;SELECT&lt;/SPAN&gt; A&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;[AlertId]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;FROM&lt;/SPAN&gt; dbo&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;[Alert] A&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;JOIN&lt;/SPAN&gt; dbo&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;[State] S&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;ON&lt;/SPAN&gt; A&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;[BaseManagedEntityId] &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; S&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;[BaseManagedEntityId] &lt;SPAN style="COLOR: gray"&gt;AND&lt;/SPAN&gt; S&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;[MonitorId] &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; @RootMonitorId&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;WHERE&lt;/SPAN&gt; A&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;[LastModified] &lt;SPAN style="COLOR: gray"&gt;&amp;lt;&lt;/SPAN&gt; @AutoResolveThreshold&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;AND&lt;/SPAN&gt; A&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;[ResolutionState] &lt;SPAN style="COLOR: gray"&gt;&amp;lt;&amp;gt;&lt;/SPAN&gt; 255&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;AND&lt;/SPAN&gt; S&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;[HealthState] &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; 1 &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;snip&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;ELSE&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;IF&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;@AutoResolveType &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; 1&lt;SPAN style="COLOR: gray"&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;BEGIN&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;SELECT&lt;/SPAN&gt; @AlertResolvePeriodInDays &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; [SettingValue]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;FROM&lt;/SPAN&gt; dbo&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;[GlobalSettings]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;WHERE&lt;/SPAN&gt; [ManagedTypePropertyId] &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; dbo&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;fn_ManagedTypePropertyId_MicrosoftSystemCenterManagementGroup_AlertAutoResolvePeriod&lt;SPAN style="COLOR: gray"&gt;()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;SET&lt;/SPAN&gt; @AutoResolveThreshold &lt;SPAN style="COLOR: gray"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: fuchsia"&gt;DATEADD&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;(&lt;/SPAN&gt;dd&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: gray"&gt;-&lt;/SPAN&gt;@AlertResolvePeriodInDays&lt;SPAN style="COLOR: gray"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: fuchsia"&gt;getutcdate&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;())&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;-- We will resolve all alerts that are un-resolved&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;-- and haven't been modified for N number of days.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;INSERT&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;INTO&lt;/SPAN&gt; @AlertsToBeResolved&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;SELECT&lt;/SPAN&gt; A&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;[AlertId]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;FROM&lt;/SPAN&gt; dbo&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;[Alert] A&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;WHERE&lt;/SPAN&gt; A&lt;SPAN style="COLOR: gray"&gt;.&lt;/SPAN&gt;[LastModified] &lt;SPAN style="COLOR: gray"&gt;&amp;lt;&lt;/SPAN&gt; @AutoResolveThreshold&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;AND&lt;/SPAN&gt; ResolutionState &lt;SPAN style="COLOR: gray"&gt;&amp;lt;&amp;gt;&lt;/SPAN&gt; 255&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #1f497d; FONT-FAMILY: 'Arial','sans-serif'"&gt;So we are basically checking that &lt;STRONG&gt;Resolution state &amp;lt;&amp;gt; 255&lt;/STRONG&gt;….. not specifically “&lt;STRONG&gt;New&lt;/STRONG&gt;” (0) as we would lead you to believe by the wording in the interface.&amp;nbsp; There are simply two types of auto-resolution:&amp;nbsp; Resolve all alerts where the object has returned to a healthy state in “&lt;STRONG&gt;N&lt;/STRONG&gt;” days….. and Resolve all alerts no matter what, as long as they haven’t been modified in “&lt;STRONG&gt;N&lt;/STRONG&gt;” days.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=2644996" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/kevinholman/archive/tags/database/default.aspx">database</category><category domain="http://blogs.technet.com/kevinholman/archive/tags/grooming/default.aspx">grooming</category></item></channel></rss>