Welcome to TechNet Blogs Sign in | Join | Help

SQL Server 2005 SP2 News from Paul Randal

Thanks to Mohammed Sharaf, who passes along this post from Paul Randal’s blog regarding a corruption issue people are running into in SQL Server 2005 SP2.  Here’s the money quote:

The situation is this: a table with a non-unique clustered index (i.e. so a hidden uniquifier column is created), and then rebuilt using DBCC DBREINDEX. Sometimes an incorrect query plan is chosen so the rows in the index get sorted incorrectly. A subsequent DBCC CHECKDB (or DBCC CHECKTABLE) will return errors like:

Msg 2511, Level 16, State 1, Line 1
Table error: Object ID 2073058421, index ID 1, partition ID 72057594044678144, alloc unit ID 72057594048348160 (type In-row data). Keys out of order on page (1:16042), slots 47 and 48.

The workaround is to use the new ALTER INDEX command in 2005 to do the rebuild (remember that DBCC DBREINDEX is deprecated). There's also a hotfix available in CU9 (and the upcoming SP3 I guess). Checkout KB 954734 here for details.

Thanks, Paul and Mohammed, for getting the word out..

     -wp

Back In-Country: Greetings From JFK

Greetings from the Delta terminal at JFK Airport in beautiful South Ozone Park, NY, where I’m currently laying over on my way back to Orlando.  As I was getting up at 6am Barcelona time, my wife was watching Friday night’s episode of David Letterman back home in Florida.  Time zones are certainly amazing things.

Through a happy coincidence of scheduling, my flight from Barcelona came directly to the States.  I was thus spared a direct personal impact from the Air France pilots’ strike, which saw every flight from Barcelona to Paris cancelled today.  Sometimes it’s better to be lucky than good.

It’s great to be back in-country, and I’m very much looking forward to being home later this evening.  I very much enjoy the opportunities these conferences provide to meet and learn from new people (and, perhaps, to allow them to learn a thing or two from me), but homecomings are even better.

For the first time since I went mobile,  I don’t know when my next air flight will be.  Oddly enough, that’s okay with me.

My flight for Orlando is about to start boarding so it’s time to stow the laptop and get ready for the last leg of what’s been a marvelous but tiring journey.  I’ve got some new pictures of Barcelona that I’ll post just as soon as I’m rested.

Thanks to all who make TechEd EMEA such a great experience: the organizers, my track owner Gunther Beersaerts (an incredibly wise and patient man), and above all the delegates, whose passion, creativity, and thirst for knowledge are what the conference is all about.

I hope to see all of you next November in Berlin!

     -wp

A Note to the Attendees of Today’s “SQL Tricks” Session

During today’s session, many of you were sufficiently interested in the “versioning of database components” trick that I offered to post the deck from last year’s session here on the blog.

Well, I’ve looked at the deck and it’s frankly a little thin.  What I need to do is take the scripts from that demo (which were run on a copy of a fairly large development database) and work up a compact demonstration that I can upload here along with the deck, so that you get the full picture of the techniques without being distracted by other issues.

That’s something that will take me a little bit of time to accomplish.  I hope to have the demo and the deck uploaded here for you sometime next week.

Please accept my apologies for the delay, along with my thanks for your patience and your enthusiastic participation in today’s session.

     -wp

What’s The One Thing A Technical Presenter Doesn’t Need?

A case of laryngitis.

Yup.  As I mentioned yesterday, my voice got a little flaky towards the end of yesterday’s SQL Tricks presentation here at TechEd EMEA 2008 Developers.  By the time I got back to the hotel to call Gale and the family, pretty much all I could do was click and squeak.

Not a great situation.

A combination of hot baths, warm salt water gargles, hot tea, Aleve, and silence (the last by far the most difficult) at least got me to the point where I was able, with the aid of a microphone, to communicate in an amplified croak during today’s Real-World Indexing Strategies presentation.  I was very apprehensive about this state of affairs, which turned out to be needless.  The delegates in attendance were remarkably understanding of my circumstances and very generous in their comments.

