Posts Tagged ‘DBA’

New Toad for SQL Server Beta

Monday, May 21st, 2012

A new beta build of Toad for SQL Server (v5.7.0.527) is available at:

http://toadforsqlserver.com/beta.jspa

It’s free and, afaik, doesn’t have a short expiration date.  It contains popular features such as compare & sync (for database schemas, servers, and data), a full transaction log reader and DML undo feature, debugger, intellisense, auto-complete, code formatter, and a lot more.  Check it out!  (There’s also a version of Toad for Cloud Databases, which gives you SQL-like capabilities against a bunch of NoSQL databases).

This drop contains a couple of fixes in the areas: Database Object Editors, Job Management, Editor and Code Completion, Schema and Data Compare. The dev team is looking forward for your feedback/posts on the forum!  Tell ‘em I sent you.  ^_^

Thanks!

-Kev

Follow me on Twitter!

‘Backup Completed’ is NOT an Error Message

Friday, May 18th, 2012

If you’re like me, you like for things to be semantically reliable.  Huh?

Said another way, I like for things to mean what they say and say what they mean.  Here are a few examples of I get annoyed by failed sematics – when a footpath is used almost entirely by cyclists, when an escalator is merely stairs, or when a restroom has a huge crowd and long lines.  (No rest to be had in that room).

So you can bet that I get a little prickly when the “Error Log” is used to post messages that something completed successfully.  Really?  I came here to this error log looking for, wait for it, … errors!  My biggest annoyance here in the SQL Server sphere is that SQL Server has been posting messages in the error log every time a backup completes successfully for, like, three hundred years or something.  I can remember at least five years ago that Microsoft storage PM Kevin Farlee blogging about it.  And Kevin has been working on SQL Server for, like, three hundred years too.

I recommend that you set your SQL Server to use the startup traceflag DBCC TRACEON (3226) to disable backup success message.  Read all about it on Microsoft’s webpage describing this and many other trace flags for SQL Server.

In addition, be sure to look at Benjamin Nevarez’s post on cool, undocumented trace flags.  He still hasn’t told me the secret trace flag that sends a sock to the Microsoft developer whenever the feature s/he developed causes an end-user to scream in frustration.

And don’t overlook golden-oldies posts, like Andrew Kelly’s blog chalked full of example T-SQL programs to demonstrate this scenario.  I think this blog post was also written, like, three hundred years ago – way before computers were invented.  Very prescient of Andy!

Enjoy,

-Kev

-Follow me on Twitter

 

 

SQLMag = SQL Server Pro. Goes all-digital!

Friday, April 27th, 2012

I was recently chatting with Megan Keller, my long-time editor for the Tool Time column and Executive Editor at SQL Server Pro, DevProConnectionsand SharePoint Pro.

I’ve subscribed to SQLMag ever since it was first put to print back in the late 1990′s.  (That’s a pic of me, on the right, in the shirt given my by SQLMag’s first publisher way back in the day).  I have many bookshelves in my office, but SQLMag consumes more than half of the shelf closest to my desk.  It’s that good.  Some of my personal favorites and perpetual must-read content are the columns SQL Server Questions Answered by Paul Randal & Kimberly Tripp as well as the always excellent columns Puzzled by T-SQL by Itzik Ben-Gan and all of the great content by Kalen Delaney.

Megan recently told me about the exciting changes afoot there.  For starts, SQL Server Magazine’s has new name—SQL Server Pro.  This name, as you can tell from its sister publications listed at the top of the blog post, puts all of the Penton Media properties on an equal and consistent footing.

Please take some time to check out hands-on, how-to content from SQL Server experts at sqlmag.com. The on-line magazine features the same great expert advice and writers as before.  And you can access my articles on sqlmag.com just as you have in the past.

Suggestions for the Tool Time Column?

And while we’re at it, let me know if there are any SQL Server related tools you’d like to see in the Tool Time column!  My requirements are that the tool must be free, must be supported, and of course must be relevant to SQL Server professionals.

 

