Sunday, September 18, 2005
Last Sunday (Sunday, 11 September 2005), Brian A. Randell and Kimberly L. Tripp (me :), delivered a full day preconference workshop at the Microsoft Professional Developers Conference in Los Angeles. I was only down at the conference for the workshop but burried once I got back. Unfortunately, Brian and I didn't get our resources list together until this weekend. Sorry for the delay but I think you'll be happy with the final list of resources!
Sunday, September 18, 2005 2:51:21 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]  | 
Monday, September 05, 2005
This is a much needed and much overdue blog entry... In 8 Steps to Better Transaction Log throughput, I mentioned a customer that was helped by TWO typical optimization problems I see. In that blog entry, I said I would write two blog entries - that one on transaction log optimization and another on common tempdb optimizations. Well, I forgot...until I was reminded with an email this morning (thanks Marcus!).
Monday, September 05, 2005 10:28:03 AM (Pacific Standard Time, UTC-08:00)  #    Comments [5]  | 
Sunday, September 04, 2005
Part 5 is done and we're half way through the series. Another great series of questions from part 5 of 10 in the series titled: Effectively Designing a Scalable and Reliable Database. Looking forward to another session this Friday! Have a great holiday weekend/Monday (for those of you/us in the US)!
Sunday, September 04, 2005 6:41:41 PM (Pacific Standard Time, UTC-08:00)  #    Comments [3]  | 
Friday, September 02, 2005

Well...another custom Immersion Event ends........ four days, 12 modules, nothing but SQL Server 2005: internals, availability and tuning. This week I delivered a four-day course titled: Building Highly Scalable, Available and Reliable Systems with SQL Server 2005. The course was delivered for the SQL Server customer team - to a few of their top TAP (Technology Adoption Program) customers who are really pounding on SQL Server 2005. These customers have some of the largest implementations and/or some of the more interesting architectures - with high volume activity and/or large data warehouses. The course was quite intense, running from 9-5 each day with guest speakers starting at 5 and then evening events that started at 6:30/7 on Monday/Wednesday evening. We covered High Availaiblity Architectures, Recovery, Transaction Processing and Logging, Piecemeal Partial Database Recovery, Partial Database Availability, Partitioning, Online Index Operations, DMVs and much, much more! Everyone is in transit today...class was Monday through Thursday.

And - speaking of "evening events," Wednesday night was quite fun (except when I crashed the Kart). Despite the crash...I'll be back. It was great fun! Turned out that for the evening Ron took first, James took second and my good friend Gert took third. I'm pretty sure that Gert and I will be going back again soon as I want to creep up that scale and knock him off that stack. Despite the crash, I did have a few good lap times :). We'll be back!

Check out a picture of our group at the end of the night of Karting: ChampsKarting.JPG (243.31 KB)

So, all in all - it was a great week! Even more amazing, I think this group will stay in touch! We all learned a lot from eachother.

So - this blog entry is more of a "thanks" entry! A thanks to the excellent questions and all of the excitement around SQL Server 2005...it's getting close! And the architectures are real, working and in production...in fact, one of the customers in the class this week went live at 2am on Wed and a few others are already live.

Stay tuned! More SQL Server 2005 features to highlight and details about the upcoming launch and maybe I'll even blog a bit about Upgrade issues.