Indeed, the primary issue with the talk was that I had another 30 minutes’ or so worth of material left when we concluded.  I think in the future I’ll either schedule 2 hours for this session, or split it into two 75-minutes sessions and go a little slower (one of the attendees commented that there was a lot of material to assimilate and that the session felt somewhat rushed; I have no problem agreeing with that assessment).

Tomorrow I’ll be offering my final presentation, the second offering of SQL Tricks, at five o’clock local time.  Hopefully my voice will by then be back from its brief European vacation.

More soon..

     -wp

My Favorite Pieces of Feedback for “SQL Tricks” So Far

Microsoft is constantly looking for ways to improve the experience of both presenters and delegates at TechEd.  Since last year, the feedback system has been enhanced to the point where I’m now able to see my attendees' evaluations, including comments, in near real-time.

The gifts, of course, are in the actionable feedback (one reviewer said I “was repetitive with [my] phraseology to the point of being marginally annoying”; THANK YOU to whoever wrote that and rest assured I’ll fix it!), but my favorite comment so far is:

Lots of new and interesting tricks and techniques. Speaker was clearly the Chuck Norris of SQL.

It’s a great day when a compliment makes you laugh out loud..  my thanks also to the person who wrote that!

More to come..

-wp

Hello From Barcelona

Greetings from the Speakers’ Lounge at the Centre Convencions Internacional Barcelona, where TechEd EMEA 2008 Developers is in full swing.  Over 3,000 developers from all over the region have gathered to share and learn best practices for the care and feeding of their Microsoft solutions.

I’ve got a very full dance card this week.  In addition to spending about 12 hours in various booths on the convention floor, I’m presenting three interactive sessions this week.  I completed the first offering of SQL Tricks: Insights from Microsoft IT about forty-five minutes ago.  Other than clicking an incorrect button and accidentally shutting down SSMS three times during the demos, and losing my voice for the last five minutes, it went very well.  I’ve been very anxious to give this presentation.  I wrote it six months ago for TechEd US, which I was unable to attend due to health issues.  It was offered as both an interactive session and a hands-on lab in Orlando, and was also presented at TechEd Australia.

Tomorrow I’ll be presenting Real-World Indexing Strategies from Microsoft IT, and Thursday I’ll give a second presentation of SQL Tricks.

Alas, the likelihood of my repeating last year’s extensive tourist activities is fairly remote; this is very much a working week for me.  I’m hoping to get back to La Font de Canaletes again, but even that modest ambition may be thwarted.  I’ll of course keep you posted on my progress.

I hope your week is going well, wherever you are..

     -wp

Posted by Ward Pond | 1 Comments

Scripts for “SQL Tricks: Insights from Microsoft IT”

I’ve attached to this message a ZIP file of the scripts from the SQL Tricks: Insights from Microsoft IT presentation I’m giving in Barcelona this week.  The tricks will be familiar to long-time denizens of this space, as they’ve all been discussed here before; I hope the provision of sample scripts demonstrating each technique will make them even more useful to you.

As always, please let me know if you have any questions or suggestions.

     -wp

Cross-Database Connectivity: An Answer For Kyle

Kyle Schoonover, a former colleague in MSIT, posed the following questions in a comment on October’s cross-version database attachments post:

Ward, I'm currently working in MySQL and writing conversion scripts to convert a MySQL database to a SQL 2005 database.  I have also been using OpenQuery to query through a linked server from SQL 2005 to MySQL.  I was wondering if you could comment on a way to possibly use DTS to transfer data from a database that is not readily supported like MySQL.

Also is there something better than using OpenQuery to create dynamic SQL to run against a linked server database that runs on MySQL.

It’s always great to hear from Kyle, who is a very sharp SQL guy.

Rather than using DTS for this purpose, Kyle, I suggest you look into SQL Server Integration Services under SQL Server 2005/SQL Server 2008.  It should be a trivial task to build a connection to your mySQL instance (ODBC, if all else fails); you’ll then have access to the full ETL capabilities of SSIS.  I’m aware people accessing Oracle and Teradata databases via SSIS using this technique, so I don’t think mySQL should be an issue.

To your second question, if you’re thinking of portable T-SQL code, I think OpenQuery is probably the best way to go.