Enjoy,

 

-Kev

Follow me on Twitter!

New White Paper: SQL Server Extended Events and Notifications

Wednesday, April 25th, 2012

Download the new white paper: How to Use SQL Server’s Extended Events and Notifications to Proactively Resolve Performance Issues

SQL Server comes with a wide array of tools for monitoring your environment. There are logs and traces that provide information when errors occur, but these are often used passively to react to events that have already occurred.  There’s PerfMon, and Profiler, and loads of Dynamic Management Views to check.  But where to look?

As database administrators (DBA), we need to monitor our environments proactively and create solutions as issues arise. In this white paper, we will look at a couple technologies – event notifications and extended events – that can help you achieve these goals. With these two features, we’ll look at the error log and deadlocks, and demonstrate how you can get relevant information delivered as it occurs. We’ll also look at ways that run-time errors can be captured and used to help reduce the amount of time required to investigate issues.

This white paper, written by SQL Server MVP Jason Strate (blog | twitter), is a free download but does require a registration.

And, as always, I enjoy your feedback.  Thanks!

-Kev

Follow me on Twitter!

Starting this week: Dublin, Maidenhead, and London

Monday, March 19th, 2012

This might be most most overcommitted four-week period of time ever in my life.  I’m tired just thinking about it! Not only am I traveling internationally and speaking over the next few weeks, I’m also helping on two book projects, learning some new applications from Quest Software, and helping on a small Transact-SQL refactoring project.

Swag on hand? I’ve got a special printing of 500 video training DVDs for this trip:

SQL Server Training on DMVs

Performance Monitor and Wait Events

Plus, I’ll have a few posters, stickers, and other goodies.  Come see me!

 

SQL Saturday 105; Dublin, Ireland; March 24

My maternal grandmother was first generation Irish-American and, somehow, going to Ireland feels a lot like going home to grandmom’s house.  And all my Irish friends make it feel like I’m going home to see the extended family – cousins and ‘once-removed’ family types.  And on top of that, we get to talk about SQL Server at SQL Saturday #105!   I’ll be doing a session called “Top 10 Things Every Developer Should Know”.  I’ll also be hanging out at the Quest Software booth much of the day and, just for fun, I plan on doing a completely unscripted lightning talk.

 

SQL Server User Group; Maidenhead, UK; March 27

From Dublin, I head over to the lovely town of Maidenhead, UK.  I’ll be spending a couple days in the Quest Software office there in Maidenhead, whose SQL Server User Group is lead by fellow Questie Richard Douglas (blog | twitter).  I’ll be presenting after Business Intelligence impresario Jen Stirrup (blog | twitter).  Space is limited, but there are still some seats left.

I’ve already heard from other twitterati that some great Microsoft SQL Server MVPs will be attending, like Tobiasz Koprowski (Blog | Twitter).  If you live in south, central England, then this is your chance!  Register here: http://www.sqlserverfaq.com/events/386/Maidenhead-UG-meeting-SQLBits-Preview-Speakers-include-MVPs-Kevin-Kline-and-Jen-Stirrup.aspx.

 

SQLBits; London, UK; March 29 – 31

This is the official launch event for SQL Server 2012!  This is your chance to get the best and biggest dose of SQL Server 2012 training for quite some time.  The free training day event is sold out.  However, some of the training day seminars have open seats, including my seminar Leadership Skills for the Database ProfessionalThis seminar distills the years of formal training and hard-won experience I’ve accumulated throughout my career starting as a developer leading a small team, through the founding and early startup years of PASS, into my later years leading a large, multi-national development organization.  You’ll learn all the skills that are crucial for you to make the leap (and it’s a big one) from full-time technologist to a leader and manager of people.

And we’ll be hosting our popular SQL trivia quize and IT Horror Stories sessions as well.  So be sure to plan on grabbing your lunch and heading into our fun lunch-time sessions!

I hope to see you at one of these upcoming events!  Cheers,

-Kevin

-Follow me on Twitter