Friday, September 02, 2005 6:20:19 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]  | 
Tuesday, August 30, 2005
OK, so here are the technical questions answered from part 4 of the webcast series. Still 6 more sessions to go. See you on Friday!
Tuesday, August 30, 2005 9:41:42 PM (Pacific Standard Time, UTC-08:00)  #    Comments [2]  | 
Friday, August 26, 2005
Lots of questions in today's MSDN Webcast titled: Indexing Best Practices. And - lots of great resources to continue learning! To allow you to check out a few of the other resources right away, I'm posting this "Resources ONLY" part of the Q&A. Wow, talk about a lot of homework... Enjoy. :-)
Friday, August 26, 2005 1:43:20 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]  | 
And - here's the written Q&A from Part 3 of the MSDN Webcast Series: Effectively Designing a Scalable and Reliable Database, A Primer to Proper SQL Server Database Development. Part 3's focus was "Designing Tables that Scale, Best Practices in Data Types and Initial Table Structures." As for the Q&A, surprisingly, it's delivered before part 4...just barely! Lots of great questions (as usual!) and quite a few links and things to reference. Enjoy!
Thursday, August 25, 2005 11:09:11 PM (Pacific Standard Time, UTC-08:00)  #    Comments [3]  | 
Thursday, August 25, 2005
Most people I know - especially those who don't know a lot about Indexes (but even those who do :) - can't believe that I have a two-day class on NOTHING but Indexing... They ask me, "How can you talk about one topic for two days?" The scary part is my answer...
Thursday, August 25, 2005 7:43:42 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]  | 
Wednesday, August 24, 2005
The SQL Server Magazine's Reader's Choice Awards came out and "A First Look at SQL Server 2005 for Developers" took first place!
Wednesday, August 24, 2005 8:49:21 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]  | 
Monday, August 22, 2005
This is a PRELIMINARY DRAFT of a whitepaper slated to be released on MSDN. This whitepaper is only a draft and SQLskills/Microsoft make no claims or warranties to the accuracy within (or whatever the disclaimer is supposed to say :). Enjoy!
Monday, August 22, 2005 10:22:27 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]  | 
Saturday, August 20, 2005
Well, I thought the first Q&A log was a monster at 4 pages... this one is 11. LOTS of questions in the Aug 12th webcast on Creating an Effective Recovery Strategy. We talked about Recovery Models, Backup Types and Best Practices and you guys had a TON of great questions! I would also suggest reading the chapter for download on the homepage of SQLskills for some additional details about the Environment Basics that Effect Recovery. All of the session links and resources are listed in this blog entry. Enjoy! With all the resource links from this one - you'll be busy till next week (and/or when I get Part 3's questions completed).
Friday, August 19, 2005 11:33:58 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]  | 
Thursday, August 11, 2005
OK, I said that I'd post the Q&A from the session...over the weekend and well, it's well past the weekend cause it's Thursday. The next session (Part 2 of 10) is tomorrow and I'll be better posting these Q&As from here. Wow - you guys do ask a lot of questions though... ;)
Thursday, August 11, 2005 10:40:23 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]  | 
Thursday, August 04, 2005

Wow, I've been horribly bad at blogging these days and I owe you a few entries as well... But, good news, I have a new MSDN Webcast series that will help to answer a lot of best practices in database design strategies that can help you achieve better scalability, availability and reliability. All of my demos are on SQL Server 2005 but many of the concepts apply to both SQL Server 2000 as well as 2005.

The sessions are all targeted at best practices and as such we went with a base of 200 level. Knowing me I can't go through an entire session without some internals and/or technical depth so you should expect 200-300 overall. I'm very excited about this series because everything counts! What I mean is that each and every best practice you implement helps to bring about a more scalable, available and reliable solution - there are no magic bullets only great overall design can achieve these targets!

So, what are we going to talk about in 10 - 90 minute presentations..... a lot!

Here's a link to the first one and as we get rolling, I'll blog a lot more about additional resources, best practices and of course, I'll blog the webcast Q&A as I've done in the past.

Enjoy!

Thursday, August 04, 2005 7:09:46 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]  | 
Monday, August 01, 2005

Today, SQLskills proudly annouces an exciting addition to our company... Bob Beauchemin - a database developer and SQL Server 2005 expert in the developer space - joins SQLskills as the Director of Developer Skills. Bob brings a tremendous amount of expertise with him in having worked with computers since 1977 and a variety of databases during this time. In the time that I have known Bob, I have been impressed with both his technical expertise as well as his ability to convey complex topics with clarity. We've got quite a few things in the works and we'll keep you posted of the changes on our blogs and our SQLskills website.

In the interim, make sure to update all of your references for Bob! If you've subscribed to his blog in the past, update your links to his new blog site:

If you want to read a bit about his past, present and future, check out our AboutBob page here: http://www.sqlskills.com/aboutbob.asp

And, if you're interested in hearing the PodCast he recorded with SQL Down Under host Greg Low, check out: http://www.sqldownunder.com/. The specific downloads for Bob's recordings are here: SDU4FullShow.mp3 or here: SDU4FullShow.wma.

Exciting times indeed. Stay tuned!

 

Monday, August 01, 2005 10:01:55 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]  | 
Wednesday, July 20, 2005

Be sure to visit all the options under "Configuration" in the Admin Menu Bar above. There are 16 themes to choose from, and you can also create your own.

 

Tuesday, July 19, 2005 11:00:00 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]  | 
Friday, July 01, 2005