Great to hear from you, Kyle, and I hope we can hook up next time I’m in the Pacific Northwest!

     -wp

Microsoft Assessment and Planning Toolkit 3.2 Now Available

The Microsoft Assessment and Planning (MAP) Toolkit 3.2 makes it easier for customers and partners like you to quickly identify what servers, workstations, and network devices are in your IT environment. MAP also provides specific and actionable IT proposals and reports to help you get the most value out of Microsoft products and infrastructure. Over 510,000 Microsoft customers and partners have already downloaded and used MAP and its prior versions including Costco Wholesale Corporation, Continental Airlines, and Banque de Luxembourg.

Full details of the announcement may be found here.  You can download the tool here.

MAP is a scalable and agent-less assessment platform designed to make it easier for you to adopt the latest Microsoft technologies. In this version, MAP has expanded its assessment capabilities to include SQL Server 2008, Forefront/NAP, and Microsoft Online Services migration, as well as providing a Power Savings assessment to help you “go green.”

MAP 3.2 assessment areas now include:

  • SQL Server Database Instance Discovery (NEW!)
  • Microsoft Online Services Needs Assessment and Survey (NEW!)
  • Forefront Client Security/NAP Readiness Assessment (NEW!)
  • Power Savings Calculator (NEW!)
  • Virtualization Infrastructure Assessment (e.g. reporting the mapping of hosts by guests) (NEW!)
  • Windows Server 2008 Hardware Assessment
  • Server Consolidation Reports and Proposals (Hyper-V or Virtual Server 2005 R2)
  • Windows Vista and Microsoft Office 2007 Hardware Assessment
  • Desktop Security Assessment to determine if desktops have anti-virus and anti-malware programs installed and up-to-date, or if the Windows Firewall is turned on

My work on the SQL Risk Assessment Program has further driven home to me the power that automated discovery has for our customers.  Whether it’s drilling into a set of SQL Server instances (as SQL RAP does), or inventorying an entire environment (as the MAP Toolkit does), automated discovery and related, targeted remediation IP is allowing our expertise to scale in many new and exciting ways.

I hope you’ll check out this powerful new tool!

     -wp

Cumulative Update Package 10 for SQL Server 2005 SP2 Released

Cumulative Update Package 10 for SQL Server 2005 Service Pack 2 is available for download here.  Microsoft recommends that you apply this update package only on instances which are experiencing one of the issues described in the linked article.

If you need these fixes, here they are..

     -wp

Cross-Version Database Attachments, DBCC UPDATEUSAGE, and UPDATE STATISTICS

One of the great things about working at Microsoft is one’s ability to eavesdrop on interesting conversations among smart, knowledgeable people via our technically focused internal discussion groups.  Material adapted from these conversations has been posted here on more than one occasion, and so it is again this evening thanks to the kind consent of Sunil Agarwal and Campbell Fraser.

SQL Server users are frequently interested in porting databases from one platform to another via either sp_attach_db (deprecated in SQL Server 2005) or CREATE DATABASE.. FOR ATTACH.  With database backups from SQL Server 2000 and earlier, there was a known issue with page and rowcount data in catalog views occasionally being inaccurate.  The workaround for this issue is to run DBCC UPDATEUSAGE and update table statistics after the database is attached to the new SQL Server 2005 or SQL Server 2008 platform.

SQL Server 2005 databases don’t suffer from this limitation.  So, if you’re attaching a SQL Server 2005 database to a SQL Server 2008 instance, there’s no need to run DBCC UPDATEUSAGE, or to update table statistics, after the attach operation is complete.

Thanks to Sunil and Campbell for sharing this information and consenting to its publication here..

     -wp

I've Finally Taken The Technorati Plunge

UPDATED 23 October 2008: I've moved the button to the title bar for now until I can come up with some slick code to get it higher up on the left-hand side.  Stay tuned..

 I've added a Technorati Fave This Blog button to the News section on the left-hand side.  Add to Technorati Favorites

Feel free to vote early and vote often, with my thanks.

     -wp

Posted by Ward Pond | 2 Comments
Filed under: ,

Tech·Ed EMEA 2008 Developers Session Schedule Released!

