Monthly Archives: September 2010

How I Make Coffee and Servers

I’ve got a disturbing array of coffeemaking gear:

My Coffeemakers

My Coffeemakers

From left to right:

  • Bialetti Moka – stovetop espresso maker.  Great for making powerful hot chocolates in the dead of winter.
  • Burr grinder – the best way to get very consistent grinds.  The grinders with spinning blades just randomly slice and dice your beans, but burr grinders get all of the pieces exactly the same size.  Probably the best $100 I ever spent to improve the quality of my coffee.  I linked to a different one since mine’s discontinued.
  • French press – produces very flavorful coffee, but it’s a complete pain in the rear to clean.  They have to go through the dishwasher after each use.  Since it doesn’t have a built-in heating element, I have to microwave water first, and the resulting coffee isn’t as hot as I’d like.
  • Krups Moka Brew – the easiest way to brew something that tastes like an Americano, which is an American-style coffee made with espresso and hot water.  Pretty easy to clean, produces a lot of coffee at once, and it has a built-in heater.  That’s a pro and a con – it means the coffee can taste burnt after it sits on the hot carafe for a few minutes.
  • AeroPress atop a Microsoft mug – the AeroPress looks like a gimmick when you first see it, but it produces the very best coffee I’ve ever had outside of a cafe.  Nothing else in my arsenal even comes close.  Big props to Adam Machanic (Blog@AdamMachanic) for telling me about this.  Fast brew times, absurdly easy to clean, great coffee – but only one cup at a time.

The AeroPress produces by far – by FAR – the best coffee, but when I get up in the morning, I fire up the Krups Moka Brew and make a pot.  I sacrifice flavor for ease-of-use, because I need more than one cup and I’m trying to get a lot done in a short amount of time.  I need to feed the dog, take her for a walk, check my emails, cook breakfast – okay, well, assemble breakfast, which usually consists of granola and yogurt.  I want to brew enough for me to have a couple of cups, plus Erika needs a couple of cups, plus a cup to-go for work.

Every now and then, in the afternoon, I’ll brew a cup of coffee with the Aeropress and savor every sip.  The rest of the time, though, I just can’t afford to micromanage my coffee one cup at a time to get it absolutely right.

That’s Why I Love Virtualization, Too

Most of the time, I need to get a database server up and running as easily as possible.  I don’t want to completely sacrifice all semblance of security, performance, and manageability, but I don’t have all the time in the world.  I can’t usually fine-tune every hardware setting like SAN multipathing, network card load balancing, failover protection with clustering, and so forth.  I just need a core set of basic hardware up and running to service the company’s needs.

I deploy a virtual server with a few mouse clicks, and presto, we’re off and running.

If I need high availability, disaster recovery, snapshot backups, or any number of common datacenter features, I just tell my virtualization sysadmin, and they’re handled.  Even better, they’re handled exactly the same way across all of the company’s servers, which makes management easier.  Don’t get me wrong, I still double-check what they do – like Ronald Reagan said, “Trust, but verify.”

When I need to wring every last bit of flavor performance out of a SQL Server, then sure, I build a finely crafted physical server for it.  But the rest of the time, I use virtualization by default, because it’s gotten good enough.

I’m kicking things off on my SQLskills blog with a virtualization series.  Visit me there, or subscribe to my SQLskills RSS feed, or subscribe to my SQLskills posts via email.  Enjoy!

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

SQL Server DBA Scripts: How to Find Slow SQL Server Queries

SQL Server database administrators need to be able to quickly find out what queries and stored procedures are running slow.  Microsoft includes sp_who and sp_who2 in SQL Server 2005 and 2008, but there’s a much better tool, and it’s completely free.

In this five minute tutorial video, I explain how to use sp_WhoIsActive from Adam Machanic (Blog@AdamMachanic).  Sorry about the audio – I’ve ordered a new microphone and it hasn’t arrived yet.

Where to Download sp_WhoIsActive

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

Register for SQLBits in England – Space Running Out!

If you deal with VMware, Hyper-V, SANs, and SQL Server, come check out my pre-conference session at SQLBits in York, England on Thursday, September 30th.  My all-day session is called, “Virtualization, SAN, and SQL Server: The Perfect Storm.”

This will be a fun, intimate session – it’s limited to 40 people max, and we’ve got a few spots left.  Here’s the abstract:

Virtualization, SAN, and SQL Server: The Perfect Storm

