Happy Contribupendence Day

July 3rd, 2009 by Jeremiah Peschka

Last year, Jeff Blankeburg came up with the idea of Contribupendence Day. To save you from visiting Jeff’s site and reading another blog post, Contribupendence day is a day when we acknowledge the people who help out our community.

Mladen Prajdić - Mladen is slowly becoming better known in the SQL Server community, in large part because of SSMS Tools Pack. What many people don’t realize is that Mladen is a phenomenal SQL developer in his own right and is more than happy to share that knowledge via twitter and email. He even braved the time zone difference (he lives in Slovenia) and presented for the PASS Application Development virtual chapter. He is easily able to explain complex concepts and has alwasy been more than happy to share his knowledge with others.

Thomas LaRock - Tom helps out PASS as a member of the Board of Directors. He helps out the community as an active blogger and twitterer. Outside of blogging and tweeting, Tom is always a phenomenal voice of reason and is able to see both sides of a situation - both as a developer/DBA and from the perspective of business users.

Michelle Ufford - Michelle is a developer DBA with GoDaddy.com and an active member of the SQL Server community. In addition to being a blogger, she is heavily involved in the I380 Corridor PASS chapter, organizing the East Iowa SQL Saturday, and maintaining her index maintenance scripts at SQL Server Pedia. Michelle is active on twitter as sqlfool and is always willing to help out with SQL questions. Michelle has also been working heavily to start up the Performance virtual chapter for PASS.

Brent Ozar - Brent’s involvement in the SQL Server community never ceases to amaze. He blogs prolifically on his personal website, is the Editor-in-Chief of SQL Server Pedia, is building up the Virtualization virtual chapter of PASS, records podcasts, presents for user groups both in person and remotely, and is very active on twitter as BrentO. Brent is incredibly knowledgable about SQL Server, SAN configuration, T-SQL, and server consolidation and virtualization. He has always taken the time to help me understand SQL Server concepts and has guided my knoweldge as I’ve been learning more about performance tuning SQL Server and the underlying OS and disk structure.

All of these people happily contribute their knowledge and free time to make the SQL Server community a better place.

EDMPASS – July Meeting

July 3rd, 2009 by Colin Stasiuk

In July the Edmonton Chapter of PASS is going to have it’s 2nd meeting. Details below:

http://www.eventbrite.com/event/378687665

Please be sure to not only click the “Add to my calendar” but also the “Register” button so that we can plan accordingly for food and drinks. 

Date:  July 29th 2009
Time: 5:00 pm - 7:00 pm
Location: Stanley A. Milner library
Map: 7 Sir Winston Churchill Square
Meeting Room: 6th Floor - Room 7
Speaker: Colin Stasiuk
Topic: SQL Security Auditing Through The Ages

(Live Meeting Link to follow)

Agenda:
5:00 pm - Pizza and Socializing
5:30 pm - Sponsor Presentation
5:45 pm - Feature Presentation
6:45 pm - Wrap Up and Draws

Presenter Information:   Colin Stasiuk is an MCP, MCTS SQL 2005/2008, MCITP DBDEV, and MCITP DBA.  Currently, he is an independent consultant contracted to Vantix Systems and working for the Government of Alberta.  Colin is an accomplished Microsoft SQL Server DBA who has been working with SQL Server since 1996.  He is the founder of Benchmark IT Consulting  and is always willing to lend a hand with questions in many SQL Server community forums and via Twitter (http://twitter.com/BenchmarkIT) .  His specialties include SQL Server Administration, Performance Tuning, Security, Best Practice / Standards, Upgrades, and Consolidation.

Colin is a proud PASS member, President of EDMPASS, and is on the DBA Abstract Selection Team for this years PASS Summit

 If you haven’t signed up already at EDMPASS.com please do so now to receive meeting notifications, news, and updates from EDMPASS.

Hope to see you there.

[Post to Twitter]  [Post to Delicious]  [Post to Digg]  [Post to StumbleUpon] 

Star Search It Ain’t

July 3rd, 2009 by Tim Ford

So, you have something to say about the technology you dabble in?  You have a depth of knowledge?  Why keep it to yourself or only discuss it with the 8 people that read your blog?  Put together a Powerpoint presentation, get out to your local user group and SPEAK!

Fear of public speaking is not something that only *you* have to deal with.  When you get in front of a group and present they are rooting for you to succeed.  No one comes to a user group meeting hoping the speaker talent will fail.  You enter with a built in cheering section.  So long as you can get your point across you’re 80% there already.

Think of Powerpoint as a series of tubes a collection of Tweets, with pictures.  Keep the slides to 140 characters; flesh out the rest with notes that you discuss off-the-cuff, and use your local peers as a sounding board.  Even better, work with the leadership of the user group to put on a speaker talent show where only first time speakers present on topics that cover your particular area of interest.  At the end of the night the *winner* receives a glowing piece of swag and all the participants receive recognition and a slightly less glowing piece of swag.

Everyone wins: the participants gain experience, get friendly feedback, and work the sharp edge off their fears.  The audience learns new things.  The leadership does not have to pimp themselves for speaker talent that month.  WIN - WIN - WIN.

Who knows, from there you may get the itch to start speaking at other user groups, regional meetings, or perhaps national conferences. 

It all starts small though, and dents and dings are anticipated in your first attempts.  Heck, ever listen to Stephen Hawking’s early lectures?  Dude was analog.

Another Reason SQL 2000 should just go away! :)

July 2nd, 2009 by Colin Stasiuk

Quick without looking it up… what does this script do:

SELECT *
FROM   dbo.sysfiles 
WHERE  (status & 0×40) <> 0

So if you’re like me and don’t have all the bit compares memorized for all the tables you probably didn’t know that this is how (in SQL 2000) you would query the current database to find all the transaction log files. 

Every now and again I take for granted the major jump that was SQL 2000 to SQL 2005 and little things like this just show me how much happier I am working in a SQL 2005/2008 environment. 

Let me channel my inner Naughty By Nature here:

You down with DMV…. yeah you know me
You down with DMV… yeah you know me

(Sorry I’m still hurting from not winning SQL Fool’s Rap Contest  )

DAMN YOU  My humble congratulations to Steve “Flavor Flav” Jones

stevejones

Now if you were to come across this code:

SELECT * 
FROM   sys.database_files
WHERE  type_desc = 'LOG'

Wouldn’t you have a much better idea as to what the query is trying to accomplish?

Anyways just another (albeit small) reason why I’m glad to be leaving SQL 2000 in the past.

Enjoy!!

[Post to Twitter]  [Post to Delicious]  [Post to Digg]  [Post to StumbleUpon] 

Kevin Kline Tutorial on SQL Server Query Tuning

July 2nd, 2009 by Brent Ozar

Kevin Kline gave an hour-long presentation to the Nashville PASS Chapter on Query Performance Tuning.  He covered tips like NOCOUNT, SHOWPLAN, STATISTICS, and low-hanging fruit to make queries faster.

Get the Flash Player to see the wordTube Media Player.

Subscribing or Downloading the Podcast

If you have an MP3 player or a portable video player and you want to download our videos automatically, you can subscribe to our podcast feeds here:

You can also download this video to watch it later:

  • Digg
  • del.icio.us
  • DZone
  • DotNetKicks
  • Google Bookmarks
  • Ping.fm
  • Reddit
  • StumbleUpon
  • TwitThis

Columbus Give Camp is Just Two Weeks Away

July 2nd, 2009 by Jeremiah Peschka

The Columbus Give Camp is only two weeks away but it’s still not too late for both charities and volunteers to sign up.

GiveCamp is a weekend-long event where software developers, designers, and database administrators donate their time to create custom software for non-profit organizations. This custom software could be a new website for the nonprofit organization, a small data-collection application to keep track of members, or a application for the Red Cross that automatically emails a blood donor three months after they’ve donated blood to remind them that they are now eligible to donate again. The only limitation is that the project should be scoped to be able to be completed in a weekend.

During GiveCamp, developers are welcome to go home in the evenings or camp out all weekend long. There are usually food and drink provided at the event. There are sometimes even game systems set up for when you and your need a little break! Overall, it’s a great opportunity for people to work together, developing new friendships, and doing something important for their community.

At GiveCamp, there is an expectation of “What Happens at GiveCamp, Stays at GiveCamp”. Therefore, all source code must be turned over to the charities at the end of the weekend (developers cannot ask for payment) and the charities are responsible for maintaining the code moving forward (charities cannot expect the developers to maintain the codebase).

The deadline is July 8th, so get your charity proposals and volunteer submissions in!

The Best Thing I Learned At PASS

July 1st, 2009 by Kendal Van Dyke

Note: I'm writing this as part of the "Best Thing I Learned At PASS" contest. Why? Because if I win it's worth a free registration or hotel stay for the 2009 Summit, and I like free!

Let me start by making a small confession: I've never actually been to the PASS summit in person. So how in the world can I write about what I've learned? Because I've been there vicariously through the blogs and Twitter streams of people who were there last year. Thank goodness, because before the rise of blogging\social networking if you had asked me what happens at the PASS summit I would have said…I honestly don’t know what happens at PASS besides a bunch of technical presentations given by people who write books and magazine articles for a living. My ignorance about what PASS is became clear to me last November as I read about the daily keynotes, the community sessions, and the nighttime parties. I came to realize that PASS is about so much more than just sitting in technical presentations. It’s about learning from people just like you who are doing the same things as you do every day. It’s about uniting with your peers and meeting new people who share a common interest. It’s about escaping the daily workload to reenergize and reinvigorate the passion to do our jobs as best as we possibly can when we return. So even though I haven’t been to PASS in person, I’ve learned one important thing: For the sake of my career, I need to go to PASS. If I can figure that out without actually having been to PASS, just imagine what I’ll learn when I do go this year.