Earlier this week, I got my session schedule for my talks at this year’s Tech·Ed EMEA 2008 Developers in Barcelona.

  • DAT04-IS, SQL Tricks from Microsoft IT, will be offered on Tuesday, 11 November from 1:30pm until 2:45pm.
  • DAT03-IS, Real-World Indexing Strategies from Microsoft IT, will be offered on Wednesday, 12 November from 3:45pm until 5:00pm.

If enough of you sign up for these sessions, additional offerings will be scheduled.  I hope to see you in Barcelona!

     -wp

Log Buffer #118: a Carnival of the Vanities for the DBA

UPDATED 16 Oct 2008 to fix a broken link. 
UPDATED 10 Oct 2008 to reflect Giuseppe's comment.
 

Welcome to installation #118 of Log Buffer, the weekly review of database blogs.  Today, we’re gonna party like it’s 1999!

For those of you who might be new to this little corner of the Internets, my name is Ward Pond, and I’m a Technology Architect for the Microsoft Services Managed Solutions SQL Server Center of Excellence.  My responsibilities include development of best practices and training materials around OLTP design, development, and operations, as well as Business Intelligence.  Before taking this position, I was a database application designer/developer and support person for 28 years, with most of that spent at Microsoft and a Fortune 50 petrochemical company.

Remember Vulcan?  I do.

With apologies to Prince, why am I partying like it’s 1999 in this post?  Because in June of that year, I surrendered my platform neutrality and went to work in Redmond.  Since the Log Buffer series is database-neutral, I jumped at Dave Edwards’ invitation to contribute an entry – it offers a great motivation to revisit platforms I haven’t used extensively since.. well..  the last millennium.

So, with the introductions out of the way, let’s party..

Over at The Pythian Group (Log Buffer’s home base), Grégory Guillou wonders how fast your data can be with Oracle’s Exadata.    He offers a SQLPA script to estimate its impact on a sample query.  It’s very interesting stuff, but it should be noted that Grégory ends his article characterizing the predicted 100% improvement as “a bit optimistic” (a workload metric changing from 80388096 to 0 certainly qualifies as “a bit optimistic” in my book) and remarking that he only needs USD$140,000 for an Exadata box on which to test his theory.  Sorry, Grégory, but I’m tapped out at the moment..

Gerwin Hendriksen notes the Exadata isn’t for everybody, and offers a good list of reasons why, including high cost and niche applicability.  He’s even got pictures of the machines from Oracle Open World at the Moscone Center which he nearly ran afoul of a security guard to get.  Later in the week, he points out some issues with the Oracle data cache.

Giuseppe Maxia, the Data Charmer, has a couple of interesting mySQL-related posts this week.  In one, he searches for responsible uses for Federated tables; in the other, he discusses the new Event Scheduler in mySQL 5.1.

At the datacharmer's other lair, this one over at Sun, he laments the current dearth of “daring” proposals for the pending mySQL Conference and Expo.  One of the comments to this post notes, “a big part of that is probably due to the delays in 5.1 (and thus 6.0 and 7.0). Some of the really cool things that came out 2 conferences ago are not out yet because they all depend on 5.1.”  This scenario is certainly a major challenge to a community development model, where great ideas can languish as proposals for a long time.

Slashdot notes the resignation of MySQL’s co-founder from Sun.  Cause and effect?  Also, read the comments on this post for a primer on the pitfalls of betting corporate data assets on an open source platform.

Matt Reid has a parallel mysqldump backup script that he’d like your help testing.

Denis Gobo has an interesting discussion regarding alternatives for storing IP addresses.  If space and programmability are key for you in this space, there are some great insights here.  The code is all T-SQL but the techniques should apply cross-platform.  Denis also has an interview with Denny Cherry this week.

Euan Garden is one of those people who makes me smarter whenever I’m lucky enough to share a room with him.  This week, he’s got a pointer to the new high performance SSIS loaders for Oracle and Teradata.  If you Oracle and Teradata DBAs haven’t checked out this tool, this news provides an ideal motivation to do so.  Most people who try SSIS are hooked..

The PSS SQL Server Support Engineers report that Microsoft has updated support policies for SQL Server installations running in hardware virtualization environments.  Mark Pohto, my former manager in the SQL CoE (a great guy and a fellow musician), is now leading a huge virtualization effort within Microsoft, and there’s been a steady wave of virtualization-related emails moving through my inbox lately.  Virtualization is going to be a key component in managing TCO and overhead; you’d be well served to get out in front of this wave if your organization is at all concerned with controlling costs (and these days, who isn’t?).

Mosha Pasumansky checks in with two posts and a wrap-up from this year’s Microsoft BI conference.  Project Gemini is the big news, of course, but there is some very cool work going on in the Excel and SharePoint spaces as well.

By the way, if you're looking for a great SharePoint blog, check out my CoE colleague Mike Watson's entry on blogs.msdn.com.  Mike's also a great guy, also a fellow musician, and one of the smartest SharePoint guys on the planet.

Paul Nielsen points out the folly of “denormalizing for performance” in his latest post.  This is a topic very close to my heart, as I taught data modeling to four groups of MCA: Database (“SQL Ranger”) candidates.  Full normalization was a surprisingly hard (but ultimately successful) sell in each of these groups.  Getting these design skills out into the world is a very important prerequisite to unleashing the full power of our technology.  For the record, I agree with Paul’s contention that a typical fully normalized schema (properly indexed) will outperform a denormalized schema.  However, there is enough poorly designed schema loose in the world that we’re never going to escape the need to deal with it.

David Reed, who I first met when he came through SQL Ranger training, has a post out on the SQL Heroes blog touting the latest finalist in the community coding competition.  This week’s contender is a highly granular CLR-based time measurement facility written by Gorm Braarvig of Norway.  Good luck, Gorm!  Including Gorm’s project, there are currently five finalists up on the site.

Brent Ozar has a very funny post linking to Robert Cringely’s prediction that cloud computing will “kill” databases.  Brent struggles with both the prediction and a modicum of self-loathing for exposing himself to it at all (“Note to self: it’s my own fault for reading Cringely’s column in the first place.  He’s like the Enquirer of IT.”).  The picture of Brent in “Hulk Hands” (one of my younger grandson’s favorite toys) is, for me, just the cherry on top of a fine presentation.  Brent is now added to my list of people I need to meet.

Tony Rogerson’s latest rambling on SQL Server (it’s the name of his blog, not a value judgment on my part) involves programmatically escaping double-quote characters out of source files for bulk inserts.  A very simple and useful technique if you’ve got need of it, although it should be noted that Tony himself suspects that a better approach may be available.

Arnie Rowland’s latest “Rambling of a Harried Technogeek” ponders the applicability of SQL Server to an EAV scenario.  Arnie’s concern that the approach may be detrimentally elegant will be familiar to long-time visitors to this space.  One of the lessons our business teaches us is that the ability to do a thing doesn’t necessarily make it a good idea; indeed, Arnie’s plaintive question at the end of his post could inspire a volume of books: “when does something that is elegant from one perspective become burdensome and inelegant from another?”  My answer would start with, “when it’s difficult for the average geek to maintain,” but that’s clearly just the tip of a very slippery iceberg.

Craig Freedman’s blog, which I last commended to you for its outstanding 2006 series on JOIN semantics, has a marvelous post on random prefetching.  One of the hallmarks of Craig’s writing is that he’s always sensitive to the fact that a good idea in one scenario can be a bad idea in another, which leads to incredibly helpful insights such as, “For systems with many hard drives, random prefetching can dramatically improve performance.  However, prefetching can adversely affect concurrency as I explained in this post.

Microsoft MVP Uri Dimant’s Dimant DataBase Solutions blog has a great reminder about limiting the scope of index rebuilds, and some code to help you do that.

My admiration for Kim Tripp knows no bounds; as I’ve noted previously, she gave me some great advice several years ago which was instrumental in moving my career onto its current path.  Her latest blog post is a link to a RunAs Radio interview titled Kim Tripp Indexes Everything.  She disavows the title, but not the concept; if you’ve had the privilege of sitting in one of query tuning classes, you know how profoundly a sound indexing strategy can impact SQL Server query performance.  In fact, I’ll be presenting on this very topic at TechEd Developers EMEA in November.