If you're not aware, there are two SQL Server 2005 contests running:

Connected Systems Developer Competition, Prize $50,000 USD
Click on the graphic for the link to the competition site:

 

Best Migration from Oracle to SQL Server, Prize - Custom Chopper (approx. $50,000 USD)
Click on the graphic for the link to the competition site:

GOOD LUCK!

Friday, July 01, 2005 12:42:25 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]  | 
Monday, June 27, 2005

Scott Stanfield, a Microsoft Regional Director, had a great idea for Tech*Ed US (well, it was a great idea before he knew exactly how much work was involved :)...

He decided that he would get other Microsoft Regional Directors together to discuss (and record) interesting topics for just 10 minutes (of course, some of us went over... SORRY!). We could pick anything we wanted and then he would - with the help of a few other RDs such as Scott Golightly, Patrick "Beach Master" Hynds, Kate Gregory, and J. Michael Palermo - record our sessions to later edit and post on the GrokTalk site.

So, after A LOT OF HARD WORK - they're done! All 35 of the GrokTalks are posted and you can find them on the GrokTalk site: http://www.groktalk.net/

Finally, since I delivered a GrokTalk on Stored Procedures, I'm going to make sure that you have a comprehensive set of resources related to stored procedure optimizations here:

Well, now that should keep you busy...

Enjoy!!

Monday, June 27, 2005 10:02:02 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]  | 
Saturday, June 25, 2005

On a few of my last trips, I've had the pleasure of doing a lot of customer visits - visiting some of the larger implementations of SQL Server. Many of these implementations are at banks where both performance and recovery are critical. After my trip to Turkey (where I did customer visits prior to presenting at the Microsoft Professional Developers Summit), I received this email:

As you might remember we talked at xxxbank, Turkey about performance problems in transaction log backups and splitting tempdb data file into equal size chunks equal to number of CPUs. I have implemented both optimizations in my troubled server, and the results are great! Transaction log backups do not impact the server at all and with lowered congestion in tempdb, overall system performance has gone up as well.

So - this is my first of two blog entries targeting these two VERY typical problems:
* Transaction log fragmentation (both internal and external - this customer was having problems with internal fragmentation)
* Optimizing TempDB

We'll start with 8 Steps to Optimizing your Transaction Log - not necessarily in any order. It's best to review all of these to make sure you have a comprehensive view of how to improve both performance and recovery of your transaction logs!

1) Try to dedicate the transaction log portion of your database to its own phyiscal disk. In high volume OLTP system, isolating the transaction log can allow the disk head to be ready for the next write by not having other files contend for the physical disk resource. If your database already exists, the best way to "move" your transaction log is to detach your database (sp_detach_db) and then reattach it (sp_attach_db). Here's a great KB article titled: Moving SQL Server databases to a new location with Detach/Attach.

2) Defrag the disk(s) on which your transaction logs reside. This will get rid of external fragmentation of the transaction log - better known as disk file fragmentation. This will require that your server be taken offline but if your files have had a lot of autogrowth and/or they reside on a disk with a lot of other files that have been modified, then all of your files (incl. the transaction log file) are likely to be interleaved and fragmented. The good news is that this is a one time operation (unless the files continue to grow and shrink excessively - but we'll fix that as well). The bad news is that you'll need to shutdown SQL Server and then use some form of system tool - Microsoft or third party - to defrag. On Windows XP and Windows Server 2003 machines, the disk defragmenter tool can be launched by running: dfrg.msc.

3) Create only ONE transaction log file. Even though you can create multiple transaction log files, you only need one... SQL Server DOES not "stripe" across multiple transaction log files. Instead, SQL Server uses the transaction log files sequentially. While this might sound bad - it's not. If you want to get better performance out of the transaction log, place it on faster disks and/or a more performant disk (RAID) configuration. You could place the transaction log on a RAID 0 array but you'll likely want fault tolerance as well as performance. Isolation, as per number 1 is a good start but if you also need increased capacity then using hardware based RAID to combine disks for both better performance and redundancy is your next choice. See 4.

4) Not only should you try to isolate the transaction log to its own physical disk but you should make sure that the logical/physical disk configuration is as efficient as possible. Try to use an isolated RAID 1 mirroring set if you don't need significant capacity. If you need a greater capacity OR you want better performance, consider a combination of RAID 0 and RAID 1 (either RAID 0 + 1 or RAID 1 + 0). While RAID 0 + 1 can often offer better performance, RAID 1 + 0 offers better reliability. If you're new to RAID and are interested in learning more - check out the RAID Tutorial here: http://www.raidarray.com/04_01_00.html.