The Best Thing I Learned At PASS

July 1st, 2009 by Kendal Van Dyke

Note: I'm writing this as part of the "Best Thing I Learned At PASS" contest. Why? Because if I win it's worth a free registration or hotel stay for the 2009 Summit, and I like free!

Let me start by making a small confession: I've never actually been to the PASS summit in person. So how in the world can I write about what I've learned? Because I've been there vicariously through the blogs and Twitter streams of people who were there last year. Thank goodness, because before the rise of blogging\social networking if you had asked me what happens at the PASS summit I would have said…I honestly don’t know what happens at PASS besides a bunch of technical presentations given by people who write books and magazine articles for a living. My ignorance about what PASS is became clear to me last November as I read about the daily keynotes, the community sessions, and the nighttime parties. I came to realize that PASS is about so much more than just sitting in technical presentations. It’s about learning from people just like you who are doing the same things as you do every day. It’s about uniting with your peers and meeting new people who share a common interest. It’s about escaping the daily workload to reenergize and reinvigorate the passion to do our jobs as best as we possibly can when we return. So even though I haven’t been to PASS in person, I’ve learned one important thing: For the sake of my career, I need to go to PASS. If I can figure that out without actually having been to PASS, just imagine what I’ll learn when I do go this year.

Microsoft MVP 2009 for SQL Server

July 1st, 2009 by Jason Strate

I received an e-mail from Microsoft today presenting me with the 2009 Microsoft MVP Award for the work I’ve done with SQL Server.  I thrilled beyond believe to have this honor.  I think this means I should buy myself a new jet ski… is three of them really enough?

Thanks to everyone that has helped me as I’ve played with SQL Server over the years.  From my start at US Bank to my current role at Digineer there are so many people to mention that I’m afraid I’ll miss someone if I start listing people individually. 

Also… my ability to focus on anything today is gone.

When Did That File Get So Big?

June 30th, 2009 by Jason Strate

omg1 I haven’t blogged much since getting back from vacation.  It seems like a good restart after the two week hiatus would be to address an issue that has arisen countless times.  And while addressing it, I’ll put it into the DBADiagnostics database that I’ve blogged about a few times before.

Sudden File Growth

In a number of SQL Server environments that I’ve worked in there either isn’t a method for monitoring file size or the process is more of a rubber stamp morning check.  The DBA gets in and looks at the size of the files and if there isn’t a log of changes to update nothing is really done and changes aren’t investigated.

In most cases this won’t be a problem.  For instance, if you’ve gone out and pre-grown your data and log files to appropriate sizes then nothing will grow and there is nothing to see here.

In cases were the unexpected happens, though, database files can and will grow.  And in the worst of these cases, which only occur at night or on vacations, the files will grow to a point where there is no longer any disk space available.  And if your annual review is next week, this will happen to the log file and force your database offline.

Knowing Is Half the Battle

In these types of situations, I like to recall the last couple minutes of the GI Joe epos ides that I watched as a kid.  They almost always ended with the quote, “Knowing is half the battle!  Yo, Joe!”.  If I know that a file growth has happened then I can do something about it.

Now the best case is to know, monitor, and plan for upcoming file growths.  This is what might be called a best practice and if you’re not doing it I’d really recommend putting a process in place.  But we need to be prepared for the unexpected.  And even in the most best, rock solid environment, I’d recommend a file growth monitoring process.

The Solution

This procedure for the DBADiagnostics database differs slightly from previous alerts.  Instead of sending out an e-mail that aggregates all of the changes an error is raised for each file change in question.  This method was selected because this allows the process to be tool agnostic.

If the client has a log file monitoring process, then the error can be picked up that way.  Or if all of the alerts are generated from the SQL Server instances, then a SQL Agent Alert can be created to notify people about the issue.

USE [DBADiagnostics]
GO

IF NOT EXISTS(SELECT * FROM sys.schemas WHERE name = 'Monitor')
    EXEC('CREATE SCHEMA [Monitor] AUTHORIZATION [dbo]')
GO

IF OBJECT_ID('Monitor.FileGrowth') IS NULL
BEGIN
    CREATE TABLE [Monitor].[FileGrowth]
        (
        DatabaseName sysname NOT NULL,
        DatabaseFileName nvarchar(260) NOT NULL,
        FileSizeMB decimal(18,3) NOT NULL
        CONSTRAINT PK_MonitorFileGrowth PRIMARY KEY(DatabaseName, DatabaseFileName)
        )