Dev Advice: Make a Tiny Dev Database Act Like a HUGE Prod Database

Friday, March 16th, 2012

Here’s an evergreen question.  It’s a question that never completely goes away.  But lately, I’ve been getting it a few times per week.  So I thought it’s time to readdress the question, which usually takes some form of the following:

I can’t really do effective development on my little dev laptop because our production SQL Server database is 15 gazillionbytes, way too big for my workstation.  What’s a uber-nerd to do? 

Well, maybe they didn’t use the word “uber-nerd”.  But you get my drift, right?  The production database is really, really big – unmanageably big for keeping a local copy.  So that means the dev either has to create a metadata-only version of the database, which won’t produce realistic query plans, or somehow crush their laptop under 15 gazillionbytes of MDF and LDF files.

Actually, you have a better alternative – a clone database, sometimes called a shell database.  Here’s how I described a cloned database a few years ago here in my Tool Time column for SQL Server Pro Magazine:

In effect, a cloned database includes all of the schema objects of the database (e.g., tables, views, stored procedures), as well as the statistics and histograms (the so-called “statistics blob”). This metadata is quite small by volume but can tell you what estimated query plans look like outside of a large production environment and how those estimated query plans might change when SQL Server is upgraded. Cloned databases are especially useful when the data is confidential, classified, or subject to privacy laws.

The article gives you all the detail you need to effectively and quickly create a small version of a big, ol’ production database that produces the same query execution plans as you’d get on the prod server.

If you’re struggling with doing development on a big SQL Server database, learn the ropes on cloned databases asap!  You’ll be glad you did.

Enjoy!

-Kev

-Follow me on Twitter

 

Accelerate OLTP with HP and Microsoft’s New High Performance Reference Architecture

Tuesday, March 6th, 2012

If you haven’t started to read Shashank Pawar (blog), you’re missing out.  Shashank is part of Microsoft Australia and has been writing some very good content lately.  Here’s an example from the Reference Architecture for High Performance SQL Server:

HP and Microsoft engineering teams have worked together to create a reference architecture to Accelerate Online Transaction Processing (OLTP) database workloads with a fully-flash based HP/Microsoft architecture and achieve significant performance increases, simplified database manageability, and industry leading TCO.

The details come in a torrent after that leading paragraph with lots of pretty pictures and charts to help explain.  This is great stuff, especially for competitive platforms such as Oracle Exadata.

Read more about the new HP High Performance Reference Architecture for SQL Server 2012 here.

And just out of curiousity, are any of you using high performance architectures such as Oracle Exadata, IBM Netezza, or Teradata?  I’d love to hear your feedback, questions, and comments.

Enjoy,

-Kev

-Follow me on Twitter

New on SQLMag Tool Time Blog – Update to FineBuild

Monday, January 9th, 2012

Recall back in January 2011 that I profiled the cool tool, FineBuild for SQL Server, which helps you configure and quickly deploy installations of SQL Server.  Not only does FineBuild help you install a new SQL Server using the settings and configuration options you desire, it goes a few steps further by ensuring that any additional programs, tools, and utilities are also installed.

Ed Vassie, the creator of FineBuild, has revised and improved the tools since I last wrote about it.  Ed has naturally added a number of bug fixes and documentation improvements. Several new features… [READ MORE]

Must-Have Resources – SQL Server Backup & Recovery

Thursday, December 8th, 2011

One of the things that drives me crazy as I’m getting older is that my brain is losing the capacity to differentiate version numbers.  As I speak travel around speaking with customers and at conferences, I find my self saying things like “I can’t recall if this problem was fixed in SQL Server 2000 or 2005. But you don’t have to worry about that any more.”  Or things like “That feature was added in SQL Server 2008 R2, eh, or was that version 6.5.  DOH!” followed by a loud slapping sound as I whap my palm into my forehead.

The Internet doesn’t forget either.  Recommendations that were once helpful, if not outright essential, now are neutral or even downright bad. So now, whenever I put together new presentations, I always spend a lot of time in research, reassessing my knowledge on the topic.  (That doesn’t mean that I’ll extemporaneously say it wrong, because I speak in an off-the-cuff and rapid style. But at least my notes are usually correct).

 

Case In Point

Take backup and recovery (B&R), for example.  I’ve been writing about and performing B&R for years.  I’m even part of the team that builds the most popular B&R tool in the SQL Server space.  It’s an extremely important part of what I do.  And yet, even after spending a couple days re-researching topics (yet again), I still manage to get a few of the more specific details wrong because of changes over the years in the feature set.  How so?

During an Expert’s Perspective webcast last week (and available on-demand) covering the top backup and recovery mistakes on Microsoft SQL Server, I mis-explained the details concerning how SQL Server performs a differential backup.  A very clever SC on our team who was also attending the webcast pointed out to me after the session that I’d described differentials working at an 8k page-level when, in fact, they work at the extend-level (that’s a block of eight 8k pages). #FACEPALM!

When describing the differential backup I said that a bit was flipped on each page header and SQL Server would only back up those pages. Instead, whenever a page is changed a bit is recorded on the differential change map (1bit per extent), the backup process then queries these map pages and backs up those extents that have been marked as changed.

 

The Research Reveals

The cool revelation here is not that I can admit my mistakes.  The take-away from this blog post are all the great articles I read writing my latest slide deck.  These blogs and articles were so good that I needed to spread the word.  Add these to your must read list:

Virtual Log Files must be tamed!

Backup and Recovery Myth Busting

Other Good Sources

And just in case you need a refreshing in the basics of SQL Server backup and recovery, check these out:

Everybody Needs a Test Harness

Monday, October 31st, 2011

When you’re developing new Transact-SQL code or modifying some existing code, do you just launch directly into programming?

I know that I did just that, for years.  It wasn’t until I was trying to performance tune some existing code that I realized I hadn’t actually taken caching of data and execution plans into account.  So all those modified stored procedures that I was so proud of might not actually be faster than the first generation of procedures because I hadn’t checked to ensure that I was testing cached programs against uncached programs (and, by extension, the data used by those programs).  That’s easy enough to fix with a test harness.  Test harness were originally an actual, physical harness used by engineers to clamp down parts of an electrical or mechanical device they were prototyping.  Ours is no different.  It locks down all of the assumptions about our code (like my early, false assumption that I didn’t need to clear the caches) and adds a metric or two for good measure – literally – so we can better measure what’s happening in that code.

Here’s what my test harness looks like:

/* Transact-SQL test harness by Kevin Kline, http://KevinEKline.com, Twitter at kekline */
/* Flush dirty pages from the buffer to the database files. */
CHECKPOINT;
/* Flush the data cache and procedure cache, respectively. For DEV environments only! */
DBCC DROPCLEANBUFFERS;
DBCC FREEPROCCACHE;
/* Enable statistics tracking for IO and timings. Remember, SET commands remain enabled during a session until disabled. */
SET STATISTICS IO ON;
SET STATISTICS TIME ON;
-- Whatever SQL code you'd like to process goes below.
SELECT SalesOrderID
FROM Sales.SalesOrderHeader H
WHERE CustomerID = 344
GO
SET STATISTICS IO OFF;
SET STATISTICS TIME OFF;
/* Textual Execution Plans, if desired.
SET SHOWPLAN_TEXT ON;
SET SHOWPLAN_TEXT OFF;
*/

 

I also like to include the execution plans a lot of the time.  You might wonder why I don’t save the execution plans for the GUI in SSMS?  Well, I’m a big advocate of scripting in general because I like to automate activities.  By pulling the execution plans using scripts, I can use SQLCMD to schedule a large number of query executions during the evening and have the results ready for analysis when I come back into the office in the morning.  Workin’ smarter, not harder, Baby!

So how does this test harness work for you?  Do you use other elements in yours?  If so, share your experiences here!

Thanks,

-Kevin

-Follow me on Twitter