5) Don't be caught up in nothing but transaction log speed, you'll also want to make sure that your transaction log is always available as this can help you in times of disaster. Even if the data is damaged, if the transaction log is available and you have a series of backups up to and including the last transaction log then you can make a final backup of the transaction log that will represent all of the changes since your last transaction log backup. If this backup is possible (it's called backing up the "tail" of the log), then you can achieve up-to-the-minute recovery. This is only possible when the log is available. By placing the log on mirrored disks you can increase your chances of recovering data and minimize data loss!

6) Create transaction log files with a reasonable initial size. When you create a database it's ideal to PRE-ALLOCATE both your data files and your transaction log file. A little bit of capacity planning goes a long way... Now, if you think that you've got absolutely no idea how to size your transaction log you're going to need, well - here are the things that have the greatest impact:

  • Type of activity - transaction processing or decision support
  • Frequency of that activity - the more frequent the changes, the faster the transaction log will grow
  • Recovery Model - the recovery model of the database
  • Frequency of transaction log backups
  • Whether or not replication is used (since the log reader relies on the transaction log)

I wish I could give you a rough idea on sizing but if you look only at database size and none of these other factors, you could end up with a transaction log that's seriously oversized or seriously undersized. I've seen recommendations of 10-25% of the size of the data and you can use that but I would also add a bit of common sense. A larger database with very frequent transaction log backups may not need a transaction log that's even 1% of the size of the data... The best way is to setup your development environment similar to that of your production environment (including backup jobs) and then see how the transaction log grows. If you have a lot of autogrowth (because your guess was wrong), you can later clean up the fragmentation that has occurred and get back to a reasonable, intact, and optimal transaction log. If you want to know more about Recovery Models and their impact on the transaction log, review a sample book chapter from an MSPress book (Microsoft® SQL Server™ 2000 High Availability) that I helped to co-author. I only helped out on a couple of chapters but this specific chapter explains a lot about the general database environment settings that impact recovery. You can download Chapter 9: Database Environment Basics for Recovery here: http://www.sqlskills.com/resources/SQLServerHAChapter9.pdf

7) Don't let autogrowth get out of control. As important as capacity planning, you're not likely to be spot-on in your estimates. I don't recommend completely turning off autogrowth but in general I also don't like SQL Server 2000's default growth rate (or max size). In general, I would recommend setting ALL of the transaction log files attributes: initial size, growth rate AND maximum size. For the growth rate, I recommend something that can be allocated somewhat quickly and something of a fixed size. In general, I recommend a value which is less than or equal to 1GB (based on total size) but something that doesn't mean that you're going to autogrow again soon. So, for databases whose transaction logs are under 1GB then you might set autogrow to somewhere between 20 and 100 MB. For those of you who have transaction logs measured in GB, then I'd set the autogrowth to 500MB or 1GB. In general, I don't like the percentage because it needs to be calculated (which I realize isn't really all that big of a deal) but the larger the file the larger the autogrowth and the longer it takes. In SQL Server 2000, autogrowth can create blocking...so, it's best to minimize this in general.

8) Check/fix your internal fragmentation. OK, so this is the one that really helped the customer in Turkey. Often, when transaction logs are not pre-allocated and/or when there's been a lot of autogrowths, the transaction log can become internally fragmented. Internally your transaction logs are broken down into smaller more granular chunks called VLFs (Virtual Log Files). The size and number of VLFs you'll have depends largely on the size that the chunk is when it's added to you transaction log. If you add a new chunk to the transaction log which is 20MB (through autogrowth or through manual growth) then the number of VLFs that are added is 4. If you add a chunk which is greater than 64MB but less than or equal to 1GB, you'll add 8 VLFs. If you add more than 1GB then you'll add 16VLFs. In general, most transaction logs will only have 20 or 30 VLFs - even 50 could be reasonable depending on the total size of the transaction log. However, in many cases what happens is that excessive autogrowths can cause an excessive number of VLFs to be added - sometimes resulting in hundreds of VLFs. Having an excessive number of VLFs can negatively impact all transaction log related activities and you may even see degradation in performance when transaction log backups occur. To see how many VLFs you have solely look at the number of rows returned by DBCC LOGINFO. The number of rows returned equals the number of VLFs your transaction log file has. If you have more than 50, I would recommend fixing it and adjusting your autogrowth so that it doesn't occur as fequently. To get rid of all of the execessive VLFs, follow these easy steps to shrink off the fragmented chunk and add a new, clean chunk to your transaction log:

