Author: way0utwest

  • What’s Using Space in Tempdb?

    It happens, not often, but I do regularly see people talking about their tempdb growing too large. Often that means that people have not properly sized tempdb to me, but there could be legitimate reasons why it’s grown large.

    This is one reason that I’d like to see a separate tempdb for each database, a way that would allow us to better understand what level of resource usage is needed by a particular database.

    So how do you determine what’s using tempdb? I found this great entry in Books Online, Troubleshooting Insufficient Disk Space in tempdb, that contains a bunch of queries to help you determine what’s wrong. There’s one to get the free space

    SELECT SUM(unallocated_extent_page_count) AS [free pages], 
    (SUM(unallocated_extent_page_count)*1.0/128) AS [free space in MB]
    FROM sys.dm_db_file_space_usage;

    and one that finds the longest running transaction

    SELECT transaction_id
    FROM sys.dm_tran_active_snapshot_database_transactions
    ORDER BY elapsed_time_seconds DESC;

    and one that looks at the usage by session

    CREATE VIEW all_task_usage
    AS
    SELECT session_id,
    SUM(internal_objects_alloc_page_count) AS task_internal_objects_alloc_page_count,
    SUM(internal_objects_dealloc_page_count) AS task_internal_objects_dealloc_page_count
    FROM sys.dm_db_task_space_usage
    GROUP BY session_id;
    GO

    There are a few more, but if you’re wondering what’s happening in tempdb, this is a good article to go through and use some of these queries to diagnose what’s happening on your instance.

  • When it rains…

    It pours.

    I come back from 4 days unwired, a bunch of writing done, to a laptop that’s head, a site that won’t take posts, and a ton of email and articles.

    At least my external HDD reader is reading the drive. I’m copying stuff off now, but it’s not a good day for me in the computer world.

    Looks like I need a new laptop, but with cyber Monday, it seems that so many sites are down. I can’t get the HP or Lenovo sites to respond.

    Grrrrrrr

  • Unwired

    I didn’t have Internet access for 4 days while we were in the mountains. Actually I could have purchased it, but for uploading blogs it didn’t seem like a great idea. Plus I’d be tempted to work if I did that.

    So I did some offline blogging, but for the most part did nothing but hang out. It was good to get away, but lots of work today.

  • Picking a Branch

    Do you know that there are actually two branches of SQL Server 2008 code right now? Actually I would bet there are 3 branches, but we have two publically available branches to choose from:

    • The RTM branch
    • The Service Pack 1 branch

    I’ve known this for awhile, but haven’t thought about it. I read a post recently by Glenn Barry, who noted that CU5 for SQL server 2008 had been released. However this is only for RTM. If you have already installed SP1, then you would actually be looking for the CU2 for SQL Server 2008 SP1.

    These both contain similar fixes, like this one:

    972687 (http://support.microsoft.com/kb/972687/ ) FIX: Error message when you restore a SQL Server 2000 database by using SQL Server 2005 Management Studio or SQL Server 2008 Management Studio: "Cannot show requested dialog. Failed to retrieve data for this request (Microsoft.SqlServer.SmoEnum)"

    Glenn mentions an interesting item in that mainstream support for SQL Server RTM will end next year, so that you might want to think about SP1. I’m not sure that’s true based on the Product Support page, but it’s hard to read into it. The lifecycle support page also says that support ends 12 months after the next service pack is released. Assuming Release Services sticks to their 1 SP a year and we should see SP2 in the Mar/April timeframe, which would mean that SP1 and SP2 would be supported, RTM phasing out.

    I’d recommend that you pick the SP branches and stick with them, keeping fairly current, applying at least one a year. So if you haven’t applied SP1 yet, I’d plan on doing it by the end of Q1 2010.