Each of these things alone is tough enough to manage, but when you start to combine them, the forecast calls for rogue waves of bad performance.  Metrics like CPU % and disk queue length just don’t mean anything anymore.  No matter what numbers you hand your virtualization sysadmins, Windows admins, or SAN admins, they all say the same thing: “It’s a SQL Server problem.”

Learn how to fight back as Brent Ozar, Microsoft Certified Master, exposes some surprising truths like:

  • What metrics can prove it’s not a SQL Server problem
  • Why you might not want to separate your data and log files onto different drives
  • How to double-check to make sure the other guys are doing their job
  • The crucial configuration choices that can doom your SQL Server performance from the start

By the end of this session, you’ll be able to walk back into your office, gather statistics and configurations, and give your sysadmins and SAN admins the information they need to fix performance problems on their end.

For £450, you get my all-day pre-con session on Thursday plus full days of training on Friday and Saturday too!  Check out the SQLBits agenda, which includes sessions like:

  • Understanding SARGability – Rob Farley is one of the funniest guys you’ll ever meet, and his sessions get rave reviews.  Once you understand SARGability, you’re much more equipped to troubleshoot slow queries.
  • SQLDiag and SQLNexus – these two completely free tools will change the way you do performance tuning.  Microsoft Certified Master Christian Bolton, the lead author of Professional SQL Server 2008 Internals and Troubleshooting, will explain how to use ‘em.  His company, Coeo, is even giving away a free Fusion-IO drive during SQLBits!
  • Introduction to Extended Events – this new tool in SQL Server 2008 doesn’t get much press because it’s a pain in the rear to get started with.  Jonathan Kehayias is the man to show you how because he wrote the free SSMS Extended Events Manager, a tool that’s been featured in SQL Server Magazine.

This event has speakers from around the world including Brad McGehee, Buck Woody, Kevin Kline, Thomas Kejser, and more.  This is the cheapest way to see the best people in one place in Europe, and it’s in a fun, relaxed atmosphere where you can have plenty of discussions with the speakers.  To see what the shorter sessions look like, check out one of my sessions from my last SQLBits:

Register now and choose Full Conference, and you can pick my session as your pre-con.  Register fast – we’re running out of seats!

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube

How to Buy Your First Mac

So you’re tired of craptastic plastic, and you’re noticing more and more Windows people toting around shiny metal computers? Here’s what you need to know.

Running Windows On Your Mac

If you’re reading this, you probably make a living working with Windows software, and you’re worried about how it’ll work.  Let’s get that out of the way right here and now with a quick demo video of VMware Fusion:

There’s two products available to help you run Windows in a window, VMware Fusion and Parallels Desktop. As of mid-2010, Parallels is said to run faster.  They both work better than you’d expect – you can drag & drop files between OS’s, make the OS boundary disappear altogether, and launch apps across OS’s.

For years, virtualization got a bad rap because it was slower, but today that’s just not the case.  Today, I prefer doing my development and research work in virtual machines because:

  • Bad apps don’t take me down altogether – I deal with a lot of beta and third party software that just isn’t as reliable as it should be.  Now if I have to reboot the guest to install or fix something, I can keep working in email while the guest reboots.
  • It’s easy to deploy a new guest – when I want to play with a new 3rd party tool, I simply copy an existing virtual machine and install the app in the new copy.  If the app leaves a trail of garbage in SQL Server, it doesn’t bother me, because I delete the VM when I’m done testing.
  • It’s easy to work with old versions of SQL – I’ve got separate VMs with SQL Server 2000, 2005, 2008, and 2008 R2 so that I can test code and take screenshots.  If I need to test how something works between the two, like log shipping or mirroring, I can just boot up both VMs.
  • It’s easy to freeze VMs for demos – Some of my demos involve a SQL Server being set up a certain way, but during my demos, I have a tendency to go offtopic and change things.  Now, if I trash a demo VM during a presentation, I can just restore that one VM’s file from backup.  (More on OS X’s cool backups in a minute.)
  • x64 guests work like a champ – if you need to demo 64-bit VMs, virtualization on the Mac is way, way easier than hassling with running Windows Server 2008 on your desktop.

So now that we’re a little more comfortable with running Windows in a window, let’s talk about the hardware we’re going to buy.

The Reality Distortion Field

People say Steve Jobs is so charismatic that he produces a Reality Distortion Field.  When he unveils things, people ooh and ahh and open their wallets.  Some of the things he unveils are truly worth the higher amounts on the price tag, and some of them aren’t.  Thankfully, right now (mid-2010) is a good time to buy the machines I’m recommending because they’ve had fairly recent hardware refreshes, and I don’t think newer/better/faster ones are coming in the next 4-5 months.

The stickers are optional.

The stickers are optional.

This post isn’t about whether or not Apple products are overpriced, and I’m not going to discuss value here.  This is strictly focused on what you should buy and what you should skip.

How to Pick Your First Mac

For your first Mac, there’s only two models I’d recommend.  If your computer never leaves the desk, get a Mac Mini.  It’s a tiny sub-$1000 computing appliance that performs well, is nearly silent, and works with your existing keyboard, monitor, and mouse.  The only thing I dislike about this little guy is that he maxes out at 8GB of memory, and I’d like my desktops to have more.  Apple does sell a higher-powered desktop, the Mac Pro, but the cost is astronomical.

If you travel every now and then, and you’re used to using a laptop hooked up to an external monitor, I recommend the Macbook Pro with the 13″ display.  At $1,199, it’s an absolute steal – at least, in Mac terms.

I would avoid buying a Macbook Air, a Mac Pro, or an iMac for your first Mac.  I like these machines for specialized purposes, but not as entry-level machines.

Where to Buy Your Mac

Everything about the Mac experience is different – starting with the shopping.  Apple sets their prices the same across all retailers, but during promotions, retailers can throw in extras like an iPod or a case.  Forget price shopping – shop for add-ons.  Don’t choose stores based on service, either, because your service is handled by the Apple Store.

If you live near an Apple Store, you owe it to yourself to visit.  They’re a completely different shopping experience.  For the most part, employees know what they’re talking about, there’s zero pressure, and they really seem to care.  Spend five minutes talking to a big-box-store employee, then spend five minutes talking to an Apple Store employee, and you’ll appreciate the difference.

No matter where you buy your Mac, you can walk into an Apple Store with it and get help and warranty service.  Make an appointment online for the Genius Bar, Apple’s equivalent of a help desk, and show up with your computer on time.  Expect to wait – it’s pretty much like the doctor’s office.  (Another nice thing about the Mac Mini and the laptops is that you can just carry them right into the store – not easily doable with the iMac or Mac Pro, since those weigh more.)  A Genius will call your name, hook up your computer right there, and work with you to find out what’s going on.

The downside of buying a Mac through any retail store, Apple or otherwise, is that you can’t configure the hardware.  If you want more memory or more storage, you have to buy it online.  Normally I’m anal retentive about exactly how my hardware is configured, but it’s easy to add memory later, and Apple’s memory tends to be overpriced.  Therefore, for your first Mac, I’d recommend visiting an Apple Store to compare and contrast the different models and sizes.

What To Buy With Your Mac

Max out the memory – if you’re reading this, you’re probably a geek who uses Windows, and you’re going to want to run virtual machines.  Macs can dual-boot into Windows, or they can run Windows in a Window.  Either way, the more memory you’ve got, the better.  I get my Mac memory from Crucial, a huge memory company that’s been highly reliable for me.  There’s cheaper places to get memory, and I haven’t had as good of luck with those.  To learn how to replace your Mac’s memory, check out the repair guides at IFixIt.com.

Any big USB hard drive – Apple’s Time Machine is the coolest backup software on the planet, and it’s built right into OS X, the operating system for Macs.  Simply plug in any USB hard drive, and OS X will ask you if you’d like to use it for your backups.  Time Machine manages when the backups happen, and automatically keeps as much history as it possibly can given the hard drive size.  Apple also sells a wireless router called a Time Capsule that has a built-in hard drive.  It’s overpriced, but it’s brain-dead-simple.  If you don’t need a router, though, any USB hard drive will do.  Here’s what Time Machine looks like:

Even better, when it’s time to upgrade to a new Mac, just plug in your Time Machine disk.  OS X will bring over your settings, documents, and get this – your applications too.  Eat your heart out, Windows users.

Apple Magic Mouse – the entire surface of this mouse is a touchpad.  Once you use it, you won’t understand why other mice are so big, ugly, and awkward.  Power users, check out MagicPrefs to do all kinds of tasks without taking your hand off the mouse.

One to One – for $99 for one year, you can have as much personal time as you want with Mac experts at the Apple Store.  They help you get set up, teach you how to use Apple software like iMovie and iPhoto, and give you access to tutorial videos.  If you’re buying a Mac for a non-geek relative who lives near an Apple Store, One to One is the best tech support you could ever get.  I make my friends and family buy this, because it helps ‘em get up to speed without calling me every weekend.

AppleCare – this is Apple’s extended warranty.  I get this because life happens.  Unlike some big-box-store programs, though, this doesn’t cover accidental damage like dropped laptops.

Things to avoid – MobileMe synchronizes files, emails, and appointments across multiple Macs, iPhones, and iPads.  I haven’t had good luck with it, and there’s better free tools out there.

Settings to Change

If you’re coming from a Windows world, some of the default Mac settings won’t make sense.  Click on the Apple at the top left of the screen, click System Preferences, and make a few tweaks to make your life easier.

Go into Expose & Spaces.  Whenever you move your mouse into a corner of the screen, Expose makes things happen automatically.  Mine are set like this:

  • Top Left – Application Windows (shows all windows from the one app you’re using now, so if you’ve got several Word docs open, you just see those)
  • Top Right – All Windows
  • Bottom Left – Start Screen Saver
  • Bottom Right – Dashboard

Then click the Show All button at the top, and you’ll be back to the main System Preferences window.  Click Displays, then click Arrangement.  You don’t have to change anything here, but if you ever do presentations with your Mac, you’ll want to remember this screen.  The box “Mirror Displays” is checked by default when you plug in a projector, and you need to uncheck that if you want to use PowerPoint’s presenter display on your Mac.  (You do.  It’s fabulous.)

Click Show All again, and click Keyboard, Keyboard Shortcuts.  At the bottom, change the Full Keyboard Access to say “All controls.”  Otherwise, when you tab through a menu, it’ll skip some controls.

Click Show All, then Trackpad.  Enable “Tap trackpad using two fingers for secondary click,” and that’ll give you the equivalent of a right-click on the touchpad just by using two fingers instead of one.  Us Windows folks love right-clicking.

The Built-In Applications from Apple

OS X includes a few applications that have some features you might not expect, and some you might want to avoid.

Mail and iCal – does what it says on the box, but frankly, it can’t hold a candle to the Exchange/Outlook combo in any category except speed.  It loads blazing fast, searches fast, and lets you down fast.  The calendar integration sucks, you can’t see your coworkers’ free/busy time, and address lookups aren’t all that good.  If you don’t use Exchange as a mail server, though, you’ll be satisfied with Mail.

iPhoto – plug in your camera, and the Mac vacuums your photo into this slick tool.  It automatically recognizes faces once you’ve named ‘em the first time, recognizes places if your photos have geotags (like the ones embedded into iPhone photos), and can even upload your photos to Flickr or Facebook.  That last one doesn’t work too well in my opinion – I just want my entire photo library synced with Flickr or Facebook, but that’s not an option.  You have to specify which events you want uploaded.

DMGs – this isn’t an application per se, but DMG files are Disk iMaGes: packaged files that contain an equivalent of a filesystem, like an ISO file.  This is how Mac software makers distribute their stuff.  Double-click on the DMG, and your computer suddenly has another disk attached.  The software is on the disk.  Mac applications are different, too – they’re often just the one “file”.  Drag that file into your Applications folder, and presto, it’s installed.  Tired of it?  Just delete it.  Some vendors still distribute installers – particularly tools that need system integration or tools that install their own automatic updaters.  Here’s how DMGs work:

Quick Look – in Finder (the equivalent of Explorer), hit the space bar and you can preview any file.  Preview is such a lame word, too, because this thing is a monster – it instantaneously loads Excel files (complete with tabs), huge PDFs, movies, you name it.

iChat, iMovie, iDVD, iWeb – iDon’tUseThese, and iHaveNoIdeaIfThey’reAnyGood.  Well, not iChat – I do indeed chat, but I don’t bother with iChat because it only works with AOL and MobileMe users.

Applications That Just Work

Many of the tools you already use every day work fine on the Mac, including:

  • Firefox – and every plugin I’ve ever used
  • Microsoft Office – you can open anybody’s Word, Excel, PowerPoint, and Publisher files, but Access and PowerPivot users are out of luck.  You’ll need to run a Windows virtual machine for those – more on that below.  If you work for a big company that has a software agreement with Microsoft, go to your sysadmins and say, “Go to TechNet and download me a copy of Microsoft Office for the Mac.  Our Enterprise Agreement includes home use rights, and I just bought a Mac.  You can download the bits right now without paying anything.  Kthxbai.”  That Enterprise Agreement stuff may not be correct for your company, but just mentioning all these keywords makes it likely that they’ll take you seriously and go find out.
  • TweetDeck – my favorite Twitter app, but then again every Adobe Air app works fine on the Mac
  • iTunes – love it or hate it, if you’ve got an iPod or iPhone, you’re already used to this.  The good news is that it’s way faster on Macs than Windows.
  • Remote Desktop – you can use Microsoft’s client, or CoRD.  I use Microsoft’s.
  • Skype – and if you’re a serious video chatter, you might like the seamless FireWire camcorder integration.  I use a Canon ZR960 camcorder for my instant messaging & webcasts because the quality’s so much better than typical USB webcams.
  • Dropbox and LiveMesh – if you’re into the whole file-sync-in-the-cloud thing.
  • WebEx – you can create and host meetings complete with audio & video.  Microsoft LiveMeeting, not so much.