1. Wait for an inactive time of day (ideally, it would be best to put the database into single user mode first) and then clear all transaction log activity through a regular transaction log backup. If you're using the simple recovery model then you don't need to do a log backup... Instead, just clear the transaction log by running a checkpoint.

 BACKUP LOG databasename TO devicename

2. Shrink the log to as small a size as possible (truncateonly)

DBCC SHRINKFILE(transactionloglogicalfilename, TRUNCATEONLY)

NOTE: if you don't know the logical filename of your transaction log use sp_helpfile to list all of your database files.

3. Alter the database to modify the transaction log file to the appropriate size - in one step

ALTER DATABASE databasename
MODIFY FILE 

      NAME = transactionloglogicalfilename 
    , SIZE = newtotalsize
)

And, that should do it!

Saturday, June 25, 2005 3:33:36 PM (Pacific Standard Time, UTC-08:00)  #    Comments [2]  | 
Friday, June 24, 2005

Many of you in the .NET Community are already familar with theServerSide.NET but many of you in the SQL Server community are not...well, here's your chance to bridge the gap over to .NET and hear a bunch of great .NET interviews! My interview is more SQL-centric but there are lots of great ones on Development in general and even one on SQL Server 2005 Reporting Services by Jason Carlson.

My interview was recorded with them back in February when I was speaking at VSLive in San Francisco and they've been saving them up, editing them and then posting an interview roughly each week (mine is the 29th posted!). The interview was great fun and Paul Ballard asked some really interesting questions about tuning, indexes, stored procedures and SQL Server 2005. Mostly it's an interview about optimization tips in both SQL Server 2000 and 2005 and just in general - things to look forward to in SQL Server 2005.

Here's a link to all of theServerSide.NET interviews: http://www.theserverside.net/talks/index.tss 
Here's a link specifically to mine: http://www.theserverside.net/talks/videos/KimberlyTripp/interview.tss?bandwidth=dsl
Here's the link to Jason Carlson's Reporting Services interview: http://www.theserverside.net/talks/videos/JasonCarlson/interview.tss?bandwidth=dsl and finally, here's a TechNet Webcast that Jason did titled: Authoring Reports in SQL Server 2000 Reporting Services (Level 200)

Enjoy!

Friday, June 24, 2005 10:09:59 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]  | 
Thursday, June 23, 2005

On Tuesday, June 21, I had the pleasure of assisting on a TechNet webcast delivered by Michiel Wories - a Program Manager from the SQL Server Development Team at Microsoft. My assistance was limited as I really just listened and helped answer some of the questions that came up during the session. In fact, there were a few of us fielding questions and in general, there seems to be a lot of excitement around this new tool. The focus of the webcast was a new utitlity called SQLCMD. SQLCMD is a command-line tool that replaces OSQL and allows a lot of new functionality, such as: parameterization, access to environment variables, complex scripts that connect and execute against multiple servers, MUCH better code page support, input scripts, output scripts and error handling within scripts. Well, you'll probably learn more if you just watch the webcast! Below are a bunch of resources related to SQLCMD, I hope you enjoy.

Michiel Wories webcast titled: Scripting in Microsoft SQL Server 2005 (Level 300)
Michiel Wories blog entry with all of his webcast demo scripts: http://blogs.msdn.com/mwories/archive/2005/06/21/scripting_webcast.aspx

As for additional resources:
I've written a couple of blog entries that related to new SQL Server 2005 tools and specifically SQLCMD here:
     SQL Server 2005 - Management Studio Scripting Options and SQLCMD (loving it!)
Click here for the full group of my SQL Server 2005 blog entries.

Click here for the full list of all TechNet on-demand webcasts.

Click here for the list of “Get Ready for SQL Server 2005” resources!

Last but not least, here are the blogs of the other MVP's who helped answer questions during the SQLCMD session - lots of great stuff to keep reading!
Louis Davidson, Steve Kass and Kent Tegels

Thursday, June 23, 2005 11:17:25 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]  | 

Theme design by Jelle Druyts

Pick a theme: