<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Tibor Karaszi : SQL Server 2008</title><link>http://sqlblog.com/blogs/tibor_karaszi/archive/tags/SQL+Server+2008/default.aspx</link><description>Tags: SQL Server 2008</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>Heaps, forwarding pointers, ALTER TABLE REBUILD and non-clustered indexes</title><link>http://sqlblog.com/blogs/tibor_karaszi/archive/2009/08/28/heaps-forwarding-pointers-alter-table-rebuild-and-non-clustered-indexes.aspx</link><pubDate>Fri, 28 Aug 2009 10:15:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:16351</guid><dc:creator>TiborKaraszi</dc:creator><slash:comments>5</slash:comments><comments>http://sqlblog.com/blogs/tibor_karaszi/comments/16351.aspx</comments><wfw:commentRss>http://sqlblog.com/blogs/tibor_karaszi/commentrss.aspx?PostID=16351</wfw:commentRss><description>Let's start with some background on forwarding pointers: Forwarding pointers in heaps can be a mess to get rid of. A forwarding pointer happens when you modify a row so that the row doesn't fit on the same page anymore. SQL Server moves the row to a new...(&lt;a href="http://sqlblog.com/blogs/tibor_karaszi/archive/2009/08/28/heaps-forwarding-pointers-alter-table-rebuild-and-non-clustered-indexes.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlblog.com/aggbug.aspx?PostID=16351" width="1" height="1"&gt;</description><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/Performance/default.aspx">Performance</category><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/indexes/default.aspx">indexes</category><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/SQL+Server+2008/default.aspx">SQL Server 2008</category></item><item><title>Spooky: What do you connect to?</title><link>http://sqlblog.com/blogs/tibor_karaszi/archive/2009/06/26/spooky-what-do-you-connect-to.aspx</link><pubDate>Fri, 26 Jun 2009 14:12:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:14940</guid><dc:creator>TiborKaraszi</dc:creator><slash:comments>2</slash:comments><comments>http://sqlblog.com/blogs/tibor_karaszi/comments/14940.aspx</comments><wfw:commentRss>http://sqlblog.com/blogs/tibor_karaszi/commentrss.aspx?PostID=14940</wfw:commentRss><description>I only recently discovered that SSMS will connect to different things. For instance, press the "New query" button. What were you connected to? The answer is the same server as your "current" server. But what is the current server? It is the server where...(&lt;a href="http://sqlblog.com/blogs/tibor_karaszi/archive/2009/06/26/spooky-what-do-you-connect-to.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlblog.com/aggbug.aspx?PostID=14940" width="1" height="1"&gt;</description><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/Tools/default.aspx">Tools</category><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/SQL+Server+2008/default.aspx">SQL Server 2008</category></item><item><title>sp_altermessage is back in business!</title><link>http://sqlblog.com/blogs/tibor_karaszi/archive/2009/05/14/sp-altermessage-is-back-in-business.aspx</link><pubDate>Thu, 14 May 2009 20:36:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:14063</guid><dc:creator>TiborKaraszi</dc:creator><slash:comments>2</slash:comments><comments>http://sqlblog.com/blogs/tibor_karaszi/comments/14063.aspx</comments><wfw:commentRss>http://sqlblog.com/blogs/tibor_karaszi/commentrss.aspx?PostID=14063</wfw:commentRss><description>&lt;P&gt;Just a quick note that we again can modify whether system messages are to go to eventlog/errorlog again. I.e., we can change the is_event_logged column in sys.messages. This is very valuable in general and specifically is you want to define Agent alerts (for which Agent polls the Eventlog). For instance:&lt;/P&gt;
&lt;P&gt;SELECT * FROM sys.messages &lt;BR&gt;WHERE message_id = 1205&lt;BR&gt;AND language_id = 1033&lt;/P&gt;
&lt;P&gt;Notice the value for the is_event_logged column. Now, run below:&lt;/P&gt;
&lt;P&gt;EXEC sp_altermessage&lt;BR&gt;&amp;nbsp;@message_id = 1205&lt;BR&gt;,@parameter = 'WITH_LOG'&lt;BR&gt;,@parameter_value = 'true' &lt;/P&gt;
&lt;P&gt;Now, re-run the select statement and see that you modified the behavior for the system message. Now, re-run the sp_altermessage with 'false' to reset to default.&lt;/P&gt;
&lt;P&gt;The ability to modify this behavior for system messages was available prior to SQL Server 2005, but some re-architecturing in 2005 removed the functionality. kozloski informed me in this &lt;A title="this blog post" href="http://sqlblog.com/blogs/tibor_karaszi/archive/2009/02/23/where-s-that-sys-messages-management-pack.aspx"&gt;blog post&lt;/A&gt;&amp;nbsp;that 2005 sp3 re-introduced the functionality and obviously as of sp1 the functionlity is back in 2008 as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://sqlblog.com/aggbug.aspx?PostID=14063" width="1" height="1"&gt;</description><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/Tools/default.aspx">Tools</category><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/Maintenance/default.aspx">Maintenance</category><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/SQL+Server+2008/default.aspx">SQL Server 2008</category><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/SQL+Server+Agent/default.aspx">SQL Server Agent</category></item><item><title>German translation of my updated datetime article</title><link>http://sqlblog.com/blogs/tibor_karaszi/archive/2008/11/26/german-translation-of-my-updated-datetime-article.aspx</link><pubDate>Wed, 26 Nov 2008 11:02:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:10124</guid><dc:creator>TiborKaraszi</dc:creator><slash:comments>1</slash:comments><comments>http://sqlblog.com/blogs/tibor_karaszi/comments/10124.aspx</comments><wfw:commentRss>http://sqlblog.com/blogs/tibor_karaszi/commentrss.aspx?PostID=10124</wfw:commentRss><description>&lt;P&gt;Frank Kalis has been kind enough to translate my datetime article (&lt;A href="http://www.karaszi.com/SQLServer/info_datetime.asp"&gt;http://www.karaszi.com/SQLServer/info_datetime.asp&lt;/A&gt;) to German. I updated my article a while ago to reflect the new date and time related types in SQL Server 2008, and I just learned that Frank now has finished the translation of my updated article to to German. Check it out at:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.insidesql.org/beitraege/datetime/der-ultimative-guide-fuer-die-datetime-datentypen"&gt;http://www.insidesql.org/beitraege/datetime/der-ultimative-guide-fuer-die-datetime-datentypen&lt;/A&gt;&lt;/P&gt;&lt;img src="http://sqlblog.com/aggbug.aspx?PostID=10124" width="1" height="1"&gt;</description><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/datetime/default.aspx">datetime</category><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/SQL+Server+2008/default.aspx">SQL Server 2008</category><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/International/default.aspx">International</category></item><item><title>New (web) update for SQL Server 2008 Books Online</title><link>http://sqlblog.com/blogs/tibor_karaszi/archive/2008/11/05/new-web-update-for-sql-server-2008-books-online.aspx</link><pubDate>Wed, 05 Nov 2008 08:19:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:9863</guid><dc:creator>TiborKaraszi</dc:creator><slash:comments>9</slash:comments><comments>http://sqlblog.com/blogs/tibor_karaszi/comments/9863.aspx</comments><wfw:commentRss>http://sqlblog.com/blogs/tibor_karaszi/commentrss.aspx?PostID=9863</wfw:commentRss><description>&lt;P&gt;Fire up your SQL Server 2008 Books Online (BOL) and check the date. You should find this in any article (except for the very start page). &lt;/P&gt;
&lt;P&gt;RTM of SQL Server 2008 shipped with a BOL which has ... hmm,... &lt;STRONG&gt;doesn't&lt;/STRONG&gt; have a date (just checked in a virtual machine). OK, so if you don't find a date (year month) you have the BOL which shipped with RTM.&lt;/P&gt;
&lt;P&gt;The first BOL update was released 2008-09-30. You will see this as (August 2008). This was made available on the web as well as a download (&lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=765433f7-0983-4d7a-b628-0a98145bcb97&amp;amp;DisplayLang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=765433f7-0983-4d7a-b628-0a98145bcb97&amp;amp;DisplayLang=en&lt;/A&gt;). This BOL did not list what was changed from prior release since this was considered RTM of BOL and the BOL that shipped with RTM was considered RC0 (which explains why this BOL lists Aug 2008 when it was released late Sept 2008).&lt;/P&gt;
&lt;P&gt;Today I learned that MS has released yet another release of Books Online. This is only available on the web, and you see this as (October 2008). Now we &lt;STRONG&gt;do&lt;/STRONG&gt; have listing of what section are new and what were expended on. I admit that I prefer locally installed BOL, but I guess that MS has resource limitations the same was as all of us do. Check it out at &lt;A href="http://msdn.microsoft.com/en-us/library/dd239407.aspx"&gt;http://msdn.microsoft.com/en-us/library/dd239407.aspx&lt;/A&gt;.&lt;/P&gt;&lt;img src="http://sqlblog.com/aggbug.aspx?PostID=9863" width="1" height="1"&gt;</description><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/Documentation/default.aspx">Documentation</category><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/SQL+Server+2008/default.aspx">SQL Server 2008</category></item><item><title>Does the Resource Governor govern?</title><link>http://sqlblog.com/blogs/tibor_karaszi/archive/2008/10/22/does-the-resource-governor-govern.aspx</link><pubDate>Wed, 22 Oct 2008 16:14:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:9601</guid><dc:creator>TiborKaraszi</dc:creator><slash:comments>2</slash:comments><comments>http://sqlblog.com/blogs/tibor_karaszi/comments/9601.aspx</comments><wfw:commentRss>http://sqlblog.com/blogs/tibor_karaszi/commentrss.aspx?PostID=9601</wfw:commentRss><description>&lt;P&gt;Two weeks ago, we did the "SQL&amp;nbsp;2008 Summit" roadshow here in Sweden. We did 4 cities around Sweden in 4 days (&lt;A href="http://www.expertzone.se/sql2k8/"&gt;http://www.expertzone.se/sql2k8/&lt;/A&gt;). It was a bit exhaustive, but even more fun - being able to travel and spend some time with persons wish I could meet more often (Kalen), others I meet regularly but only at workplace (Roger, Patrik, Anna) and yet other persons I just met (George, Per). &lt;/P&gt;
&lt;P&gt;One of my presentations was on Resource Governor (RG), and I has this super-simple demo meaning to show CPU throttling. I classified connections to one of two Workload Groups based on login name. One group used a&amp;nbsp;Resource Pool with&amp;nbsp;max CPU at 10% and the other a Resource Pool with&amp;nbsp;max CPU at 90%. Since I have two CPU cores, I started two execution loops for each login. An execution loop uses SQLCMD to login using the appropriate loginID and execute a proc which loops and outputs a counter using RAISERROR and NOWAIT (so we see something happening in the console).&lt;/P&gt;
&lt;P&gt;For two of my presentations it worked just as expected. For two&amp;nbsp;presentations it didn't: the CPU usage looked very very strange - nowhere near what we expected. So, during the final day, I managed to spend some time with Mikael Colliander from MS Sweden. First we couldn't reproduce the strange behavior, but after several restart, re-boot etc. we could. We now finally got to look at what scheduler each connection was using and there was the answer. One connection (ending up in the pool with max 10% CPU) was alone on one scheduler meaning alone on one CPU! The other three connections (one one on 10% CPU and two on&amp;nbsp;max 90% CPU) was using the other CPU. So for the CPU where we had only one connection (belonging to the pool to be capped at 10% CPU) we just had no contention. So this connection could use everything on that CPU since nobody else was assigned to the CPU. &lt;/P&gt;
&lt;P&gt;Now when I understand why this happened, it doesn't look that strange. But I think we need to be very careful when we monitor resource usage for our connections and are using resource governor. The more CPUs we have the less chance we will see the (perhaps expected) distribution of load.&lt;/P&gt;&lt;img src="http://sqlblog.com/aggbug.aspx?PostID=9601" width="1" height="1"&gt;</description><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/Performance/default.aspx">Performance</category><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/SQL+Server+2008/default.aspx">SQL Server 2008</category></item><item><title>My datetime article updated for 2008</title><link>http://sqlblog.com/blogs/tibor_karaszi/archive/2008/09/23/my-datetime-article-updated-for-2008.aspx</link><pubDate>Tue, 23 Sep 2008 14:10:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:9049</guid><dc:creator>TiborKaraszi</dc:creator><slash:comments>4</slash:comments><comments>http://sqlblog.com/blogs/tibor_karaszi/comments/9049.aspx</comments><wfw:commentRss>http://sqlblog.com/blogs/tibor_karaszi/commentrss.aspx?PostID=9049</wfw:commentRss><description>&lt;P&gt;Actually, the article has been out for about a month now, but I first solicited feedback on errors and typo's and then I forgot to mention the update here...&lt;/P&gt;
&lt;P&gt;Anyhow, the article now also covers 2008 and the new date, time, datetime2 and datetimeoffset types. There are some interesting aspects of the new types which sets them apart from the old types. As always, I'll be happy if you let me know about errors or typos.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.karaszi.com/SQLServer/info_datetime.asp"&gt;http://www.karaszi.com/SQLServer/info_datetime.asp&lt;/A&gt;&lt;/P&gt;&lt;img src="http://sqlblog.com/aggbug.aspx?PostID=9049" width="1" height="1"&gt;</description><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/datetime/default.aspx">datetime</category><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/TSQL/default.aspx">TSQL</category><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/SQL+Server+2008/default.aspx">SQL Server 2008</category></item><item><title>Rebuilding msdb on SQL Server 2008</title><link>http://sqlblog.com/blogs/tibor_karaszi/archive/2008/08/27/rebuilding-msdb-on-sql-server-2008.aspx</link><pubDate>Wed, 27 Aug 2008 10:10:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:8605</guid><dc:creator>TiborKaraszi</dc:creator><slash:comments>0</slash:comments><comments>http://sqlblog.com/blogs/tibor_karaszi/comments/8605.aspx</comments><wfw:commentRss>http://sqlblog.com/blogs/tibor_karaszi/commentrss.aspx?PostID=8605</wfw:commentRss><description>&lt;P&gt;Because of the problems I had removing Data Collector I decided to rebuild msdb. You probably heard about instmsdb.sql, but it was a long time since I actually used it. I asked about rebuilding in the MVP group and Dan Jones (MS) pointed me to a Blog post from Paul Randal on how to do this on SQL Server 2005. Here's Paul's blog post:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/06/619304.aspx"&gt;http://blogs.msdn.com/sqlserverstorageengine/archive/2006/06/06/619304.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Since above is for SQL Server 2005 I realized that it might not work smoothly on 2008. And It didn't. Below are some of the things I discovered (also posted as a comment on Paul's blog). Read below in light of Paul's blog. I should also say that nowhere does Paul states that his instructions work on 2008. It was me taking a chance. :-)&lt;/P&gt;
&lt;DIV&gt;You need to add startup parameter -s &amp;lt;instancename&amp;gt; if it is a named instance. Now, this I knew, but for the sake of other potential readers...&lt;/DIV&gt;
&lt;DIV&gt;I initially started the instance from the Windows services applet by adding -T3608. That didn't allow for detaching msdb. So I started from an OS command prompt and also added -c. This allowed me to detach msdb.&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I now ran instmsdb, but that produced a number of errors. Here are a few comments about some of them:&lt;/DIV&gt;
&lt;DIV&gt;* Complaints on xp_cmdshell. I did try enabling this first and then ran instmsdb again but same result.&lt;/DIV&gt;
&lt;DIV&gt;* Bunch of errors when creating various Data Collector objects. This wasn't good, because cleaning up DC was the reason to rebuild msdb in the frist place.&lt;/DIV&gt;
&lt;DIV&gt;* 3 errors about sp_configure and -1 wasn't allowed value (two for Agent Xps and one for xp_cmdshell).&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Just for the sake of trying, I now tried to connect to the instance using SSMS Object Explorer. But I now got some error regarding Agent Xp's when connecting. I tried to explicitly enabling Agent XP's using sp_configure but same error. When connected there's no node in Objects Explorer for Agent. &lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;I took this as an indication that Agent isn't healthy. Whether it was me doing something fishy or it isn't as easy as just running insmsdb.sql for SQL Server 2008 - I don't know. But I'm in for a rebuild of system databases. This isn't that bad since it is a just a test machine. But these issues might serve as example why you want to follow Paul's initial advice: always backup msdb (also on test machines).&lt;/DIV&gt;&lt;img src="http://sqlblog.com/aggbug.aspx?PostID=8605" width="1" height="1"&gt;</description><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/Backup/default.aspx">Backup</category><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/SQL+Server+2008/default.aspx">SQL Server 2008</category></item><item><title>Missing F8 or ctrl-N in SSMS 2008?</title><link>http://sqlblog.com/blogs/tibor_karaszi/archive/2008/08/26/missing-f8-or-ctrl-n-in-ssms-2008.aspx</link><pubDate>Tue, 26 Aug 2008 07:22:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:8567</guid><dc:creator>TiborKaraszi</dc:creator><slash:comments>8</slash:comments><comments>http://sqlblog.com/blogs/tibor_karaszi/comments/8567.aspx</comments><wfw:commentRss>http://sqlblog.com/blogs/tibor_karaszi/commentrss.aspx?PostID=8567</wfw:commentRss><description>&lt;P&gt;Short story: Turn on 2000 keyboard layout and then&amp;nbsp;back to Standard layout.&lt;/P&gt;
&lt;P&gt;Long story:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This topic has been discussed in both the MCT (MS Certified Trainer) as well as MVP groups. Also, see &lt;A href="http://sqlblog.com/blogs/andy_leonard/archive/2008/08/08/sql-server-2008-management-studio-function-keys.aspx"&gt;http://sqlblog.com/blogs/andy_leonard/archive/2008/08/08/sql-server-2008-management-studio-function-keys.aspx&lt;/A&gt;, including the comments.&lt;/P&gt;
&lt;P&gt;The mystery seems to be that in some cases you do have F8 and Ctrl-N in Standard layout, where in other cases you don't. For instance I did a check on&amp;nbsp;4 installations where one had the desired layout (with F8) and the others didn't:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;VPC. XP. Clean install. No prior SQL Server stuff. No F8 or ctrl-N.&lt;/LI&gt;
&lt;LI&gt;My laptop, XP. I have 2000, 2005 and 2008 tools as well as 2000, 2005 and 2008 instances installed. No F8 or ctrl-N.&lt;/LI&gt;
&lt;LI&gt;My desktop machine, Vista. I have 2005 and also 2008 instances. I have had 2005 SSMS which was uninstalled before I installed 2008 SSMS. Here both ctrl-N and F8 work.&lt;/LI&gt;
&lt;LI&gt;VPC. XP. Had 2005 both tools and instance which were upgraded to 2008. No F8 or ctrl-N.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;I was doing training on 2008 last week and I really needed to find my shortcut keys (I couldn't keep stumbling after menus all the time - too slow). So I switched to what I'm familiar with: the 2000 keyboard layout. I recall thinking for myself that perhaps if I now switch back I will have the desired Standard layout (F8 and Ctrl-N). I forgot all about it until today reading a post in the MVP group from Craig Beere suggesting exactly this. To confirm, I tried this in both a virtual machine (1 above) as well as my laptop (2 above) and it worked indeed. &lt;/P&gt;
&lt;P&gt;One thing to watch out for: There doesn't seem to be a way to go back to Standard layout *without* F8 and Ctrl-N. For instance when you get F8 etc, you also get a different shortcut for comment code (or was it uncomment?). So you might want to think a little bit before setting to 2000 layout and back. I'm sure in the end that somebody finds a setting somewhere to control the behavior - and then we know how to switch between the two Standard alternatives...&lt;/P&gt;&lt;img src="http://sqlblog.com/aggbug.aspx?PostID=8567" width="1" height="1"&gt;</description><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/Tools/default.aspx">Tools</category><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/SQL+Server+2008/default.aspx">SQL Server 2008</category></item><item><title>Make sure you play with data collector on a virtual machine</title><link>http://sqlblog.com/blogs/tibor_karaszi/archive/2008/08/25/make-sure-you-play-with-data-collector-on-a-virtual-machine.aspx</link><pubDate>Mon, 25 Aug 2008 16:42:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:8549</guid><dc:creator>TiborKaraszi</dc:creator><slash:comments>0</slash:comments><comments>http://sqlblog.com/blogs/tibor_karaszi/comments/8549.aspx</comments><wfw:commentRss>http://sqlblog.com/blogs/tibor_karaszi/commentrss.aspx?PostID=8549</wfw:commentRss><description>&lt;P&gt;I'm in a situation where I have configured the new data collector functionality for three instances. And there's no way to undo the config performed by the wizard! It cannot be undone by the wizard, and BOL doesn't have information on how to do this. In fact, I suspect that you in the&amp;nbsp;end need to use some of the undocumented data collector procedures to get rid of this configuration (like sp_syscollector_delete_jobs).&lt;/P&gt;
&lt;P&gt;I'm not knocking data collector per se - it seems like a great way to get a baseline going etc. But my tip is that while you are playing with it in order to understand it - do it virtually.&lt;/P&gt;
&lt;P&gt;Lara has reported this on connect, btw: &lt;A href="https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=334180"&gt;https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=334180&lt;/A&gt;&lt;/P&gt;&lt;img src="http://sqlblog.com/aggbug.aspx?PostID=8549" width="1" height="1"&gt;</description><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/Tools/default.aspx">Tools</category><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/Performance/default.aspx">Performance</category><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/SQL+Server+2008/default.aspx">SQL Server 2008</category></item><item><title>Backup compression in SQL Server 2008</title><link>http://sqlblog.com/blogs/tibor_karaszi/archive/2007/12/12/backup-compression-in-sql-server-2008.aspx</link><pubDate>Wed, 12 Dec 2007 15:52:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:3862</guid><dc:creator>TiborKaraszi</dc:creator><slash:comments>34</slash:comments><comments>http://sqlblog.com/blogs/tibor_karaszi/comments/3862.aspx</comments><wfw:commentRss>http://sqlblog.com/blogs/tibor_karaszi/commentrss.aspx?PostID=3862</wfw:commentRss><description>&lt;P&gt;Having a few moments to spare, I decided to give this a spin. &lt;/P&gt;
&lt;P&gt;Specifying for the backup to be compressed is really simple. Just specify COMPRESSION in the WITH clause of the BACKUP command. For example:&lt;/P&gt;
&lt;P&gt;&lt;CODE style="FONT-SIZE:12px;"&gt;&lt;SPAN style="COLOR:blue;"&gt;BACKUP&amp;nbsp;DATABASE&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:black;"&gt;Adventureworks&amp;nbsp; &lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;TO&amp;nbsp;DISK&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;'C:\Advc.bak'&amp;nbsp; &lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;WITH&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:black;"&gt;INIT&lt;/SPAN&gt;&lt;SPAN style="COLOR:gray;"&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:black;"&gt;COMPRESSION&lt;/SPAN&gt;&lt;/CODE&gt; &lt;/P&gt;
&lt;P&gt;For fun, I compared backup file size and backup time between compressing and not compressing. I ran below after priming the cache (not that it should matter since backup read pages from disk, see &lt;A href="http://sqlblog.com/blogs/tibor_karaszi/archive/2007/08/03/does-backup-utilize-pages-in-cache.aspx"&gt;http://sqlblog.com/blogs/tibor_karaszi/archive/2007/08/03/does-backup-utilize-pages-in-cache.aspx&lt;/A&gt;). I also deleted the backup files, if they exist, before execution.&lt;/P&gt;
&lt;P&gt;&lt;CODE style="FONT-SIZE:12px;"&gt;&lt;SPAN style="COLOR:blue;"&gt;DECLARE&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:#434343;"&gt;@dt&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:black;"&gt;datetime &lt;BR&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;SET&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:#434343;"&gt;@dt&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:magenta;"&gt;GETDATE&lt;/SPAN&gt;&lt;SPAN style="COLOR:gray;"&gt;() &lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;BACKUP&amp;nbsp;DATABASE&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:black;"&gt;Adventureworks&amp;nbsp; &lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;TO&amp;nbsp;DISK&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;'C:\Adv.bak'&amp;nbsp; &lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;WITH&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:black;"&gt;INIT &lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;SELECT&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:magenta;"&gt;DATEDIFF&lt;/SPAN&gt;&lt;SPAN style="COLOR:gray;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR:black;"&gt;ms&lt;/SPAN&gt;&lt;SPAN style="COLOR:gray;"&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:#434343;"&gt;@dt&lt;/SPAN&gt;&lt;SPAN style="COLOR:gray;"&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:magenta;"&gt;GETDATE&lt;/SPAN&gt;&lt;SPAN style="COLOR:gray;"&gt;()) &lt;BR&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;SET&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:#434343;"&gt;@dt&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:magenta;"&gt;GETDATE&lt;/SPAN&gt;&lt;SPAN style="COLOR:gray;"&gt;() &lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;BACKUP&amp;nbsp;DATABASE&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:black;"&gt;Adventureworks&amp;nbsp; &lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;TO&amp;nbsp;DISK&amp;nbsp;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;'C:\Advc.bak'&amp;nbsp; &lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;WITH&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:black;"&gt;INIT&lt;/SPAN&gt;&lt;SPAN style="COLOR:gray;"&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:black;"&gt;COMPRESSION &lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;SELECT&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:magenta;"&gt;DATEDIFF&lt;/SPAN&gt;&lt;SPAN style="COLOR:gray;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR:black;"&gt;ms&lt;/SPAN&gt;&lt;SPAN style="COLOR:gray;"&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:#434343;"&gt;@dt&lt;/SPAN&gt;&lt;SPAN style="COLOR:gray;"&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:magenta;"&gt;GETDATE&lt;/SPAN&gt;&lt;SPAN style="COLOR:gray;"&gt;())&lt;/SPAN&gt;&lt;/CODE&gt; &lt;/P&gt;
&lt;P&gt;Size of backup file is 129 MB vs. 35 MB. Of course, compression ratio varies depending on what type of data there is in the database (string data tend to compress better than other data,. for instance). Time to execute commands were 7.5 seconds vs. 3.8 seconds. Now, this is a virtual machine on VPC and Adventureworks is a tiny database. But at least we can see clear potential for savings here. &lt;/P&gt;
&lt;P&gt;So how do we know if a database backup was compressed? If you've used RESTORE HEADERONLY, you probably noticed this annoying column called "Compressed". Well, this is the first time we see a value of "1" in that column. &lt;/P&gt;
&lt;P&gt;It seems we cannot mix compressed and non-compressed backups on the same file, though. (Not that I often have multiple backups on the same file.) If I append a backup using COMPRESSION on a file were there already are non-compressed backup, I get an error. Or I do a backup without COMPRESSION on a file where there are compressed backups, the new backup will be compressed (even when not saying COMPRESSION). Something to look out for if you have several backups on the backup files.&lt;/P&gt;
&lt;P&gt;So what about the RESTORE command? Well, there's nothing to say, really. You don't have to specify in the RESTORE command that the backup was compressed. Time for RESTORE was 10.4 vs 6.3 seconds (with the destination database already existing). I expect the difference to be bigger on real installation and realistic db size.&lt;/P&gt;&lt;img src="http://sqlblog.com/aggbug.aspx?PostID=3862" width="1" height="1"&gt;</description><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/Backup/default.aspx">Backup</category><category domain="http://sqlblog.com/blogs/tibor_karaszi/archive/tags/SQL+Server+2008/default.aspx">SQL Server 2008</category></item></channel></rss>