Applications to Download First

Once you’ve taken the plunge, you’ll want to install software.  Here’s the software I use most often:

Edit files with Textmate – elegant text editor that hides all of its functionality in hotkeys and slideout menus.  Comes with all kinds of syntax highlighting and code formatting bundles that await your discovery and mastery.

Capture images with Skitch (free) – insanely easy-to-use image capture and markup tool.  Grab quick screenshots for blog posts, mark them up, and drag them wherever you need them without ever saving them.  Here’s how it works:

Burn DVDs with Disco – if you work with Windows machines a lot, you probably need to burn CDs and DVDs from ISO files. Disco does that really well, and has brain-dead-simple usability.  I demonstrated it in the DMG video earlier in the post.

Note: Textmate, Skitch, and Disco all have wildly different user interfaces.  There’s no standard UI in the Mac world, but what I’ve found is that the very best applications have user interfaces that are perfect for the task at hand.  After using TextMate and Disco, every other editor and burner seems bloated and stupid.  After using Skitch, I can’t understand why every other screen capture utility makes me hit File, Save As.  Just let me drag the image where I want it, and handle everything for me.

Dropbox – sync your files through the cloud.  Dropbox installs as a service and creates a Dropbox folder in your home directory.  Anything you save in there is automatically uploaded to the cloud, and you can access it on any of your Dropbox-equipped devices – Windows, Mac, iPhone, iPad, Android, Linux, etc.  You get 2GB of storage for free, and you can pay for more.  Some apps are Dropbox-enabled, so they know how to access files through it natively.  For example, the iPhone/iPad text editor Elements just creates an Elements folder in your dropbox, thereby giving you a text editor that always has access to all the same files, anywhere.  I don’t try to sync all my files – just docs for things I’m actively working on, plus my most frequently used presentations.

Cyberduck – FTP client that also handles Amazon S3, WebDAV, Google Docs, and more.

Flip4Mac WMV Player (free) – you know how you used to hate Quicktime movies whenever they popped up on your Windows machine? Yeah, about that – now you’re going to hate WMV movies. The free Flip4Mac WMV Player at least plays ‘em, but they suck just like Quicktime movies suck on Windows machines.

Pro Tools to Get Later

Use strong passwords with 1Password – this app creates a toolbar button in your web browser, generates strong passwords for you, saves them, and synchronizes them across your Macs, iPhones, iPads, and even Windows machines.  I love having a different strong password for every web site, plus having access to all of them everywhere.  It’s not cheap, but the usability blows the doors off open source competitor Keepass.

Rate your music easier with I Love Stars – puts a little display in your tray, and you can rate music quickly.  I leave iTunes running with music all day long, and when it plays a song I love, I like to rate it.  I have a separate automatic playlist for highly rated music.

Record desktop movies with ScreenFlow – if you want to record tutorial videos showing how to do something like the one I did above, you can’t do it easier than with ScreenFlow.  Camtasia also has a Mac version.  Either way, host your videos at Vimeo, which allows you to upload high definition videos.

No matter what laptop you use, get a hybrid drive – Seagate has hybrid hard drives now with 4GB solid state flash memory built in.  They use the memory to cache your most frequently used files so you get solid state speed on those.  Anandtech’s review summed it up by saying, “Seagate’s Momentus XT should become the standard hard drive in any notebook shipped.”  I noticed faster boot times, faster application launch times, and the whole machine felt zippier.  You can buy the 500GB drive under $150 at NewEgg or buy it at Amazon.

Who Would Go Through All This?

The easiest way to answer this is by naming some of the Microsoft SQL Server MVPs who’ve made the switch:

If you’ve got questions about what the switching experience is like, feel free to ask in the comments.

Brent Ozar

Brent specializes in performance tuning for SQL Server, VMware, and storage. He's one of the very few Microsoft Certified Masters of SQL Server, a published author, and a Microsoft MVP. He likes travel, Jeeps, Apple gear, jokes, and writing about himself in the third person. Read more and contact Brent.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle PlusYouTube