<?xml version="1.0" encoding="UTF-8" ?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Real Life Microsoft IT</title><subtitle type="html">This blog deals with the joys, trials and tribulations of running a 24/7 heavy volume IT infrastructure using Microsoft (and supporting ecosystem) tools</subtitle><id>http://rentacoder.com/CS/blogs/real_life_it/atom.aspx</id><link rel="alternate" type="text/html" href="http://rentacoder.com/CS/blogs/real_life_it/default.aspx" /><link rel="self" type="application/atom+xml" href="http://rentacoder.com/CS/blogs/real_life_it/atom.aspx" /><generator uri="http://communityserver.org" version="2.0.60217.2664">Community Server</generator><updated>2006-03-17T20:18:00Z</updated><entry><title>Microsoft Exchange 2005:  Dealing with an email denial of service attack</title><link rel="alternate" type="text/html" href="http://rentacoder.com/CS/blogs/real_life_it/archive/2006/12/18/525.aspx" /><id>http://rentacoder.com/CS/blogs/real_life_it/archive/2006/12/18/525.aspx</id><published>2006-12-19T02:36:00Z</published><updated>2006-12-19T02:36:00Z</updated><content type="html">&lt;P&gt;Microsoft Exchange 2005 has a # of features to make it easier to deal with spam (unsolicited email) with Intelligent Message Filtering.&amp;nbsp; However dealing with an email denial of service attack is a slightly different story.&amp;nbsp; A well constructed attack will probably be from someone who knows your company...and if they're smart, it won't be a spam-like message that would kick off the spam protection...but will look like an ordinary/legitimate email (albiet sent several hundred thousand times).&amp;nbsp; You would think that Exchange would have something that built into it that would detect this. However Intelligent Message filtering has a large limitation in this regard...it only looks at single messages, and doesn't do any comparison across messages. &lt;/P&gt;
&lt;P&gt;So what do you do when someone launches a DOS (denial of service) attack against you via email?&amp;nbsp; It would be nice if Exchange could notify you of this...but it has no such feature.&amp;nbsp; So the first time you'll find out about it, is that a user will complain that they have several hundred thousands more emails in their box than the expected.&amp;nbsp; What do you do?&amp;nbsp; Okay, first, take a deep breath.&amp;nbsp; Then go to the headers of the emails and find the originating server.&amp;nbsp; Cross your fingers and hope that they are all the same.&amp;nbsp; If they are you have a simple DOS attack (a single server).&amp;nbsp; You can block that IP in Exchange in "connection filtering", "global accept and deny list configuration".&amp;nbsp; Click "deny" and type in that IP.&amp;nbsp; Then cleanup the mess in the queues as described below.&lt;/P&gt;
&lt;P&gt;If you have mulitiple IPs, you've got a tricker situation to deal with.&amp;nbsp; Now you're under a DDOS (Distributed Denail of Service Attack).&amp;nbsp; If there's only a few, then use the same technique as above (and then cleanup the mess in the queues as described below).&amp;nbsp; But if the attacker is really tricky and you've got thousands, or if they constantly change...even this technique won't work.&amp;nbsp; If that happens, you can't block it yourself.&amp;nbsp; You need to contact your ISP becuase&amp;nbsp;most ISPs have software that can stop a DDOS.&lt;BR&gt;&lt;BR&gt;Cleaning up the mess in the queues&lt;BR&gt;-----------------------------------&lt;BR&gt;Now that the perimeter is secure, it's time to take out the garbage.&amp;nbsp; Between the time the attack started, and you were able to cut it off, several hundred thousand or millions of email may be in the Exchange queues.&amp;nbsp; They will slow your legitimate email to a crawl (not to mention potentially crash your server if you're low on disk space).&amp;nbsp; So you need to deal with this problem promptly as well.&lt;/P&gt;
&lt;P&gt;Again, there is nothing built into Exchange to help you.&amp;nbsp; If you use the built in queue viewer, it will be completely overloaded and will either crash, or take hours to load 100 messages. At that rate it could take months or years to delete them all.&amp;nbsp; You probably don't have that long to wait.&lt;BR&gt;&lt;BR&gt;So instead, download this life saving tool from Microsoft called AQADMCLI.exe.&amp;nbsp; &lt;BR&gt;&lt;A&gt;ftp://ftp.microsoft.com/pss/Tools/Exchange%20Support%20Tools/Aqadmcli/&lt;/A&gt;&lt;BR&gt;This bad boy will delete queue messages that meet a certain specification.&amp;nbsp; For example, running: &lt;BR&gt;delmsg flags=sender,sender=hackeremail@lameaddress.com&lt;BR&gt;will delete all messages send from the email &lt;A href="mailto:hackeremail@lameaddress.com"&gt;hackeremail@lameaddress.com&lt;/A&gt;.&amp;nbsp; There are a ton of other flgs, so you can key on sender, receipient, etc.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;When you run this, the first thing you'll notice is that it appears to do nothing.&amp;nbsp; In actuality, it's running and just doesn't show any output until it's completely done with each queue.&amp;nbsp; If you have a few hundred thousand emails, that will take time.&amp;nbsp; So take&amp;nbsp;a quick coffee break and come back.&amp;nbsp; When you do, your queues should be back under control.&lt;BR&gt;&lt;BR&gt;One caveat...this tool does not seem to work on the "message pending submission" queue.&amp;nbsp; If you've been attacked, and have an autoresponder on the email address (a favorite target for hackers) you will most likely have several hundred thousand emails in this queue as well.&amp;nbsp; What do you do?&amp;nbsp; &lt;BR&gt;1) The messages are stored in a physical folder.&amp;nbsp; for example: c:\program files\MyExchsrvr\mailroot\vsi 1\queue.&amp;nbsp; Make note of that folder.&lt;BR&gt;2) Stop all exchange services (including your antivirus, gfi mail essentials if you run it,etc.)&lt;BR&gt;3) Rename that folder to something else (you can't do this unless ALL services are stopped...so if something interferes, you missed something).&amp;nbsp; Example: "queue_old".&lt;BR&gt;4) Restart all services.&amp;nbsp; Your queue is no longer backed up...because the messages are no longer in it.&lt;BR&gt;5) Now you have to salvage the good messages from the garbage ones.&amp;nbsp; Do a windows search on the .eml files and delete the bad ones, or move the good ones into a seperate folder. (Yes it takes a while...but it's faster than doing nothing and hoping the queues eventually clear out on their own).&lt;BR&gt;6) When you have the good ones, copy them to the \pickup folder.&amp;nbsp; They will be requeued.&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;I hope this helps you out.&lt;/P&gt;
&lt;P&gt;Ian Ippolito&lt;/P&gt;&lt;img src="http://rentacoder.com/CS/aggbug.aspx?PostID=525" width="1" height="1"&gt;</content><author><name>admin</name><uri>http://rentacoder.com/CS/members/admin.aspx</uri></author></entry><entry><title>Technorati post claim:please ignore</title><link rel="alternate" type="text/html" href="http://rentacoder.com/CS/blogs/real_life_it/archive/2006/11/16/521.aspx" /><id>http://rentacoder.com/CS/blogs/real_life_it/archive/2006/11/16/521.aspx</id><published>2006-11-16T16:33:00Z</published><updated>2006-11-16T16:33:00Z</updated><content type="html">&lt;P&gt;Please ignore this posting...it is for Technorati (so the blog can be properly claimed as belonging to Rent a Coder/ Exhedra).&lt;BR&gt;&lt;BR&gt;&lt;A href="http://www.technorati.com/claim/gc9a7usmqb" rel=me&gt;Technorati Profile&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.technorati.com/claim/2nux8kzy7" rel=me&gt;Technorati Profile&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;End post&lt;/P&gt;&lt;img src="http://rentacoder.com/CS/aggbug.aspx?PostID=521" width="1" height="1"&gt;</content><author><name>admin</name><uri>http://rentacoder.com/CS/members/admin.aspx</uri></author></entry><entry><title>SQL Server 2005 Database Mirroring Versus Oracle Data Guard</title><link rel="alternate" type="text/html" href="http://rentacoder.com/CS/blogs/real_life_it/archive/2006/06/01/511.aspx" /><id>http://rentacoder.com/CS/blogs/real_life_it/archive/2006/06/01/511.aspx</id><published>2006-06-01T16:22:00Z</published><updated>2006-06-01T16:22:00Z</updated><content type="html">&lt;P&gt;The new database mirroring feature in SQL Server 2005 SP1 is pretty cool and should help availability.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;But it still has a # of serious drawbacks that prevent it from being as useful as it could be.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;The primary one from my point of view is that you can't "use" the mirror server (well) as a read only server.&amp;nbsp; Yes, there is a workaround from MSFT where you can take snapshots periodically so that you can use it as a read only server. But&amp;nbsp;of course&amp;nbsp;the data is delayed...making is useless to offload read processing for your online system...and relegating it to a delayed reporting server only.&amp;nbsp;&amp;nbsp; You could increase the frequency of the snapshots, but this stops working after a while, becuase if you do it too often, you start delaying access to the&amp;nbsp;data while it's being generated.&amp;nbsp;&amp;nbsp; So it has limited usage.&lt;/P&gt;
&lt;P&gt;Below is an interesting article from Oracle comparing 2005 Database Mirroring to "Oracle Data Guard".&amp;nbsp; It talks about some of the flaws and problems and mirroring, and how Oracle's product (which is more mature) doesn't have these issues. Oracle even has a feature to undo human errors, and many other really useful things that I'd love to see in the next version of SQL Server.&amp;nbsp; &lt;STRONG&gt;Hopefully someone from Microsoft has already read this and is working hard on these things&amp;nbsp;for version #2?&lt;/STRONG&gt;&lt;BR&gt;&lt;BR&gt;&lt;A href="http://www.oracle.com/technology/deploy/availability/htdocs/DataGuardDatabaseMirroring.html"&gt;http://www.oracle.com/technology/deploy/availability/htdocs/DataGuardDatabaseMirroring.html&lt;/A&gt;&lt;BR&gt;&lt;BR&gt;Ian Ippolito&lt;/P&gt;&lt;img src="http://rentacoder.com/CS/aggbug.aspx?PostID=511" width="1" height="1"&gt;</content><author><name>admin</name><uri>http://rentacoder.com/CS/members/admin.aspx</uri></author></entry><entry><title>SQL Server 2005: The new &amp;quot;missing indexes&amp;quot; feature</title><link rel="alternate" type="text/html" href="http://rentacoder.com/CS/blogs/real_life_it/archive/2006/05/11/dm_db_missing_index_group_stats_SQL_Server_2005_The_new_missing_indexes_feature.aspx" /><id>http://rentacoder.com/CS/blogs/real_life_it/archive/2006/05/11/dm_db_missing_index_group_stats_SQL_Server_2005_The_new_missing_indexes_feature.aspx</id><published>2006-05-11T20:33:00Z</published><updated>2006-05-11T20:33:00Z</updated><content type="html">&lt;FONT size=2&gt;
&lt;P&gt;There is an interesting and useful&amp;nbsp;new feature in SQL 2005 where it takes all queries that execute and don't find an optimal index...and &lt;STRONG&gt;records&lt;/STRONG&gt; the information.&amp;nbsp; You can use this information to generate indexes and speed up your performance.&amp;nbsp; These are only held as long as your SQL Server is running...rebooting it will flush out any information stored.&lt;/P&gt;
&lt;P&gt;You get the information from a built in view documented in MSDN: sys.dm_db_missing_index_details&lt;BR&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/ms345405.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms345405.aspx&lt;/A&gt;&lt;BR&gt;&lt;BR&gt;However,&amp;nbsp;sys.dm_db_missing_index_details only take you half of the way home.&amp;nbsp; It lists the&amp;nbsp;pieces of the index to be created, but still requires you to construct the CREATE NONCLUSTERED INDEX SQL yourself.&amp;nbsp; This requires you to learn how to do it (from the above link)...which means understanding the internals of how it works.&amp;nbsp;&amp;nbsp; (According to this 2nd link, the SQL team initially implemented the "whole enchalida" and then later removed it: &lt;A href="http://solidqualitylearning.com/blogs/mike/archive/2005/09/26/1455.aspx"&gt;http://solidqualitylearning.com/blogs/mike/archive/2005/09/26/1455.aspx&lt;/A&gt;&amp;nbsp;)&lt;BR&gt;&lt;BR&gt;The link above&amp;nbsp;argues that this is a good thing, becuase it says that these are&amp;nbsp;just suggestions rather than guarantees (and you still need to verify that you want to truly run each one).&amp;nbsp; If this is true...I would argue back that forcing someone to piece together everything to create the query doesn't reinforce the fact that it's a suggestion.&amp;nbsp; It just aggravates the DBA.&amp;nbsp; The proper way to do this would be to just &lt;STRONG&gt;document&lt;/STRONG&gt; that these are just suggestions in the reference on this stored procedure...not make it harder on the DBA who might have to implement it.&lt;BR&gt;&lt;BR&gt;Anyway...fortunately for you (or unfortunately...depending on your point of view), I've&amp;nbsp;created the following that will create the SQL for you.&amp;nbsp; :) What it does is takes the top 10 queries that the view says would improve most from new indices and creates the SQL statement for them.&amp;nbsp; You can adjust the # returned&amp;nbsp;by changing: SELECT TOP (10) group_handle.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;SELECT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'CREATE NONCLUSTERED INDEX &amp;lt;NewNameHere&amp;gt; ON ' + sys.objects.name + ' ( ' + mid.equality_columns + CASE WHEN mid.inequality_columns IS NULL&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; THEN '' ELSE CASE WHEN mid.equality_columns IS NULL &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; THEN '' ELSE ',' END + mid.inequality_columns END + ' ) ' + CASE WHEN mid.included_columns IS NULL &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; THEN '' ELSE 'INCLUDE (' + mid.included_columns + ')' END + ';' AS CreateIndexStatement, mid.equality_columns, mid.inequality_columns, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mid.included_columns&lt;BR&gt;FROM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.dm_db_missing_index_group_stats AS migs INNER JOIN&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.dm_db_missing_index_groups AS mig ON migs.group_handle = mig.index_group_handle INNER JOIN&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.dm_db_missing_index_details AS mid ON mig.index_handle = mid.index_handle INNER JOIN&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.objects WITH (nolock) ON mid.object_id = sys.objects.object_id&lt;BR&gt;WHERE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (migs.group_handle IN&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (SELECT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TOP (10) group_handle&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.dm_db_missing_index_group_stats WITH (nolock)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ORDER BY (avg_total_user_cost * avg_user_impact) * (user_seeks + user_scans) DESC))&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Sample Output:&lt;BR&gt;CREATE NONCLUSTERED INDEX &amp;lt;NewNameHere&amp;gt; ON MYtable ( [PId], [PersonId], [Hidden] ) INCLUDE ([Id], [BRId], [Amount], [Comment], [OtherDate], [ParentBId]);&lt;BR&gt;&lt;BR&gt;Caveats:&lt;/P&gt;
&lt;P&gt;1) Before adding each one...review it and make sure you really want to add it to your database.&amp;nbsp; Per &lt;BR&gt;&lt;A href="http://solidqualitylearning.com/blogs/mike/archive/2005/09/26/1455.aspx"&gt;http://solidqualitylearning.com/blogs/mike/archive/2005/09/26/1455.aspx&lt;/A&gt;&lt;BR&gt;"These are &lt;STRONG&gt;suggestions&lt;/STRONG&gt;, not absolutes.&amp;nbsp; It still requires a DBA to take a look at the index and decide whether it should be created."&lt;BR&gt;&lt;BR&gt;2) Use this at your own risk.&amp;nbsp; I experienced a few times where I followed the MSDN article's steps exactly (which is what this view is based on) and it wouldn't create the index properly.&amp;nbsp; Example: sometimes the INCLUDE field returned by the system view has text fields in it.&amp;nbsp; But actually using it in the INCLUDE results in this error:&lt;BR&gt;&lt;BR&gt;&lt;FONT size=1&gt;&lt;EM&gt;Column 'TextField' in table 'myTable' is of a type that is invalid for use as included column in an index.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;So test the SQL first on your dev server and make sure it's right.&lt;BR&gt;&lt;BR&gt;3) The generated SQL&amp;nbsp;doesn't do one thing recommended by MSDN.&amp;nbsp;&amp;nbsp;It says "To determine an effective order for the equality columns, order them based on their selectivity; that is, list the most selective columns first."&amp;nbsp; Doing this automatically would take more time than I had to devote to this.&amp;nbsp; So check the order of the SQL produced and if the index fields aren't in the order you'd like, you can change them around.&amp;nbsp; And if anyone wishes to create something that handles this too...then please post it here.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;Ian Ippolito&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://rentacoder.com/CS/aggbug.aspx?PostID=504" width="1" height="1"&gt;</content><author><name>admin</name><uri>http://rentacoder.com/CS/members/admin.aspx</uri></author></entry><entry><title>How SQL Server 2005 &amp;quot;Forced Parameterization&amp;quot; cut ad-hoc query CPU usage by 85%</title><link rel="alternate" type="text/html" href="http://rentacoder.com/CS/blogs/real_life_it/archive/2006/04/30/487.aspx" /><id>http://rentacoder.com/CS/blogs/real_life_it/archive/2006/04/30/487.aspx</id><published>2006-05-01T00:11:00Z</published><updated>2006-05-01T00:11:00Z</updated><content type="html">&lt;P&gt;&lt;STRONG&gt;Is it my imagination or is&amp;nbsp;SQL 2005 running slower?&lt;/STRONG&gt;&lt;BR&gt;&lt;BR&gt;My first impresson&amp;nbsp;with SQL Server 2005 came after installing it on a test server.&amp;nbsp; The test server is a dual processor machine...which&amp;nbsp;was a pretty high powered box back in it's hey-day, but these days it's a commodity server.&amp;nbsp; It runs both SQL Server and IIS,so it is more sensitive to&amp;nbsp;load problems&amp;nbsp;than the production server.&amp;nbsp; This make it a good "canary in a coal-mine", because it detects and helps flush out performance problems early in the process.&lt;/P&gt;
&lt;P&gt;The first thing I noticed with 2005, was that every time I rebooted the machine, the first time I ran a particular web page (which ran queries to SQL ),&amp;nbsp;SQL Server 2005&amp;nbsp;would take a really long time to return the results. In 2000, it would run in about&amp;nbsp;7 seconds, but in 2005 it would timeout the web page (meaning it took at least 10 seconds). But after that first call it would be fine..and would&amp;nbsp;actually run faster than 7 seconds.&amp;nbsp;&amp;nbsp; This weird problem would only occur after every reboot...and would then disappear.&lt;BR&gt;&lt;BR&gt;Since I had hundreds of other tasks that needed to be done for the upgrade, and it only happened on bootup, I simply increased the timeout on the page to&amp;nbsp;15 seconds, and pressed on to other matters.&amp;nbsp; But it stayed in the back of my mind.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;SQL Server 2005: Faster to Execute but Slower to Compile?&lt;/STRONG&gt;&lt;BR&gt;&lt;BR&gt;All versions of SQL Server first compile a query and then execute it.&amp;nbsp; I have seen many times where SQL Server 2005&amp;nbsp;executes queries faster than 2000...but I have also seen many times where it took longer to compile them in the first place.&amp;nbsp; Most likely the two are related...it takes more time to create a better query plan. &lt;BR&gt;&lt;BR&gt;This isn't necessarily a bad thing.&amp;nbsp; In fact, if&amp;nbsp;100% of your workload is stored procedures, it is a great improvement.&amp;nbsp; That is because&amp;nbsp;stored procs&amp;nbsp;are precompiled, so they are only compiled once&amp;nbsp;and executed many times.&amp;nbsp;So if this is your situation, then you will save many multiples of time more than you are giving up.&lt;BR&gt;&lt;BR&gt;BUT...if on the other hand if your workload has a large percentage of ad hoc queries (for example: SQL called from a programming language like ASP.NET), then the situation will be reversed.&amp;nbsp; That is becuase ad hoc queries&amp;nbsp;have to be&amp;nbsp;compiled each and every time they need to be run.&amp;nbsp; And if this is your case, then they will run slower in 2005 than in 2000.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Workarounds&lt;/STRONG&gt;&lt;BR&gt;&lt;BR&gt;In an ideal world this would not be a problem, becuase everything would be written in stored procedures.&amp;nbsp; However, this ideal case doesn't always exist.&amp;nbsp; Some apps use 3rd party middle tier components which preclude the abilty to implement stored procs.&amp;nbsp; Others&amp;nbsp;require the ability to run on multiple vendor databases...meaning they&amp;nbsp;can only use&amp;nbsp;vendor-neutral SQL.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The more typical application&amp;nbsp;is homegrown and designed only for SQL Server, so it doesn't have any of the above problems.&amp;nbsp; These apps typically&amp;nbsp;use stored procs when they can, but but&amp;nbsp;use&amp;nbsp;an adhoc query&amp;nbsp;when they can't.&amp;nbsp; For example,&amp;nbsp;a search screen with many paramaters creates very complex SQL that&amp;nbsp;morphs dramatically from query to query.&amp;nbsp; If you choose one set of options, you might get a simple query, and if you choose others, you may have to INNER or OUTER JOIN to 10-11 additional tables, new fields, WHERE, HAVING, GROUP BY clauses, etc.&amp;nbsp; This easy to code in a declarative language like .NET.&amp;nbsp; But this sort of structure&amp;nbsp;is an exponentially growing nightmare in a true TSQL stored procedure.&amp;nbsp; .NET stored procs are a leg up on TSQL and can make non-set based operations easier to do.&amp;nbsp;&amp;nbsp;But they are little slower than TSQL.&amp;nbsp;&amp;nbsp;More imporantly, all stored procedures (including .NET, TSQL and even dynamic TSQL), cause a fundamental programming problem. Coding them requires maintaining an interface in two places...in the stored proc and in the code.&amp;nbsp; Every change requires two changes rather than one...and every time new functionality is added, this usually requires an interface change.&amp;nbsp; This translates into double the development time, double the chances for bugs and double the work.&lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;Is there another way?&lt;/STRONG&gt;&lt;BR&gt;&lt;BR&gt;But what if there were a way to&amp;nbsp;get:&lt;BR&gt;1) The performance of a TSQL stored proc&amp;nbsp;&lt;BR&gt;2)&amp;nbsp;The power and flexibility of a declarative language&lt;BR&gt;3) That only requires one interface?&lt;/P&gt;
&lt;P&gt;Before you say "Keep dreaming!"...I'd recommend that.you&amp;nbsp;read&amp;nbsp;the book "Good to Great".&amp;nbsp; In that book&amp;nbsp;the author talks about "good" companies being ruled by the "tyranny of the OR" and "great" companies&amp;nbsp;believing&amp;nbsp;in the "genius of the and".&amp;nbsp; For example, a "good" company&amp;nbsp;would believe they could either offer the cheapest price, or good quality but not both.&amp;nbsp; A "great" company would find a way to do both.&lt;BR&gt;&lt;BR&gt;Is it possible to&amp;nbsp;harness the "genuis of the AND" in our database situation?&amp;nbsp; The developers of SQL Server 2005 dared to ask that question.&amp;nbsp;&amp;nbsp;And the result of that is a wonderous creation.&amp;nbsp;&amp;nbsp;The name&amp;nbsp;doesn't do it enough&amp;nbsp;justice and has probably caused it to be one of the least heralded and unheard of features in SQL Server 2005.&amp;nbsp; (Do a search on Google and you'll find perhaps 6 mentions on the entire web...none in Microsoft's marketing.)&amp;nbsp; This little known&amp;nbsp;feature is&amp;nbsp;called "forced parameterization".&amp;nbsp; &lt;BR&gt;&lt;STRONG&gt;&lt;BR&gt;That sounds familiar&lt;/STRONG&gt;&lt;BR&gt;&lt;BR&gt;You may have heard of the term "parmaterization" before. Simple parameterization was SQL 2000's first attempt at finding the "genius of the AND".&amp;nbsp;&amp;nbsp; Genius solutions don't come easily... and this first attempt was a nice step in the right direction but ultimately fell short.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;Basically, SQL would analyze your non stored proc queries and figure out for itself if it could create a query plan on the fly with it.&amp;nbsp; It did this by subbing out some of the values you entered with paramaters that could be reused by similar queries.&amp;nbsp; The only problem was that it was very simple and didn't handle many real life situations (such as an IN clause for excample).&amp;nbsp; Worse, changing the query just a little bit could often "fool" it into not recognizing it as being the same as the original, and it wouldn't "kick in".&amp;nbsp; So while&amp;nbsp;simple&amp;nbsp;parmaterization&amp;nbsp;helped a little, it wasn't enough of&amp;nbsp;a&amp;nbsp;solution to solve the problem. &lt;BR&gt;&lt;BR&gt;Microsoft put the intervening 5 years between 2005 and 2005 to good use and basically revamped&amp;nbsp;this&amp;nbsp;code&amp;nbsp;entirely and pumped it up on steriods.&amp;nbsp;&amp;nbsp;Possibly the&amp;nbsp;incredible increase in CPU processing power in those 5 years led them to&amp;nbsp;believe that their customers would have the horse power to enable such a solution to run effectively.&amp;nbsp; They made it more robust, more dynamic and more powerful, and yet&amp;nbsp;kept it lightning quick.&amp;nbsp;&amp;nbsp;They enabled it to do&amp;nbsp;handle a&amp;nbsp;much larger&amp;nbsp;variety of queries.&amp;nbsp; And most importantly...if it wasn't able to figure out a certain part of the query, it didn't just "give up" (as simple paramaterization did/does)...it just skipped&amp;nbsp;that small portion&amp;nbsp;and paramaterized the rest.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;They called this feature "forced paramaterization".&amp;nbsp;&lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;What does this mean in real life?&amp;nbsp;&lt;/STRONG&gt;&lt;BR&gt;&lt;BR&gt;So what does this mean to you?&amp;nbsp; &amp;nbsp;I ran this test during an offpeak time period, but during which a large # of ad hoc queries are typically run.&amp;nbsp; With simple paramaterization (which is on by default), the result was a 25% average CPU utilization:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.rentacoder.com/CS/photos/general_photo_gallery/picture485.aspx" target=_blank&gt;&lt;IMG src="https://www.rentacoder.com/CS/photos/general_photo_gallery/images/485/original.aspx" border=0&gt;&lt;/A&gt;&lt;BR&gt;&lt;BR&gt;Not bad.&amp;nbsp; So then I&amp;nbsp;turned on forced parameterization.&amp;nbsp; It's done at the database level under "properties" and "options".&amp;nbsp; This was the result:&lt;BR&gt;&lt;BR&gt;&lt;A href="https://www.rentacoder.com/CS/photos/general_photo_gallery/picture486.aspx" target=_blank&gt;&lt;/A&gt;&lt;A href="https://www.rentacoder.com/CS/photos/general_photo_gallery/picture486.aspx" target=_blank&gt;&lt;IMG src="https://www.rentacoder.com/CS/photos/general_photo_gallery/images/486/original.aspx" border=0&gt;&lt;/A&gt;&lt;BR&gt;&lt;BR&gt;At first I thought something had to be wrong.&amp;nbsp;The processor usage dropped to&amp;nbsp;1/5th of what it had been before...just 5%!&amp;nbsp;&amp;nbsp;&amp;nbsp;Had everyone stopped using the database all of a sudden?&amp;nbsp;&amp;nbsp;I paniced for a minute and then settled down&amp;nbsp;once I&amp;nbsp;confirmed that there was no site-wide emergency and things were actually running normally.&amp;nbsp; I&amp;nbsp;watched it very closely&amp;nbsp;for 10 minutes, and "force parameterization" took on query after query like&amp;nbsp;a champ and didn't even break a sweat.&amp;nbsp; The # of cached query plans rose as the CPU kept low.&amp;nbsp; Clearly the compiling of the ad hoc queries was a bottleneck before-hand and "forced parameterization" wiped out that bottleneck like a truck running over an ice cream cone!&lt;BR&gt;&lt;BR&gt;And the best thing about it is that it tends to get better with time.&amp;nbsp; As more queries run, more get cached, and your server runs faster and faster.&amp;nbsp; By removing that compiling bottleneck your ad-hoc queries fly!&lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;Is there a Downside?&lt;BR&gt;&lt;/STRONG&gt;&lt;BR&gt;Genius doesn't come easy.&amp;nbsp; There are some cases where even forced paramaterization doesn't work.&amp;nbsp;&amp;nbsp;It may have a tendency to make your queries not use indexed views (if you are using them).&amp;nbsp; And now that your ad hoc queries have the pre-compilation powers of stored procs, they have&amp;nbsp;the downsides&amp;nbsp;of that power as well.&amp;nbsp; Particularly sometimes a compiled plan for a typical situation doesn't work right for an outlier situation (or vice versa) and can effect performance.&amp;nbsp; But this is a rare situation and can be handled on a case by case basis if and when it happens.&amp;nbsp; You can read the help files on the feature for more information on the pros and cons of forced parameterization and decide for yourself when it might or might not be appropriate for you. &lt;BR&gt;&lt;BR&gt;But for us, it has been a godsend and we will continue to use it in production.&amp;nbsp; And I can't wait to see how this feature expands in the next release.&lt;BR&gt;&lt;BR&gt;Kudos to the SQL Server 2005 team on this little talked about but great feature.&lt;BR&gt;&lt;BR&gt;Links:&lt;BR&gt;Here is a good blog entry from a Microsoft SQL Server developer named &lt;U&gt;&lt;FONT color=#0000ff&gt;Cihangir Biyikoglu&lt;/FONT&gt;&lt;/U&gt;&amp;nbsp;on the feature:&lt;BR&gt;&lt;A href="http://blogs.msdn.com/cbiyikoglu/archive/2005/11/03/488920.aspx"&gt;http://blogs.msdn.com/cbiyikoglu/archive/2005/11/03/488920.aspx&lt;/A&gt;&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;Ian Ippolito&lt;/P&gt;&lt;img src="http://rentacoder.com/CS/aggbug.aspx?PostID=487" width="1" height="1"&gt;</content><author><name>admin</name><uri>http://rentacoder.com/CS/members/admin.aspx</uri></author></entry><entry><title>A &amp;quot;must use&amp;quot; SQL Server 2005 Feature-ROW_NUMBER()</title><link rel="alternate" type="text/html" href="http://rentacoder.com/CS/blogs/real_life_it/archive/2006/04/29/481.aspx" /><id>http://rentacoder.com/CS/blogs/real_life_it/archive/2006/04/29/481.aspx</id><published>2006-04-29T15:30:00Z</published><updated>2006-04-29T15:30:00Z</updated><content type="html">&lt;FONT size=2&gt;
&lt;P&gt;If you run your SQL Server as the back end for a website, then paging is one of the most common things that you do.&amp;nbsp; In SQL Server 2000, doing this paging was complicated and resource intensive.&amp;nbsp; But in 2005, there is a new feature called ROW_NUMBER than you can combine with BETWEEN that will give you orders of magnitude improvement. &lt;BR&gt;&lt;BR&gt;SQL Server Processor utlization before ROW_NUMBER (Last Saturday):&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.rentacoder.com/CS/photos/general_photo_gallery/picture482.aspx" target=_blank&gt;&lt;IMG src="https://www.rentacoder.com/CS/photos/general_photo_gallery/images/482/original.aspx" border=0&gt;&lt;/A&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;SQL Server Processor utlization after ROW_NUMBER (the cutover is plainly visible at around 1:30 AM this Saturday):&lt;BR&gt;&lt;A href="https://www.rentacoder.com/CS/photos/general_photo_gallery/picture483.aspx" target=_blank&gt;&lt;IMG src="https://www.rentacoder.com/CS/photos/general_photo_gallery/images/483/original.aspx" border=0&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.rentacoder.com/CS/photos/general_photo_gallery/picture482.aspx" target=_blank&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;When pushed to production,&amp;nbsp;he CPU&amp;nbsp;INSTANTANEOUSLY dropped from an average of about 50% CPU toabout &amp;nbsp;25% CPU, and stayed there!&amp;nbsp; That's a&amp;nbsp;50% reduction in CPU just from one query change!&amp;nbsp; If you run a website with SQL Server, this should be one of the FIRST things you look at after you upgrade.&lt;/P&gt;
&lt;P&gt;Here are the best sources I found on how to implement it:&lt;BR&gt;&lt;BR&gt;1) &lt;A href="http://sqljunkies.com/WebLog/amachanic/archive/2004/11/03/4945.aspx"&gt;http://sqljunkies.com/WebLog/amachanic/archive/2004/11/03/4945.aspx&lt;/A&gt;&lt;BR&gt;&lt;BR&gt;Adam Mechanic ran some tests on the new ROW_NUMBER feature using paging and shows dramatic results.&amp;nbsp; The SQL 2000 style SQL returns a cost of 5,516.&amp;nbsp; The new 2005 style SQL returns a cost of 0.202!&lt;BR&gt;&lt;BR&gt;SQL 2000 style:&lt;BR&gt;&lt;BR&gt;&lt;EM&gt;SELECT x.SomewhatLargeString&lt;BR&gt;FROM (&lt;BR&gt;SELECT TOP 20010 A.SomewhatLargeString, COUNT(*) AS TheCount&lt;BR&gt;FROM #BigTableOfStrings A&lt;BR&gt;JOIN #BigTableOfStrings B ON B.SomewhatLargeString &amp;lt;= A.SomewhatLargeString&lt;BR&gt;GROUP BY A.SomewhatLargeString&lt;BR&gt;ORDER BY A.SomewhatLargeString ) x&lt;BR&gt;WHERE x.TheCount BETWEEN 20001 AND 20010&lt;BR&gt;&lt;/EM&gt;&lt;BR&gt;SQL 2005 Style:&lt;BR&gt;&lt;BR&gt;&lt;EM&gt;SELECT x.SomewhatLargeString,x.TheCount&lt;BR&gt;FROM (&lt;BR&gt;SELECT TOP 20010 A.SomewhatLargeString, ROW_NUMBER() OVER(ORDER BY A.SomewhatLargeString) AS TheCount&lt;BR&gt;FROM #BigTableOfStrings A&lt;BR&gt;ORDER BY A.SomewhatLargeString) x&lt;BR&gt;WHERE x.TheCount BETWEEN 20000 AND 20010&lt;BR&gt;&lt;/EM&gt;&lt;BR&gt;When you look at any new queries implementing ROW_NUMBER with BETWEEN, you may first wonder why there are 2 queries (the base query nested inside a top level query).&amp;nbsp; I did too.&amp;nbsp; I wondered, "Why not combine it into one query"?&amp;nbsp; The reason was clarified to me in a support ticket to Microsoft while trying to do this with a SELECT DISTINCT subquery.&amp;nbsp; By design, SQL Server&amp;nbsp;cannot referenced an aliased field using a WHERE clause (which is where the BETWEEN is located).&amp;nbsp; And you can't reference the "actual" field name for ROW_NUMBER(), becuase there&amp;nbsp;is no&amp;nbsp;actual field name.&amp;nbsp; So to work around it, the solution is to wrap the query in a top level query that pull at least the aliased field...and in that process, the field now becomes the "actual" field name at the top level and can be referenced by the WHERE/BETWEEN.&amp;nbsp; If that doesn't make sense...you don't need to understand it to use it...just copy the sytax above and USE IT.&lt;/P&gt;
&lt;P&gt;The other tip is to also&amp;nbsp;use the TOP setting in the inner select and set it to the highest # in your range of rows.&amp;nbsp; It will speed up the query and you don't need any rows past that anyway, so it's a "free boost".&lt;BR&gt;&lt;BR&gt;2) &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/html/sql_05TSQLEnhance.asp"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql90/html/sql_05TSQLEnhance.asp&lt;/A&gt;&lt;BR&gt;&lt;BR&gt;Microsoft's information&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;Ian Ippolito&lt;/P&gt;&lt;img src="http://rentacoder.com/CS/aggbug.aspx?PostID=481" width="1" height="1"&gt;</content><author><name>admin</name><uri>http://rentacoder.com/CS/members/admin.aspx</uri></author></entry><entry><title>Lessons learned from upgrading from SQL 2000 to SQL Server 2005</title><link rel="alternate" type="text/html" href="http://rentacoder.com/CS/blogs/real_life_it/archive/2006/04/28/477.aspx" /><id>http://rentacoder.com/CS/blogs/real_life_it/archive/2006/04/28/477.aspx</id><published>2006-04-28T19:48:00Z</published><updated>2006-04-28T19:48:00Z</updated><content type="html">&lt;P&gt;We recently upgraded from SQL Server 2000 to SQL 2005.&amp;nbsp; We simultaneously did a serious upgrade of the hardware.&amp;nbsp; The old server was a dual processor 32 bit machine.&amp;nbsp; The new server is&amp;nbsp;quad processor 64 bit machine.&amp;nbsp; The dual core PLUS hyperthreading makes it appear as 16 virtual processors to the&amp;nbsp;operating sytem:&lt;BR&gt;&lt;BR&gt;&lt;A href="https://www.rentacoder.com/CS/photos/general_photo_gallery/picture484.aspx" target=_blank&gt;&lt;IMG src="https://www.rentacoder.com/CS/photos/general_photo_gallery/images/484/original.aspx" border=0&gt;&lt;/A&gt;&lt;BR&gt;&lt;BR&gt;Yet despite throwing tremendous amounts of hardware for SQL Server to use, we experienced terrible performance after upgrading to 2005.&amp;nbsp;&amp;nbsp; Getting the performance to the level where it was acceptable took literally&amp;nbsp;weeks of work.&amp;nbsp; Detailed knowledge of SQL Server internals was gathered by porting over&amp;nbsp;release notes, MSDN articles, personal blogs written by Microsoft SQL Server developers, 3rd party website and the help of several different people in Microsoft support.&amp;nbsp; This blog entry was created so that anyone else going through the same process and experiencing similar problems would have a road map to follow:&lt;BR&gt;---------------------------------------------------------&lt;BR&gt;&lt;BR&gt;1) INSTALL Service Pack 1.&amp;nbsp; Now that's it available...this is a "no brainer".&amp;nbsp; You will save yourself weeks&amp;nbsp;of aggravation that&amp;nbsp;those of us unfortunate&amp;nbsp;who migrated pre-SP1 experienced.&amp;nbsp; &lt;A href="http://support.microsoft.com/kb/916940/"&gt;From the enahancement list:&lt;/A&gt;&lt;BR&gt;&lt;BR&gt;&lt;EM&gt;"Several performance problems were fixed in the Database Engine query optimizer. These changes improve the upgrade process for third-party products that use SQL Server as their back-end database when you upgrade from SQL Server 2000 to SQL Server 2005."&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;There are also some very necessary fixes such as:&lt;/P&gt;
&lt;P&gt;a)&amp;nbsp;pre SP1, the&amp;nbsp;database maintainence tasks for deleting .TRN and .BAK files didn't offer the ability to&amp;nbsp;delete recursively on subfolders (as it used to in 2000).&amp;nbsp; So it was a step backwards, and&amp;nbsp;without it, sites with more than 1 database have to create a manual step for EVERY database added.&amp;nbsp; This added alot of unnecessary administrative overhead. This oversight&amp;nbsp;was restored/fixed in SP1.&lt;BR&gt;&lt;BR&gt;b) DTA bomb outs: The Database Tuning&amp;nbsp;Advisor would bomb out quite easily, and we were forced to do thing like loading workloads a small piece at a time and seperating runs for tables from indexed views and limiting the time it could run.&amp;nbsp; Thankfully, this has been fixed.&lt;/P&gt;
&lt;P&gt;2) Migration:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;MANUALLY Update Statistics.&amp;nbsp; &lt;A href="http://msdn2.microsoft.com/en-us/library/ms144267(SQL.90).aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms144267(SQL.90).aspx&lt;/A&gt;&lt;BR&gt;&lt;BR&gt;&lt;EM&gt;sp_MSForEachTable 'Update Statistics ? WITH FULLSCAN'&lt;/EM&gt;&lt;BR&gt;&lt;BR&gt;Yes, your database&amp;nbsp;is probably set&amp;nbsp;for "auto update statistics" and the English meaning of "auto" means&amp;nbsp;it's a substitude&amp;nbsp;having to do&amp;nbsp;something manually.&amp;nbsp; But just becuase the feature is named that way, doesn't mean that it acts that way.&amp;nbsp; For the first few hours after migration, we thought we might be able to get away without updating stats.&amp;nbsp;So as&amp;nbsp;a test I ran the same query thousands of times.&amp;nbsp; But the "auto" never seemed to kick in.&amp;nbsp; Maybe the "auto"&amp;nbsp;was a Yugo because the performance was dismal.&amp;nbsp; So I took the hit and ran stats (it takes about 13-15 hours on our database due to the size...even with all of our hardware)..and what a difference it made.&amp;nbsp; Throughput sped up on the query about 3x.&amp;nbsp;&amp;nbsp;&lt;BR&gt;&lt;BR&gt;Why is this necessary?&amp;nbsp;The engine for 2005 is so different than it was back in 2000 that the&amp;nbsp;2000 stats are of little use.&amp;nbsp; So this should be the first thing you do after upgrading to SP1...even if it increases your down time...it is worth it!&lt;BR&gt;
&lt;LI&gt;Rebuild your indices (optional...but highly recommended):&lt;BR&gt;&lt;BR&gt;Microsoft advertises SQL Server's advantage over Oracle as the fact that it is&amp;nbsp;self-tuning.&amp;nbsp; This is&amp;nbsp;"compatively" true,&amp;nbsp;if you compare it to Oracle (which seems like a prima-donna compared to SQL Server).&amp;nbsp;&amp;nbsp;But it's not "absolutely" true.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;Some people are not aware that things like indices degrade with every INSERT/UPDATE and fragment.&amp;nbsp; This is just like disk fragmentation...it slows down your server more and more over time until performance becomes unacceptable.&amp;nbsp; So since your database is down for the migration, it's also a good time to rebuild them.&amp;nbsp; Yes you can do a reorganization/defrag without taking it online, but this process is not as thorough and can't remove all types of fragmentation.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;But what about "online rebuilding of indices" in 2005...you don't really need to take it offline to build it anymore do you?&amp;nbsp; Well, the answer to that you can see in another of my blog postings.&amp;nbsp; Like just say that real world databases are almost guaranteed to have a large # of tables that online rebuilding doesn't yet handle (maybe in SQL Server 2010)?&amp;nbsp; Anyway, my advice is that since you're already offline to do the migration, do this offline too and get&amp;nbsp;a fresh start with your indexes.&lt;BR&gt;
&lt;LI&gt;Update your usage stats.&amp;nbsp;&amp;nbsp;&lt;BR&gt;&lt;BR&gt;&lt;EM&gt;DBCC UPDATEUSAGE&amp;nbsp; &lt;BR&gt;&lt;/EM&gt;&lt;BR&gt;This is a little trick that is on MSDN.&amp;nbsp; It avoids having your statistics messed up and performance suffering becuase of it..&lt;BR&gt;&lt;BR&gt;&lt;EM&gt;"In earlier versions of SQL Server, the values for the table and index row counts and page counts can become incorrect. To correct any invalid row or page counts, we recommend that you run DBCC UPDATEUSAGE on all databases following upgrade."&lt;BR&gt;&lt;/EM&gt;&lt;BR&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/ms144267(SQL.90).aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms144267(SQL.90).aspx&lt;/A&gt;&lt;BR&gt;
&lt;LI&gt;Update the compatibility level.&lt;BR&gt;&lt;BR&gt;I know you're thinking "Wait a minute.&amp;nbsp; I went through all the work and stress of upgrading this thing to 2005 and it's up and running, and you're telling me it isn't truly 2005 compatible yet"?&amp;nbsp; The answer is "Believe it or not...yes".&amp;nbsp; &lt;BR&gt;&lt;BR&gt;It actually makes sense (although it would be nice to know about this in the upgrade wizard, rather than having to fish it out indirectly).&amp;nbsp;&amp;nbsp;But your upgraded database is set to be 2000 compatible, and won't support many of the cool new 2005 features such as Management views, etc. So you need to upgrade it:&lt;BR&gt;&lt;BR&gt;&lt;EM&gt;sp_dbcmptLevel &amp;lt;dbname&amp;gt;,90&amp;nbsp;&lt;BR&gt;&lt;/EM&gt;(where 90=sql 2005)&lt;BR&gt;&lt;BR&gt;A word of warning...Microsoft doesn't upgrade the compatibility for a reason.&amp;nbsp; It's becuase query behavior changes in 2005 on some things.&amp;nbsp; So check out the 2005 documentation on the differences, update your apps for any changes (you've probably already done this before upgrading), and then you're ready to do the above.&lt;BR&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;3) Operating System settings&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;If you're running a quad processor machine&amp;nbsp;and&amp;nbsp;installed Windows 2003&amp;nbsp;x64 Standard Edition (even with SP1), then the operating system supports your 4 processors fully, right?&amp;nbsp; WRONG! &lt;BR&gt;&lt;BR&gt;If this is your situation, you need to buy an upgrade license to R2 right away.&amp;nbsp; Most people think that R2 is an excuse by Microsoft to charge you for a&amp;nbsp;bunch of stuff that knowledgeable people&amp;nbsp;can already download for free off of the internet.&amp;nbsp; That is true for a majority of the features. &lt;BR&gt;&lt;BR&gt;However, there is a legitimate reason to upgrade to R2 that makes it worth paying for, that you can't get via a free download.&amp;nbsp; Pre R2 supports 4 processors...but not SYMETRIC processing.&amp;nbsp; What this means is that&amp;nbsp;if you&amp;nbsp;have a workload, pre R2&amp;nbsp;will fill up your first cpu until it's bursting at the seams at 100% (leaving 2 through 4 compeltely idle).&amp;nbsp; Only then will it go to #2 (leaving 3 and 4 idle).&amp;nbsp; Then when it's bursting at the seams, it will go to #3 and so on.&amp;nbsp; This is extremely inefficient.&amp;nbsp; It's like buying a high performance race car, and driving it with a manual transmission and wondering why it fells like your Honda Accord. And since SQL Server accesses the processors through the OS (it doesn't have the ability to access hardware directly)...your SQL Server is doing the same thing.&lt;BR&gt;&lt;BR&gt;R2 on the other hand supports symetric processing.&amp;nbsp; What this means is that the workload will be distributed evenly on all 4 processors, keeping them smoothly running.&amp;nbsp;&amp;nbsp; &lt;BR&gt;&lt;BR&gt;So if you have 4 processors, UPGRADE TODAY. &lt;BR&gt;&lt;BR&gt;Incidentally, this was hard won information.&amp;nbsp; It took two seperately opened incidents and talking to 4 different Microsoft people before I was directed to a very helpful person in the OS team who knew and explained the difference and the consequences.&amp;nbsp; &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;4) Hardware&lt;BR&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The cool new hyperthreading on your expensive new box is advertised by Intel as increasing your performance.&amp;nbsp; And that "could" be true.&amp;nbsp; It also could be true that it is making your system run like a dog.&amp;nbsp; Here are some examples of the latter:&lt;BR&gt;&lt;BR&gt;&lt;A href="http://blogs.msdn.com/slavao/archive/2005/11/12/492119.aspx"&gt;http://blogs.msdn.com/slavao/archive/2005/11/12/492119.aspx&lt;/A&gt;&lt;BR&gt;&lt;BR&gt;The only way to know for sure, is to test your server under load with it on and off and see the difference.&amp;nbsp; For us, hyperthreading works...it gave us a 10%&amp;nbsp;boost:&lt;BR&gt;&lt;BR&gt;&lt;A href="https://www.rentacoder.com/CS/blogs/real_life_it/archive/2006/04/18/SQL_Server_2005_performance_testing_with_hyperthreading_and_MAX_DOP.aspx"&gt;https://www.rentacoder.com/CS/blogs/real_life_it/archive/2006/04/18/SQL_Server_2005_performance_testing_with_hyperthreading_and_MAX_DOP.aspx&lt;/A&gt;&lt;BR&gt;&lt;BR&gt;But if you're having performance problems, you need to check this out for yourself.&lt;BR&gt;&amp;nbsp; 
&lt;LI&gt;Adjust MAXDOP (Max Degree of parrellism) for your # of processors.&amp;nbsp;&lt;BR&gt;&lt;BR&gt;If you're upgrading from an older non-hyperthreaded/non-dual core machine to one that is...this is important for you.&lt;BR&gt;&lt;BR&gt;MAXDOP controls the maximum # of "processors" that SQL Server uses in a parallel query.&amp;nbsp; The "processors" are actually virtual processors, because you may be like us and have 4 processors, but when you add in hypthreading (x2) and dual core (x2 again) SQL Server considers it 16 "processors".&lt;BR&gt;&lt;BR&gt;If you set MAXDOP to a #, SQL Server will only use that # of processors in parralel queries.&amp;nbsp; By deafult, SQL Server sets MAXDOP=0 which means it will be set to wahtever # of processors SQL Sever can see.&amp;nbsp; On your old machine, this was a good setting, because MAXDOP= the # of physical processors (which&amp;nbsp;was the old recommended practice).&amp;nbsp; &lt;BR&gt;&lt;BR&gt;However, now that your new machine has dual core and hyperthreading, that is no longer what you want.&amp;nbsp; Why is this an issue?&amp;nbsp; Don't you want to maximize the use of your processors?&amp;nbsp;&amp;nbsp;The answer is "no".&amp;nbsp; That is because there is overhead in every extra processor used in a parrallel query.&amp;nbsp; Add a small # and it makes the query run faster.&amp;nbsp; But as you continue adding them, the overhead builds up, and eventually can cause the query to run slower than if you had just left it running on a&amp;nbsp;single processor.&lt;BR&gt;&lt;BR&gt;The old/traditional advice was to set MAXDOP=# of physical processors and ignore hyperthreading:&amp;nbsp; &lt;A href="http://blogs.msdn.com/sqltips/archive/2005/09/14/466387.aspx"&gt;http://blogs.msdn.com/sqltips/archive/2005/09/14/466387.aspx&lt;/A&gt;&lt;BR&gt;&lt;BR&gt;However, nowhere in that blog or anywhere on the net could I find what to do about dual core processors.&amp;nbsp; Should those be counted and added to MAXDOP or not?&amp;nbsp; I ahd to&amp;nbsp;call Microsoft support&amp;nbsp;to get the&amp;nbsp;updated answer.&amp;nbsp; I was told that the new rule is that MAXDOP should be set to the # of "physical sockets".&amp;nbsp; And&amp;nbsp;each core is considered a physical socket.&amp;nbsp; So for us we have 4 CPUs x2 (because they are dual core)=8 physical sockets.&amp;nbsp; So our proper setting is&amp;nbsp;MAXDOP=8.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;This little jewel was hard won information...so I hope it helps you.&lt;BR&gt;
&lt;LI&gt;Memory: Beef it up!&lt;BR&gt;&lt;BR&gt;Beefing up your memory is always a good idea.&amp;nbsp; But there is an even more pressing reason to do it if you have a multi gigabyte database. &lt;BR&gt;&lt;BR&gt;As of this moment there is a bug/feature (even&amp;nbsp;after installing&amp;nbsp;post SP1) in SQL Server 2005 backups.&amp;nbsp; When you do your nightly full backup and do a "verify" on it, it will drain memory while it is doing it.&amp;nbsp; A Microsoft tech theorized that perhaps it was loading the entire file&amp;nbsp;into memory.&amp;nbsp; In our case, we have 16GB of memory and a 60GB database.&amp;nbsp; So the math tells you already what happens every night.&amp;nbsp; All the memory is sucked out...down to the last MB,&amp;nbsp;and eventually&amp;nbsp;forces SQL Server to give up memory that it has claimed (flushing caches, etc.)&amp;nbsp; It takes a good 45 minutes to run, even on our high speed machine, so during this time, users are treated to timeouts and pages that take extremely long to run (if at all).&lt;BR&gt;&lt;BR&gt;The workaround was to turn off "verify" and copy it to a 2nd system and verify it there.&amp;nbsp; Unfortunately,&amp;nbsp;for some reason the copy process also causes a&amp;nbsp;similar drain (which Microsoft is looking at right now). So&amp;nbsp;currently...both the bug/feature and the workaround cause the same problem. &lt;BR&gt;&lt;BR&gt;So the current temporary solution is&amp;nbsp;that&amp;nbsp;the database has several extra GIGs of memory installed and SQL Server to set to not use it.&amp;nbsp; This helps allevaite the effects of the drain to a more tolerable 10-15 minutes (rather than 45).&amp;nbsp; &lt;BR&gt;&lt;BR&gt;Long term we are waiting on a true solution.&lt;BR&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Software&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Tune with DTA--but carefully.&amp;nbsp;&lt;BR&gt;&lt;BR&gt;Database Tuning Advisor&amp;nbsp;will run on&amp;nbsp;a trace of your production workloads and automatically tune the indices and stats so that it will be optimized for your situation.&amp;nbsp; This&amp;nbsp;is a great feature and you should be running this often.&lt;BR&gt;&lt;BR&gt;But HOW you've run it has changed (at least for us) in 2005.&amp;nbsp;&amp;nbsp;&amp;nbsp;If you run a 24/7 environment (such as an international web site like we do) then it will change for you as well. &lt;BR&gt;&lt;BR&gt;In SQL Server 2000 we could run the tuning advisor on the&amp;nbsp;database directly &amp;nbsp;(to get recommendations only...not actually apply them.&amp;nbsp; That would be done later.).&amp;nbsp; We could do this at any time and it wouldn't lock out people or cause any problems other than a little more load.&amp;nbsp; But that is no longer the case in 2005.&amp;nbsp;We tried it 3 times, and all 3 times it&amp;nbsp;started causing deadlocks and all sorts of problems.&amp;nbsp;&amp;nbsp;On two ocassions, just stopping DTA didn't fix the problem...and we had to physically reboot the server to release the locks.&amp;nbsp; A 24/7&amp;nbsp;database can't be taken down every time&amp;nbsp;you need to run DTA.&lt;BR&gt;&lt;BR&gt;There is a new remote tuning option in DTA where you setup a 2nd SQL server and it will copy&amp;nbsp; the table structure of your production database&amp;nbsp;to a 2nd database and tune it from there.&amp;nbsp; This not only helps prevent overloading your production server, but it stops the locking while the process is running...at least&amp;nbsp;in theory.&amp;nbsp; Again, real life practice showed something else.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;We tried it several times during off-peak hours, and a few times we got it to work okay.&amp;nbsp; However most of the time it would also produce timeouts for users while copying the tables.&amp;nbsp; (We have a ticket open with MSFT on this issue).&lt;BR&gt;&lt;BR&gt;So, the workaround is that we copy a backup to the 2nd server and then run DTA on it there, and take the recommendations and run them on production during off peak hours.&amp;nbsp; It isn't ideal, because copying a multi GB file even over a GB network is slow, and it really slows down the # of iterations of DTA we can run.&amp;nbsp;&amp;nbsp; However it is better than not running DTA at all, so perhaps this idea will be useful to you.&lt;BR&gt;&lt;BR&gt;--------------------------------------&lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;Side note: IMPORTANT BAD side effect of DTA bombouts that you should know about!&amp;nbsp; &lt;BR&gt;&lt;/STRONG&gt;&lt;BR&gt;DTA&amp;nbsp;creates hypothetical&amp;nbsp;statistics and indices on your database and then uses them to make its recomendations.&amp;nbsp; When it's done it cleans them out.&amp;nbsp; However if DTA bombs out (as it did often pre SP1), this can cause a problem.&amp;nbsp; It means bogus/hypoetical indices and stats will be on your production database.&amp;nbsp; Any query can come in and pick one of them instead of your good/real indices and stats and your performance will suffer becuase of it.&amp;nbsp; Also, they will slow down your stats refreshing and index defragging jobs unnecessarily.&lt;BR&gt;&lt;BR&gt;A MSFT tech working on another issue found&amp;nbsp;turned us onto this and we found over 4000&amp;nbsp;of these&amp;nbsp;dead objects in our database.&amp;nbsp;&amp;nbsp;(Apparently pre SQL 2000 SP4 or SP5 there was another flaw that would cause these objects to accumulate as well...and this database is old enough to have been around back then).&amp;nbsp; And sure enough,&amp;nbsp;some were being used by queries and producing sub-optimal plans and&amp;nbsp;contributing to bad performance.&lt;BR&gt;&lt;BR&gt;So&amp;nbsp;if DTA crashes, makes&amp;nbsp;sure you clean up its mess.&amp;nbsp;Examples:&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#0000ff size=2&gt;drop&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;statistics&lt;/FONT&gt;&lt;FONT size=2&gt; [YourTable]&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;.&lt;/FONT&gt;&lt;FONT size=2&gt;[hind_88491494_3A_2A_8A] &lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;drop&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;statistics&lt;/FONT&gt;&lt;FONT size=2&gt; [YourTable]&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;.&lt;/FONT&gt;&lt;FONT size=2&gt;[hind_88491494_1A_4A_8A]&amp;nbsp;&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;This is&amp;nbsp;perhaps another reason to optimize on a 2nd machine and not the production server.&amp;nbsp; Here is MSDN&amp;nbsp;info on deleting hypothetical indices:&lt;BR&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/ms190172.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms190172.aspx&lt;/A&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;LI&gt;If you use SQL Server as the back end for a website that offers users the ability to page through data,&amp;nbsp;swap out&amp;nbsp;your inefficient SQL Server 2005 paging queries for the new ROW_NUMBER() feature.&amp;nbsp; Doing this on the main query used on the site dropped processor utlization an eye popping 50%!&amp;nbsp; Details are here: &lt;BR&gt;&lt;A href="/CS/blogs/real_life_it/archive/2006/04/29/481.aspx"&gt;http://rentacoder.com/CS/blogs/real_life_it/archive/2006/04/29/481.aspx&lt;/A&gt;&lt;BR&gt;
&lt;LI&gt;Strongly consider "Forcing Paramaterization"&lt;BR&gt;&lt;BR&gt;This&amp;nbsp;this new 2005 feature cut CPU performance on an adhoc query load by 1/5th.&amp;nbsp; It's almost too good to believe and is probably the most underhyped yet best feature in SQL Server 2005 (far better than the ubiquitously marketed&amp;nbsp;"online index rebuilding" feature which don't stand up to real life situations):&lt;BR&gt;Details are here:&lt;BR&gt;&lt;A href="https://www.rentacoder.com/CS/blogs/real_life_it/archive/2006/04/30/487.aspx"&gt;https://www.rentacoder.com/CS/blogs/real_life_it/archive/2006/04/30/487.aspx&lt;/A&gt;&lt;BR&gt;
&lt;LI&gt;5/26/2006:&amp;nbsp; &lt;BR&gt;&lt;BR&gt;If your multi processor machine is not working as quickly as it should...strongly consider installing the just released SQL Server Cumulative hotfix package which fixes this issue: &lt;BR&gt;&lt;EM&gt;"Processing performance on multiprocessor computers is somewhat slower than expected."&lt;BR&gt;&lt;/EM&gt;&lt;A href="http://support.microsoft.com/kb/918222"&gt;http://support.microsoft.com/kb/918222&lt;/A&gt;&lt;BR&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Ian Ippolito&lt;A href="http://technorati.com/tag/rentacoder" rel=tag&gt;&lt;/A&gt;&lt;/P&gt;&lt;img src="http://rentacoder.com/CS/aggbug.aspx?PostID=477" width="1" height="1"&gt;</content><author><name>admin</name><uri>http://rentacoder.com/CS/members/admin.aspx</uri></author></entry><entry><title>SQL Server 2005 Service Pack 1: The good news and the bad news</title><link rel="alternate" type="text/html" href="http://rentacoder.com/CS/blogs/real_life_it/archive/2006/04/26/468.aspx" /><id>http://rentacoder.com/CS/blogs/real_life_it/archive/2006/04/26/468.aspx</id><published>2006-04-27T03:01:00Z</published><updated>2006-04-27T03:01:00Z</updated><content type="html">&lt;P&gt;SQL Server 2005&amp;nbsp;Service Pack 1 (SP1)includes many &lt;A href="http://support.microsoft.com/?kbid=913090"&gt;bug fixes&lt;/A&gt; and &lt;A href="http://support.microsoft.com/kb/916940/"&gt;improvements&lt;/A&gt; to the core SQL Server 2005 engine.&amp;nbsp; Given the poor performance we had been experiencing after upgrading from SQL Server 2000 (despite simultaneously doubling the processors, tripling the memory, increasing hard drive speed, etc.) I was excited to try this out.&amp;nbsp; This quote from the above URL looked especially promising:&lt;BR&gt;&lt;BR&gt;&lt;EM&gt;"Several performance problems were fixed in the Database Engine query optimizer. These changes improve the upgrade process for third-party products that use SQL Server as their back-end database when you upgrade from SQL Server 2000 to SQL Server 2005."&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;What happened?&lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;The good:&lt;BR&gt;&lt;/STRONG&gt;&lt;BR&gt;Via an off-the cuff estimate, it appears that things are indeed running slightly better.&amp;nbsp; The processor was averaging around 92% CPU usage on Monday and dropped to 84% today after installation of SP1.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;However, when put into perspective...the old SQL 2000 server (with half the machine, 1/3 the memory etc) was running at 80-90% CPU.&amp;nbsp; So&amp;nbsp;this is just one small step in the final journey.&amp;nbsp; But nonetheless...it's a step in the right direction.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The bad/ugly:&lt;/STRONG&gt;&lt;BR&gt;&lt;BR&gt;Now for the bad news.&amp;nbsp; After installing SP1 I thought everything worked fine.&amp;nbsp; Today there were some problems with a replicated table.&amp;nbsp; After probing here is what greeted me in replication monitor: &lt;/P&gt;
&lt;P&gt;&lt;A href="/CS/photos/general_photo_gallery/picture469.aspx" target=_blank&gt;&lt;/A&gt;&lt;A href="/CS/photos/general_photo_gallery/images/469/original.aspx" target=_blank&gt;&lt;IMG src="/CS/photos/general_photo_gallery/images/469/original.aspx" border=0&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;A complete 100% failure of all replication on every single publiccation and subscription to every single database.&amp;nbsp; I didn't realize right away, because database mail was not working properly pre SP1 on x64 machines.&amp;nbsp; There was a KB article on how to get around this bug, but it&amp;nbsp;didn't work (I had a ticket open for it).&amp;nbsp; Now it's a moot point&amp;nbsp;because with SP1 it's been fixed!&amp;nbsp; Yes...I will now enjoy&amp;nbsp;plenty of warning when future service packs break things. Goody! :)&lt;BR&gt;&lt;BR&gt;On this one it's tricky to figure out what the cause is.&amp;nbsp; The normal history and log menus are completely disabled in replication monitor so I can't even see what the error/problem is.&amp;nbsp; Arrrghh.&amp;nbsp; Time to open&amp;nbsp;another ticket...sigh.&amp;nbsp; (I opened 3 previously today on SQL Server...and it's only 11:19PM so that makes 4 in one day.&amp;nbsp;&amp;nbsp; Can someone remind me again why I'm paying Microsoft for this product and not the other way around?)&lt;/P&gt;
&lt;P&gt;4/27/2006: Update on the replication issue: I got away without opening a ticket (after getting some rest and thinking about it).&amp;nbsp; I noticed that SQL Server lost the names of the replication databases (for some reason) on each subscription, after SP1 was installed.&amp;nbsp;&amp;nbsp;With some experimentation, I found there was a "simple"workaround...blowing away all&amp;nbsp;publications and subscriptions&amp;nbsp;and recreating&amp;nbsp;them from scratch.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;Simply wiping out just the subscriptions and redoing them would have been easier, but that didn't completly work.&amp;nbsp; The new subscriptions functioned, but for some reason the old ones (with missing database names) were still there, like "phantoms".&amp;nbsp; Leaving it this way would have made the replication monitor useless, because it would have always indicated an error on every publication (for the phantom subscriptions)..even when the "real" ones were fine.&lt;/P&gt;
&lt;P&gt;So fixing it required blowing away the subscriptions as well.&amp;nbsp;&amp;nbsp; This is not a big deal if you only have a few tables that are small.&amp;nbsp; Fortunately that's our case. Unfortunately&amp;nbsp;one of them allows the sharing of information on site members across the Exhedra sites (and databases).&amp;nbsp; This big guy is a few million rows. So this meant resnapshotting and sending all that info over the network to the other databases again.&amp;nbsp; The users on those sites are not very happy with&amp;nbsp;us right now, becuase this is killing their activity on the databases/sites.&amp;nbsp; But it's one of those things that&amp;nbsp;"has to be done".&amp;nbsp; Otherwise no one could create new accounts...not a good situation either. &lt;BR&gt;&lt;BR&gt;So my recommendation is to allocate extra time in your Service Pack1 Upgrade planned downtime to possibly handle rebuilding all of your replication. Good luck.&lt;BR&gt;&lt;BR&gt;Ian Ippolito&lt;/P&gt;&lt;img src="http://rentacoder.com/CS/aggbug.aspx?PostID=468" width="1" height="1"&gt;</content><author><name>admin</name><uri>http://rentacoder.com/CS/members/admin.aspx</uri></author></entry><entry><title>SQL Server 2005 performance testing with hyperthreading and MAX DOP</title><link rel="alternate" type="text/html" href="http://rentacoder.com/CS/blogs/real_life_it/archive/2006/04/18/SQL_Server_2005_performance_testing_with_hyperthreading_and_MAX_DOP.aspx" /><id>http://rentacoder.com/CS/blogs/real_life_it/archive/2006/04/18/SQL_Server_2005_performance_testing_with_hyperthreading_and_MAX_DOP.aspx</id><published>2006-04-19T03:20:00Z</published><updated>2006-04-19T03:20:00Z</updated><content type="html">&lt;P&gt;There's been alot of negative publicity about hyperthreading (see "&lt;SPAN class=h1&gt;Hyperthreading hurts server performance, say developers" which is all over the net...including: &lt;/SPAN&gt;&lt;A href="http://news.zdnet.co.uk/0,39020330,39237341,00.htm"&gt;http://news.zdnet.co.uk/0,39020330,39237341,00.htm&lt;/A&gt;) &lt;BR&gt;&lt;BR&gt;We had been experiencing disapointing results upgrading from a 32 bit dual processor/single core machine to a 64-bit quad processors/dual core machine with hyperthreading...so I figured this was a good setting to experiment with.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;The other setting&amp;nbsp;that gets alot of attention is the "Max Degree of Parallelism--Max DOP".&amp;nbsp; This setting tells SQL Server how many processors to use when running a multiple query.&amp;nbsp; If set to 0, it uses all available processors.&amp;nbsp; Otherwise you can limit it to a lower # using this paramater.&amp;nbsp; The advice on the internet&amp;nbsp;ranges from "leave it to 0" (which means use all processors), to "set it to the # of processors but don't count your hyperthreaded processors as 2" to "set it to 1". So this was also a good setting to experiment with.&amp;nbsp;&lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;Environment:&lt;BR&gt;&lt;/STRONG&gt;&lt;BR&gt;So I performed several tests using the &lt;A href="http://www.rentacoder.com/"&gt;http://www.RentACoder.com&lt;/A&gt; database to determine if it would help.&amp;nbsp; I picked a period of the night when the traffic was low (in case something got really messed up) but relatively constant and no odd batch jobs or mailing lists were running.&lt;BR&gt;Equipment: Quad processor (3.1 ghz) Dual Core 64-bit machine with 16GB memory.&lt;BR&gt;Software: SQL Server 2005 64 bit edition and Windows 2003 SP1.&lt;BR&gt;(note: some articles said that Windows 2003 SP1 was the most optimized system for hyperthreading).&lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;Raw Test results:&lt;BR&gt;&lt;/STRONG&gt;&lt;BR&gt;1)Baseline: Hyperthreading on...MAXDOP=0: At 9PM (a lull period) with hyperthreading enabled, the CPU usage ranged from 50-60%.&amp;nbsp; The MAXDOP=0 used 16 virtual processors (4 physical x 2 cores/processor x 2 hyperthreads/processor)&lt;BR&gt;2) Hyperthreading off...MAXDOP=0.&amp;nbsp; The CPU usage increased a small but noticable amount...and ranged from 60-70%.&amp;nbsp; The MAXDOP=0 used&amp;nbsp;8 virtual processors (4 physical x 2 cores/processor)&lt;BR&gt;3) Hyperthreading off...MAXDOP=4.&amp;nbsp; This test tested setting it to the # of physical processors (4). This was a CPU killer.&amp;nbsp; Usage spiked to 90-100%.&lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;Conclusion:&lt;/STRONG&gt;&lt;/P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;
&lt;P&gt;In this case, hyperthreading really did produce a measureable boost in performance of 10%.&amp;nbsp;&amp;nbsp;Deactivating it permanently,&amp;nbsp;would have dropped performance&amp;nbsp;unnecessarily. &lt;BR&gt;&lt;BR&gt;Setting MAXDOP = to the # of physical processors really killed performance...the default MAXDOP setting=0 performed much better.&amp;nbsp; Note: I didn't try changing MAXDOP with hyperthreading enabled...perhaps that is a test for another time.&lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;Bottom Line:&lt;BR&gt;&lt;/STRONG&gt;&lt;BR&gt;Don't trust "experts" who tell you that hyperthreading doesn't work...test it for yourself.&amp;nbsp; You may get a boost as we do from it.&amp;nbsp; MAXDOP tuning did not produce an increase in performance and actually hurt performance.&amp;nbsp; So if you experiment do so during a lull period where you won't flood yourself with complaints if your CPU usage spikes.&lt;BR&gt;&lt;BR&gt;Ian Ippolito&lt;/P&gt;&lt;img src="http://rentacoder.com/CS/aggbug.aspx?PostID=458" width="1" height="1"&gt;</content><author><name>admin</name><uri>http://rentacoder.com/CS/members/admin.aspx</uri></author></entry><entry><title>A SQL Server 2005 Index fragmentation &amp;quot;feature&amp;quot; you NEED to know about</title><link rel="alternate" type="text/html" href="http://rentacoder.com/CS/blogs/real_life_it/archive/2006/04/14/455.aspx" /><id>http://rentacoder.com/CS/blogs/real_life_it/archive/2006/04/14/455.aspx</id><published>2006-04-14T16:01:00Z</published><updated>2006-04-14T16:01:00Z</updated><content type="html">&lt;P&gt;Fragmentation of your SQL Server indices&amp;nbsp;builds up over time from new data being added to your tables.&amp;nbsp; This means that the more work your database does...the more it will slow down on scans, meaning that your queries will run slower and slower over time. &lt;/P&gt;
&lt;P&gt;So&amp;nbsp;it is a good idea to&amp;nbsp;recreate your indices in SQL Server 2005 regularly (this gets rid of the fragmentation).&amp;nbsp; You can also do an index defrag...and this can be done online.&amp;nbsp; However it is not as effective as a complete recreate as it doesn't reorganize everything.&amp;nbsp; So eventually you will be forced to do a rebuild.&lt;/P&gt;
&lt;P&gt;So what are your options?&amp;nbsp; The new "online rebuilding" of indices in SQL Server is as highly limited as it has been highly touted.&amp;nbsp; I contacted MSFT support becuase I couldn't use it on half of my tables without the job bombing out.&amp;nbsp; They informed me that if you have any # of things that appear in every "real database" (like a clustered index!)&amp;nbsp;it won't work.&amp;nbsp; So this means you are back to the SQL Server 2000 method of taking down your database and recreating the indcies.&amp;nbsp; Yes this means a maintainence downtime window for your supposedly 24 hour/7 day a week&amp;nbsp;database...and if you don't do it...your database WILL get slower and slower&amp;nbsp;and the user complaints will get louder and louder.&amp;nbsp; So much for the "self-tuning" advertised in SQL 2005's Executive review.&lt;/P&gt;
&lt;P&gt;Anyway,&amp;nbsp;I grudgingly did this and saw some indices vastly improve their performance. But I also noticed that I just couldn't get rid of the fragementation&amp;nbsp;on some tables.&amp;nbsp; The tech at Microsoft explained that on smaller tables, SQL Server will not be able to get rid of the fragmentation.&amp;nbsp; I saw rates of 60-80% on tables with a few thousand rows.&lt;/P&gt;
&lt;P&gt;Here is an example (from his testing) that shows the problem:&lt;/P&gt;
&lt;P&gt;-----------------------&lt;BR&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" color=blue size=2&gt;&lt;SPAN&gt;USE&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt; [mytest]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" color=blue size=2&gt;&lt;SPAN&gt;SET&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt; &lt;FONT color=blue&gt;&lt;SPAN&gt;ANSI_NULLS&lt;/SPAN&gt;&lt;/FONT&gt; &lt;FONT color=blue&gt;&lt;SPAN&gt;ON&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" color=blue size=2&gt;&lt;SPAN&gt;SET&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt; &lt;FONT color=blue&gt;&lt;SPAN&gt;QUOTED_IDENTIFIER&lt;/SPAN&gt;&lt;/FONT&gt; &lt;FONT color=blue&gt;&lt;SPAN&gt;ON&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt;GO&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" color=blue size=2&gt;&lt;SPAN&gt;CREATE&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt; &lt;FONT color=blue&gt;&lt;SPAN&gt;TABLE&lt;/SPAN&gt;&lt;/FONT&gt; [dbo]&lt;FONT color=gray&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;img src="/CS/emoticons/emotion-44.gif" alt="Coffee [C]" /&gt;&lt;FONT color=gray&gt;&lt;SPAN&gt;(&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [CustomerID] [nchar]&lt;FONT color=gray&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/FONT&gt;5&lt;FONT color=gray&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp; &lt;FONT color=gray&gt;&lt;SPAN&gt;NOT&lt;/SPAN&gt;&lt;/FONT&gt; &lt;FONT color=gray&gt;&lt;SPAN&gt;NULL,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [CompanyName] [nvarchar]&lt;FONT color=gray&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/FONT&gt;40&lt;FONT color=gray&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp; &lt;FONT color=gray&gt;&lt;SPAN&gt;NOT&lt;/SPAN&gt;&lt;/FONT&gt; &lt;FONT color=gray&gt;&lt;SPAN&gt;NULL,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ContactName] [nvarchar]&lt;FONT color=gray&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/FONT&gt;30&lt;FONT color=gray&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp; &lt;FONT color=gray&gt;&lt;SPAN&gt;NULL,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ContactTitle] [nvarchar]&lt;FONT color=gray&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/FONT&gt;30&lt;FONT color=gray&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp; &lt;FONT color=gray&gt;&lt;SPAN&gt;NULL,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Address] [nvarchar]&lt;FONT color=gray&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/FONT&gt;60&lt;FONT color=gray&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp; &lt;FONT color=gray&gt;&lt;SPAN&gt;NULL,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [City] [nvarchar]&lt;FONT color=gray&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/FONT&gt;15&lt;FONT color=gray&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp; &lt;FONT color=gray&gt;&lt;SPAN&gt;NULL,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Region] [nvarchar]&lt;FONT color=gray&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/FONT&gt;15&lt;FONT color=gray&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp; &lt;FONT color=gray&gt;&lt;SPAN&gt;NULL,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [PostalCode] [nvarchar]&lt;FONT color=gray&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/FONT&gt;10&lt;FONT color=gray&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp; &lt;FONT color=gray&gt;&lt;SPAN&gt;NULL,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Country] [nvarchar]&lt;FONT color=gray&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/FONT&gt;15&lt;FONT color=gray&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp; &lt;FONT color=gray&gt;&lt;SPAN&gt;NULL,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Phone] [nvarchar]&lt;FONT color=gray&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/FONT&gt;24&lt;FONT color=gray&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp; &lt;FONT color=gray&gt;&lt;SPAN&gt;NULL,&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Fax] [nvarchar]&lt;FONT color=gray&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/FONT&gt;24&lt;FONT color=gray&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp; &lt;FONT color=gray&gt;&lt;SPAN&gt;NULL&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" color=gray size=2&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt; &lt;FONT color=blue&gt;&lt;SPAN&gt;ON&lt;/SPAN&gt;&lt;/FONT&gt; [PRIMARY]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial color=navy size=2&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Wingdings color=green size=2&gt;&lt;SPAN&gt;&lt;SPAN&gt;n&lt;FONT face="Times New Roman" size=1&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face=Arial color=navy size=2&gt;&lt;SPAN&gt;&amp;nbsp;And then we insert about 200 rows data and add a index in management studio: PK_C&amp;nbsp; clustered, unique, primary key located on PRIMARY&amp;nbsp;&amp;nbsp;&amp;nbsp; CustomerID&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" color=blue size=2&gt;&lt;SPAN&gt;select&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt; &lt;FONT color=fuchsia&gt;&lt;SPAN&gt;object_id&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=gray&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=red&gt;&lt;SPAN&gt;'c'&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=gray&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt; –&lt;FONT color=gray&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;/FONT&gt;the result &lt;FONT color=gray&gt;&lt;SPAN&gt;is&lt;/SPAN&gt;&lt;/FONT&gt; 1637580872&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial color=navy size=2&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" color=blue size=2&gt;&lt;SPAN&gt;ALTER&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt; &lt;FONT color=blue&gt;&lt;SPAN&gt;INDEX&lt;/SPAN&gt;&lt;/FONT&gt; &lt;FONT color=gray&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;/FONT&gt; &lt;FONT color=blue&gt;&lt;SPAN&gt;on&lt;/SPAN&gt;&lt;/FONT&gt; c &lt;FONT color=blue&gt;&lt;SPAN&gt;REBUILD&lt;/SPAN&gt;&lt;/FONT&gt; &lt;FONT color=blue&gt;&lt;SPAN&gt;with&lt;/SPAN&gt;&lt;/FONT&gt; &lt;FONT color=gray&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=blue&gt;&lt;SPAN&gt;FILLFACTOR&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color=gray&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;/FONT&gt;100&lt;FONT color=gray&gt;&lt;SPAN&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" color=gray size=2&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" color=blue size=2&gt;&lt;SPAN&gt;SELECT&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt; &lt;FONT color=gray&gt;&lt;SPAN&gt;*&lt;/SPAN&gt;&lt;/FONT&gt; &lt;FONT color=blue&gt;&lt;SPAN&gt;FROM&lt;/SPAN&gt;&lt;/FONT&gt; sys.dm_db_Index_physical_stats&lt;FONT color=gray&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/FONT&gt;7&lt;FONT color=gray&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/FONT&gt;1637580872&lt;FONT color=gray&gt;&lt;SPAN&gt;,null,null,null)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" color=gray size=2&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" color=green size=2&gt;&lt;SPAN&gt;--the result avg_fragmentation_in_percent will be 66.6666666666667, refer to attached doc file screen shot 1&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" color=green size=2&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial color=navy size=2&gt;&lt;SPAN&gt;And then we run the following command several times:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" color=gray size=2&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" color=blue size=2&gt;&lt;SPAN&gt;insert&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt; &lt;FONT color=blue&gt;&lt;SPAN&gt;into&lt;/SPAN&gt;&lt;/FONT&gt; c &lt;FONT color=blue&gt;&lt;SPAN&gt;select&lt;/SPAN&gt;&lt;/FONT&gt; &lt;FONT color=gray&gt;&lt;SPAN&gt;*&lt;/SPAN&gt;&lt;/FONT&gt; &lt;FONT color=blue&gt;&lt;SPAN&gt;from&lt;/SPAN&gt;&lt;/FONT&gt; c&amp;nbsp; &lt;FONT color=green&gt;&lt;SPAN&gt;-- (&lt;B&gt;&lt;SPAN&gt;23296 row(s) affected&lt;/SPAN&gt;&lt;/B&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" color=green size=2&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial color=navy size=2&gt;&lt;SPAN&gt;About the result avg_fragmentation_in_percent is 32.2%&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial color=navy size=2&gt;&lt;SPAN&gt;And then we run the following command several times:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" color=gray size=2&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face="Courier New" color=blue size=2&gt;&lt;SPAN&gt;insert&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;&lt;SPAN&gt; &lt;FONT color=blue&gt;&lt;SPAN&gt;into&lt;/SPAN&gt;&lt;/FONT&gt; c &lt;FONT color=blue&gt;&lt;SPAN&gt;select&lt;/SPAN&gt;&lt;/FONT&gt; &lt;FONT color=gray&gt;&lt;SPAN&gt;*&lt;/SPAN&gt;&lt;/FONT&gt; &lt;FONT color=blue&gt;&lt;SPAN&gt;from&lt;/SPAN&gt;&lt;/FONT&gt; c&amp;nbsp; &lt;FONT color=green&gt;&lt;SPAN&gt;-- (&lt;B&gt;&lt;SPAN&gt;186368 row(s) affected&lt;/SPAN&gt;&lt;/B&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial color=navy size=2&gt;&lt;SPAN&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial color=navy size=2&gt;&lt;SPAN&gt;About the result avg_fragmentation_in_percent is 6.8%. &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial color=navy size=2&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Arial color=navy size=2&gt;&lt;SPAN&gt;When we increase the data of the table, we can find the page count will increase and the avg_fragmentation_in_percent value will decrease, it is controlled by SQL Server internal design, if we continue to insert more data, we can find the value will reach nearly 0.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;----------------------------------------&lt;BR&gt;So this is something to keep in mind when defragging.&lt;/P&gt;
&lt;P&gt;Ian Ippolito&lt;BR&gt;&lt;A href="http://www.RentACoder.com"&gt;http://www.RentACoder.com&lt;/A&gt;&lt;BR&gt;&lt;BR&gt;&lt;/P&gt;&lt;img src="http://rentacoder.com/CS/aggbug.aspx?PostID=455" width="1" height="1"&gt;</content><author><name>admin</name><uri>http://rentacoder.com/CS/members/admin.aspx</uri></author></entry><entry><title>Classic ASP: Not ready for prime-time?</title><link rel="alternate" type="text/html" href="http://rentacoder.com/CS/blogs/real_life_it/archive/2006/03/19/448.aspx" /><id>http://rentacoder.com/CS/blogs/real_life_it/archive/2006/03/19/448.aspx</id><published>2006-03-19T15:56:00Z</published><updated>2006-03-19T15:56:00Z</updated><content type="html">&lt;P&gt;There is a&amp;nbsp;VERY bad problem with&amp;nbsp;Active Server Pages (ASP...or what is sometimes known as "classic ASP") which prevents it from being a viable system on which to build a "big IT" project.&amp;nbsp; For 2 years we've been fighting a problem in which the IIS (Internet Information Server) 6.0 web servers will run fine for a while.&amp;nbsp; But then after 18-20 hours,&amp;nbsp;every pages will stop running properly and instead display random errors (that change from refresh of the page to refresh).&amp;nbsp; The errors always say things like "Cannot find property or method" regarding classes that do exist, or "Cannot create object".&amp;nbsp; The exact propery or object changes from "refresh" to "resfresh"...even on the same page. Restarting will fix the problem for an hour or so...but then it reoccurs.&amp;nbsp; Only a hard reboot will fix it for another 18-20 hours.&amp;nbsp; And then the cycle repeats itself.&lt;/P&gt;
&lt;P&gt;We started a ticket over 2 years on this.&amp;nbsp; Today Microsoft acknowledged the problem&amp;nbsp;publicly with a KB article: &lt;A href="http://support.microsoft.com/?scid=kb;en-us;914156"&gt;http://support.microsoft.com/?scid=kb;en-us;914156&lt;/A&gt;&lt;BR&gt;&lt;BR&gt;Basically the problem is that ASP fragments the heap under certain conditions:&lt;BR&gt;1) When an app uses INCLUDE files &lt;BR&gt;2) When an app uses&amp;nbsp;significant memory&lt;BR&gt;And it&amp;nbsp;doesn't defragment&amp;nbsp;the memory&amp;nbsp;and as a result,&amp;nbsp;will ALWAYS&amp;nbsp;crash IIS in this way.&amp;nbsp; The new restart services of IIS 6.0 don't help, becuase only a hard reboot can truly get rid of the defragmentation.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;Of course, two things that any&amp;nbsp;site that has any sophistication has lots of INCLUDE files and any site that has any traffic uses&amp;nbsp;lots of memory.&amp;nbsp;&amp;nbsp;If both of these apply to you, your ASP site is in trouble.&amp;nbsp; This is what's called a "bug" in my book.&amp;nbsp; I'm sure if ASP were&amp;nbsp;MSFT's current technology they would have to fix this.&amp;nbsp; But Microsoft has moved on to ASP.NET...so I suspect the incentive is pretty much nil.&lt;BR&gt;&lt;BR&gt;If you look at the KB article, Microsoft gives a "workaround" (which is the same workaround that they suggested to us).&amp;nbsp; The workaround is to rewrite your INCLUDE files as COM objects.&amp;nbsp; The article sites a&amp;nbsp;# of benefits like speed, etc..&lt;BR&gt;&lt;BR&gt;The KB was probably written by a systems engineer who knows alot about running systems, but has no idea how&amp;nbsp;computer software is developed, and&amp;nbsp;how impractical this workaround is in the real world.&amp;nbsp; In a previous position we went down the COM object&amp;nbsp;route.&amp;nbsp; We did it for other reasons...becuase it was the Microsoft "best practice" at the time.&amp;nbsp; It's obvious why it no longer is.&amp;nbsp; The problems we ran into were:&lt;BR&gt;&lt;BR&gt;1) Memory: COM objects have a known memory leak problem.&amp;nbsp; If two COM objects reference each other and you set them to Nothing, they don't clear themselves in memory as they should.&amp;nbsp; The problem is due to the internal way that COM objects work and was fixed&amp;nbsp;in .NET with a rearchitecture.&amp;nbsp; But that isn't an option for you if you use&amp;nbsp;COM objects.&amp;nbsp; This COM memory leak bug will cause your machine to eventually crash, EVERY TIME.&lt;BR&gt;&lt;BR&gt;2)&amp;nbsp;Slowness to initialize objects:&amp;nbsp; COM objects are not designed to be created and destroyed thousands of times like .NET objects.&amp;nbsp;&amp;nbsp;&amp;nbsp;Our object rich COM model running on the internet was VERY slow...some pages took 5-10 seconds to render.&amp;nbsp;&amp;nbsp;One way to work around this is to not use objects in COM, but instead use functions.&amp;nbsp; But of course, this "solution" causes almost as many problems.&amp;nbsp; A non-object oriented framework is exponentially more difficult to debug and maintain which makes delivering the code on time and on budget frustratingly (and unnecessarily) difficult.&lt;BR&gt;&lt;BR&gt;3) Slowness to develop:&amp;nbsp; This was a real show stopper.&amp;nbsp; Every time a change is made in the COM object code (the COM object has to be completely recompiled from scratch, which took 2-3 minutes on a state of the art machines (This # could vary depending on the size of your COM objects).&amp;nbsp; Also, many times IIS would lock the COM object .dll, &amp;nbsp;so in addition, IIS had to be stopped and restarted too, which&amp;nbsp;took another minute or two.&amp;nbsp; (The latter&amp;nbsp;might be alleviated with object pooling, but all the other negatives forced us to abandon COM before even looking at this possibility). &lt;BR&gt;&lt;BR&gt;How does this affect things?&amp;nbsp; When code is created, it is never right the first time.&amp;nbsp; Even creating a single function is an iterative process where it's coded, run, bugs are removed, and the process repeated.&amp;nbsp; A typically complex function created by a top notch developer might require 3-4 iterations...and an average developer might require 10,15 or more.&amp;nbsp;&amp;nbsp; Being able to iterate quickly is what allows you to deliver it on time and on budget.&amp;nbsp; If creating just a single function requires 9 more minutes for your "star" developer and 30 more minutes for your average developers, you are going to have problems.&amp;nbsp; It is FRUSTRATINGLY difficult to develop under these circumstances and try to&amp;nbsp;meet time and budget commitments.&lt;/P&gt;
&lt;P&gt;I tried to explain to the Microsoft systems engineer why this was impractical, but simply got the standard "spiel" repeated to me that COM objects were wonderful and the way to go.&amp;nbsp; Obviously he believed something he read from a KB article, more than me, who he did not realize had personal experience with this supposed "solution".&amp;nbsp; &lt;BR&gt;&lt;BR&gt;&lt;SPAN&gt;&lt;FONT face="Times New Roman" size=3&gt;Conclusion: If you develop a web app with any sophisticiation or any size, ASP (classic ASP) is NOT a suitable or scalable&amp;nbsp;environment for you.&amp;nbsp; Instead go to a non Microsoft platform.&amp;nbsp; If you choose to say with Microsoft, choose the newer ASP.NET.&lt;BR&gt;&lt;BR&gt;Ian Ippolito&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://rentacoder.com/CS/aggbug.aspx?PostID=448" width="1" height="1"&gt;</content><author><name>admin</name><uri>http://rentacoder.com/CS/members/admin.aspx</uri></author></entry><entry><title>SQL Server 2005: Are your batteries half full or half empty?</title><link rel="alternate" type="text/html" href="http://rentacoder.com/CS/blogs/real_life_it/archive/2006/03/17/447.aspx" /><id>http://rentacoder.com/CS/blogs/real_life_it/archive/2006/03/17/447.aspx</id><published>2006-03-18T00:21:00Z</published><updated>2006-03-18T00:21:00Z</updated><content type="html">&lt;P&gt;Microsoft is running an ad campaign showing skyscraper&amp;nbsp;sized batteries labeled "SQL Server 2005" plugged into enormous buildings.&amp;nbsp; The message is obviously that this database is designed for big companies and serious mission critical systems. &lt;BR&gt;&lt;BR&gt;&lt;A href="/CS/photos/general_photo_gallery/picture500.aspx" target=_blank&gt;&lt;IMG src="/CS/photos/general_photo_gallery/images/500/original.aspx" border=0&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;SQL 2005 is packed with impressive new features...too many to mention here.&amp;nbsp; Some of them are truly awesome...like the new reporting capabilities which come as part of the purchase price, rather than having to buy a seperate system.&amp;nbsp; Unfortuntely my experience with running the current version on a mission critical system (PRE Service Pack 1)&amp;nbsp;has not been as impressive as I was hoping.&lt;BR&gt;&lt;BR&gt;Along with the upgrade from SQL Server 2000 to 2005, we also simultaneously upgraded the hardware substantially.&amp;nbsp; We went from a 32-bit dual processor box to an expensive "screamer"...a 64-bit quad processor box with dual core (so from&amp;nbsp;two 32 bit processors to virtually eight 64 bit processors).&amp;nbsp; And yet performance in SQL Server 2005 is no better than in 2000.&amp;nbsp; And in some cases it's worse.&amp;nbsp; What as going on?&lt;/P&gt;
&lt;P&gt;A part&amp;nbsp;of the problem&amp;nbsp;was the Database Tuning Advisor (DTA).&amp;nbsp;SQL 2005 has so many cool new features, but they are useless if you can't optimize the database.&amp;nbsp; And that lack of optimization has caused increased timeouts, deadlocks and alot of personal user dissatisifaction with our service.&amp;nbsp; The first problem is that the advisor takes a LONG time to run.&amp;nbsp; Just tuning a query used to take a few seconds in 2000...now it goes through a multi step process lasting 4-5 minutes.&amp;nbsp; Running a real workload is worse.&amp;nbsp; But that's something you can learn to live with.&amp;nbsp; But the problem is that the long wait times come with an unexpected companion...timeouts and deadlocks.&amp;nbsp;&amp;nbsp; The old 2000 let you analyze it "live" without any reprecusions (which I did may times).&amp;nbsp; But don't make the mistake of running the current version of DTA on a database with a decent load on it.&amp;nbsp;&amp;nbsp;I don't know what DTA does, but every time I did it, it started terminating 1/2 of my users as deadlock victims so it could do it's business.&amp;nbsp;And&amp;nbsp;after about 45 minutes of this, it got worse becuase it just HUNG.&amp;nbsp; And it was a bad hang too...becuase just restarting the service wasn't enough.&amp;nbsp; I had to physically reboot the machine to allow&amp;nbsp;clients to reconnect to it.&amp;nbsp; It takes a long time for that beast of a machine to reboot (about 7 minutes), and the users were not pleased with me.&amp;nbsp; Thank you DTA...may I have another?&lt;/P&gt;
&lt;P&gt;Unfortunately, DTA's answers to that question is "yes you may!".&amp;nbsp; There is the abilty to run DTA on a remote server to "lessen the load" on the production server (according to the MSFT documentation).&amp;nbsp; In my case, load wasn't&amp;nbsp;really the problem...the CPU never went above 50% on the production machine.&amp;nbsp; It's the hanging that was a problem.&amp;nbsp; Anyway, I discovered that for whatever reason, remote tuning stopped the hangs.&amp;nbsp; But this only led to more problems.&lt;/P&gt;
&lt;P&gt;At first I could never complete even a single tuning session becuase I would get a cryptic "Tuning process exited unexpectedly. (DTAEngine)".&amp;nbsp; I was reduced to hitting "stop" at random points before it finished to get partial recommendations...anything to stop any of those timeouts.&amp;nbsp; But I needed a real solution.&amp;nbsp; So I opened a ticket with MSFT and&amp;nbsp;they confirmed&amp;nbsp;found a bug in DTA in dealing with indexed views (and is fixing it...ETA 3 weeks).&lt;BR&gt;&lt;BR&gt;So after I learned that indexed views were the culprit I thought I'd at least be able to tune it 50% by setting&amp;nbsp;DTA to tune "tables only".&amp;nbsp; Smart idea right?&amp;nbsp; Well...kind of.&amp;nbsp; It worked...sometimes.&amp;nbsp; But about 50% of the time DTA bombs out with "Index (zero based) must be greater than or equal to zero and less than the size of the argument list.&amp;nbsp; Turning process finished."&amp;nbsp; Nice and vague.&amp;nbsp; And again, the crash stops any recommendations from being made.&amp;nbsp; So yes, I had to open another Microsoft support ticket.&amp;nbsp;&amp;nbsp;I have six open right now...is that some sort of record?&amp;nbsp;Sadly I think it probably is not.&amp;nbsp; The worse thing is that Microsoft has duplicated this bug, but didn't fix it in SP1 and may not even issue a hotfix for it.&amp;nbsp; The MSFT tech explained that they cannot fix it until enough people complain about it.&amp;nbsp; So until enough people running big databases adopt SQL 2005 and run into these same issues...I am stuck dead in the water on this issue.&amp;nbsp; But until they get problems like this solved...people are not going to be moving their databases over.&amp;nbsp; A true "Catch 22".&lt;BR&gt;(update: 5/8/2006: This will be made into a post SP1 hotfix...thanks to everyone else who also complained!)&amp;nbsp; &lt;BR&gt;&lt;BR&gt;Conclusion:&lt;BR&gt;&lt;BR&gt;SQL 2005 has some awesome features.&amp;nbsp; But it doesn't do any good&amp;nbsp;your database&amp;nbsp;runs slower than the last version becuase&amp;nbsp;of the lack of DTA.&amp;nbsp; &lt;STRONG&gt;My advice to anyone that asks is to wait for Microsoft to fix these bugs with SQL Server 2005 SP1 before jumping in with anything that is mission critical.&lt;/STRONG&gt;&lt;/P&gt;Ian Ippolito&lt;A href="/CS/photos/general_photo_gallery/picture500.aspx" target=_blank&gt;&lt;/A&gt;&lt;img src="http://rentacoder.com/CS/aggbug.aspx?PostID=447" width="1" height="1"&gt;</content><author><name>admin</name><uri>http://rentacoder.com/CS/members/admin.aspx</uri></author></entry><entry><title>Beware the Ides of ISA Service Pack 2 (SP2)</title><link rel="alternate" type="text/html" href="http://rentacoder.com/CS/blogs/real_life_it/archive/2006/03/17/446.aspx" /><id>http://rentacoder.com/CS/blogs/real_life_it/archive/2006/03/17/446.aspx</id><published>2006-03-18T00:18:00Z</published><updated>2006-03-18T00:18:00Z</updated><content type="html">&lt;P&gt;I've&amp;nbsp;confirmed that the SendAcceptEncodingHeader metabase setting that USED to work pre ISA (Internet Security and Acceleration Server) SP2 and&amp;nbsp;allowed IIS to pass through the compression headers for gzip, is no longer working with SP2 (and passed this on to Microsoft).&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The other option, is to of course use ISA SP2's spiffy new (and highly touted) compression.&amp;nbsp; So I turned it on to give a run. It ran fine...for about 20 minutes.&amp;nbsp; Then it crashed with an error of : "ISA Server was unable to decompress a response body from /RentACoder because the following error occurred: 0x80070008."&amp;nbsp; I tried turning off the decompression (unchecked the checkbox on the 3rd tab)...and still got the same crash after about 30 minutes. &lt;/P&gt;
&lt;P&gt;So I brought this up to Microsoft support, and the engineer passed on that Jim (the ISA manager) said that the compression features were designed for branch offices.&amp;nbsp; Nice to know about that qualifier in advance, huh? :)&lt;BR&gt;&lt;BR&gt;Unfortuantely I'm stuck between a rock and hard place&amp;nbsp;with SP2.&amp;nbsp; I installed it becuase Microsoft reworked their handling of large attachments, and they felt it would fix the ISA crashes I was having every 1-4 weeks.&amp;nbsp; And it looks like it is doing the trick (no crash for 3.5 weeks now).&amp;nbsp; But now my bandwidth costs are going to be 2x-4x higher this month than they should be due to ISA SP2's new "feature".&amp;nbsp; I can't win either way. (The Microsoft tech I'm dealing with, Masoud,&amp;nbsp;said he'll try to get duplicate this and get something going in a week or so...I hope he can&amp;nbsp;pull it off).&lt;/P&gt;
&lt;P&gt;However, it could be worse.&amp;nbsp; I've done some reading on newsgroups and&amp;nbsp;Microsoft is slammed with other problems in this SP2 concerning compression in the opposite direction...people browsing from behind ISA SP2 seem to have problems.&amp;nbsp; Thankfully that isn't my situation too.&lt;/P&gt;
&lt;P&gt;Ian Ippolito&lt;BR&gt;&lt;A href="http://www.RentACoder.com"&gt;http://www.RentACoder.com&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;4/27/2006: UPDATE: There is a workaround to fix this problem.&amp;nbsp; If you completely disable the new and "improved compression .dll that SP2 has so generously forced upon you (but that doesn't work)...the compression metabase setting works again!&amp;nbsp; To do this:&lt;BR&gt;Go to "configuration", "add-in", "web filters" tab.&amp;nbsp; Then disable "compression filter".&amp;nbsp; Viola...enjoy!&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;Ian Ippolito&lt;/P&gt;&lt;img src="http://rentacoder.com/CS/aggbug.aspx?PostID=446" width="1" height="1"&gt;</content><author><name>admin</name><uri>http://rentacoder.com/CS/members/admin.aspx</uri></author></entry></feed>