Finally, the world lost one of its most distinctive and iconic voices with the recent passing of George Carlin.  Check out the intro video at his website (don’t click “skip intro”!), which for some reason recalls in my mind the boot-up sequence for a circa-1999 laptop.  Perhaps you’ll also be inspired by his final instructions, which appear when the video completes.  I know I was.  An excerpt:

I prefer a private gathering at my home…  The exact nature of this gathering shall be determined by my surviving family...  It should be extremely informal, they should play rhythm and blues music, and they should laugh a lot.

Amen to that.

Thus concludes my initial foray into the Log Buffer.  Hopefully, all of these structures have successfully flushed to disk for you, and your transactions are in a consistent state.  With that, I’ll pass the torch back to Dave Edwards at Pythian, with my sincere thanks to him for the invitation to write, and to you for your time in reading.

                -wp

More On Machine Translation: A Response for Hugo

No, that's not "moron machine translation", but if you read Hugo Kornelis' candid and very helpful comments on Tuesday's Windows Live Translator post, you're certainly aware that machine translation (MT) has its pitfalls.

The pun in the paragraph above is a good example of the challenges faced by MT.  English-speaking readers might stifle a small chuckle (they perhaps are more likely to fail in their efforts to suppress a groan and accompanying roll of the eyes) at my play on the homonyms "more on" and "moron," but unless these terms translate to homonyms in other languages (an unlikely state of affairs), the joke likely loses something -- perhaps everything -- in the translation.

MT works best on professionally authored content -- short, crisp sentences with good grammar -- and even then the results aren't always perfect.  Blogs tend not to be edited to such high standards; many of them, including this one, are authored with a strongly colloquial voice.  This aspect is usually lauded as a virtue of the blogging model, but it does tend to limit the utility of MT tools run against blogs.

The good news in this scenario should come as no surprise to those of us in the database business.  An MT application is only as good as its underlying databases, and one of the Windows Live Translator team's motivations in releasing these products for public consumption at this stage is to get more data for their databases -- just the sort of feedback Hugo offers.  They've set up a feedback website which reports directly to the Live Translator team; I've added a link to the site under my Windows Live Translator link to the left (for you web-based viewers).  I've also added a Machine Translation tag to the blog to group this conversation.

The Windows Live Translator team is actively pursuing sources for data for their databases.  They already get monthly refreshes of localized content from Microsoft product groups, and there are plans afoot to set up a sort of "translation Wiki" where customers can suggest translations.  After a sufficient number of solid translations are collected, the statistical favorite will then be incorporated into the translator.  Two of the words Hugo mentions -- aardigheidje and giechel -- will be included in the next Dutch refresh.

Windows Live Translator is going to perform better and better as its underlying databases are populated.  It's just going to take time, and forthright feedback such as Hugo's only hastens the process.  I've given feedback of my own, which was graciously received by the team.

My last name is also a noun, and a component of place names, in my native language.  My full name as rendered here is also a place name in at least two US states (there appear to be two Ward Ponds in Massachusetts alone).  This configuration challenges current MT technology.

My brief testing of the technology before I posted on Tuesday showed that it had trouble with the words "ruminating," "appendectomy," and "telecommute."

As the databases grow, I'm sure that these issues will subside, although I'm quite curious to see how they'll deal with the whole names-as-proper-nouns situation.

Thanks to Hugo for his interest and comments.  I urge all of you fluent in any of the supported languages (German, French, Italian, Spanish, Portuguese, Chinese Simplified, Chinese Traditional, Japanese, Korean, Arabic, and Netherlands Dutch) to liberally exercise both the technology and the feedback page.

Remember, based on the state of the underlying database for your selected language, your mileage may vary.  Think of yourself as a beta tester for your language, with commensurate privilege to raise issues and concerns with the team.  Based on my experience with them, they'll jump on the chance to make their product better.

When this is working up to par, think of the extended reach this can give the web!  It will never replace the loving touch of a person fluent in both the source and destination languages, but it has strong potential to further democratize the web, and that can't be a bad thing.

Moron..  oops..  I mean..  More on this topic as events unfold.

     -wp

More Posts Next page »
 
Page view tracker