END

IF OBJECT_ID('Alert.FileGrowth') IS NOT NULL
    DROP PROCEDURE [Alert].[FileGrowth]
GO

/*================================================================================
Procedure:    [Alert].[FileGrowth] 
Author:        Jason Strate
Date:        2007-11-14

Synopsis:
    Procedures monitors the size of each file for all user databases and tempdb.  In
    the event of file growrh for any of the monitored databases, a error is raised
    that can be captured through either tools monitoring SQL Servers log files or 
    through SQL Agent Alerts.
         

================================================================================
Revision History:
Date:        By            Description
----------------------------------------------------------------------------------
================================================================================*/
CREATE PROCEDURE [Alert].[FileGrowth] 

As

SET NOCOUNT ON

-- Validate that necessary error message exists
IF NOT EXISTS (SELECT * FROM master..sysmessages WHERE error = 70000)
    EXEC master..sp_addmessage  @msgnum = 70000, @severity = 12, @with_log = 'true', 
        @msgtext = 'File growth has occured in the database %s on the file %s.  The size has increased from %d to %d.  If the file growth was unplanned, please review for unexpected issues.', @replace = 'REPLACE'

-- Insert files for each database that are not currently being watched
INSERT INTO [Monitor].[FileGrowth] (DatabaseName, DatabaseFileName, FileSizeMB)
SELECT d.name, mf.name, CAST(mf.size as float)*8/1024
FROM sys.databases d
    INNER JOIN sys.master_files mf ON d.database_id = mf.database_id
    LEFT OUTER JOIN Monitor.FileGrowth fg ON d.name = fg.DatabaseName AND mf.name = fg.DatabaseFileName
WHERE d.state_desc = 'ONLINE'
AND source_database_id IS NULL
AND d.name NOT IN ('model', 'master', 'msdb')
AND fg.FileSizeMB IS NULL

-- Delete databases that no longer exist
DELETE FROM Monitor.FileGrowth 
FROM Monitor.FileGrowth fg 
    LEFT OUTER JOIN sys.databases d ON fg.DatabaseName = d.name
WHERE d.name IS NULL

DECLARE @FileGrowthDelta table
    (
    DatabaseName sysname
    ,DatabaseFileName nvarchar(260) 
    ,OldFileSizeMB decimal(18,3)
    ,NewFileSizeMB decimal(18,3)
    )

-- Update files that changed size and output delta rows
UPDATE fg
SET FileSizeMB = CAST(CAST(mf.size as float)*8/1024 as decimal(18,3))
OUTPUT INSERTED.DatabaseName, INSERTED.DatabaseFileName, INSERTED.FileSizeMB, DELETED.FileSizeMB
INTO @FileGrowthDelta
FROM Monitor.FileGrowth fg 
    INNER JOIN sys.databases d ON d.name = fg.DatabaseName 
    INNER JOIN sys.master_files mf ON d.database_id = mf.database_id AND mf.name = fg.DatabaseFileName
WHERE d.state_desc = 'ONLINE'
AND source_database_id IS NULL
AND d.name NOT IN ('model', 'master', 'msdb')
AND FileSizeMB <> CAST(CAST(mf.size as float)*8/1024 as decimal(18,3))

--Declare variables section for triggering error event
DECLARE @DatabaseName sysname
    ,@DatabaseFileName nvarchar(260) 
    ,@OldFileSizeMB int
    ,@NewFileSizeMB int

--For each database name in sysdatabases
DECLARE ALTER_FILE_GROWTH_CURSOR CURSOR LOCAL FAST_FORWARD FOR 
    SELECT DatabaseName 
        ,DatabaseFileName 
        ,OldFileSizeMB 
        ,NewFileSizeMB
    FROM @FileGrowthDelta

OPEN ALTER_FILE_GROWTH_CURSOR
FETCH NEXT FROM ALTER_FILE_GROWTH_CURSOR INTO @DatabaseName, @DatabaseFileName, @OldFileSizeMB, @NewFileSizeMB

WHILE @@FETCH_STATUS = 0
BEGIN
    RAISERROR(70000, 0, 1, @DatabaseName, @DatabaseFileName, @OldFileSizeMB, @NewFileSizeMB) WITH LOG
    FETCH NEXT FROM ALTER_FILE_GROWTH_CURSOR INTO @DatabaseName, @DatabaseFileName, @OldFileSizeMB, @NewFileSizeMB    
END

CLOSE ALTER_FILE_GROWTH_CURSOR
DEALLOCATE ALTER_FILE_GROWTH_CURSOR
GO

EXEC [Alert].[FileGrowth]

In the next post, I’ll outline the process that I use to check to see if there are any files that may need be running out of available space.