Launch week: the Season Pass & Fundamentals Week are 50% off — ends in 19d 13h 32mSee the sale

Author: Erik Darling

Restoring tempdb since GETDATE(). Now blogging at ErikDarlingData.com.
Production DBA

Availability Group Direct Seeding: Mind Your Backup Jobs

I'll get right to the point While you're Direct Seeding, you have to be careful with any other full or differential backup jobs running on the server. This is an artifact of the Direct Seeding process, but it's one you should be aware of up front. In the screencap below, courtesy of sp_whoisactive there's a…

Read more about Availability Group Direct Seeding: Mind Your Backup Jobs 7 comments — Join the discussion

TDE and Backup Compression: Together At Last

Note: THERE ARE BUGS IN THIS FEATURE. Make sure you read all the way through the post to catch the updates from Microsoft as more bugs were found.
TDE is one of those things!
You either need it, and quickly learn how many things it plays the devil with, or you don't need it, and there but for the grace of God go you. Off you go, with your compressed backups, your instant file initialization, your simple restore processes. Sod off, junior.

Read more about TDE and Backup Compression: Together At Last 39 comments — Join the discussion

Availability Group Direct Seeding: Extended Events and DMVs

As of this writing, this is all undocumented
I'm super interested in this feature, so that won't deter me too much. There have been a number of questions since Availability Groups became a thing about how to automate adding new databases. All of the solutions were kind of awkward scripts to backup, restore, join, blah blah blah. This feature aims to make that a thing of the past.

Read more about Availability Group Direct Seeding: Extended Events and DMVs 16 comments — Join the discussion

Availability Group Direct Seeding: How to fix a database that won’t sync

This post covers two scenarios
You either created a database, and the sync failed for some reason, or a database stopped syncing. Our setup focuses on one where sync breaks immediately, because whatever it's my blog post. In order to do that, I set up a script to create a bunch of databases, hoping that one of them would fail. Lucky me, two did! So let's fix them.

Read more about Availability Group Direct Seeding: How to fix a database that won’t sync 25 comments — Join the discussion
Production DBA

The Worst Way to Judge SQL Server’s HA/DR Features

We love to help people plan for disasters
We're not pessimists, we've just seen one too many servers go belly up in the middle of the night to think that having only one is a good idea. When people ask us to help them, we have to take a lot into consideration. The first words out of the gate are almost always "we've been thinking about Availability Groups", or some bastardized acronym thereof.

Read more about The Worst Way to Judge SQL Server’s HA/DR Features 3 comments — Join the discussion

SQL Interview Question: “How do you respond?”

Brent's in class this week!
So you get me instead. You can just pretend I'm Brent, or that you're Brent, or that we're both Brent, or even that we're all just infinite recursive Brents within Brents. I don't care.
Here's the setup
A new developer has been troubleshooting a sometimes-slow stored procedure, and wants you to review their progress so far. Tell me what could go wrong here.

Read more about SQL Interview Question: “How do you respond?” 40 comments — Join the discussion

Getting Started With Oracle Week: Creating Indexes and Statistics

This is not a deep dive
If you're looking for lots of internals and explanations of what happens behind the scenes, don't read past here. I almost made a READPAST joke. It's that kind of day. This is just a basic overview of creating some indexes and gathering statistics. Why? Because someone just paid about $47.5k for every 0.75 cores of Oracle Enterprise licensing and they probably expect some performance out of it. This isn't MySQL. We don't have all day to get query results.

Read more about Getting Started With Oracle Week: Creating Indexes and Statistics 9 comments — Join the discussion

Getting Started With Oracle Week: NULLs and NULL handling

We're not so different, you and I
In any database platform, you'll have to deal with NULLs. They're basically inescapable, even if you own an island. So let's compare some of the ways they're handled between Oracle and SQL Server.
Twofer
If you take a look at the two queries below, there are a couple things going on. First is the NVL function. It's basically the equivalent of SQL Server's ISNULL function, where it will return the second argument if the first is, well, NULL.

Read more about Getting Started With Oracle Week: NULLs and NULL handling 33 comments — Join the discussion

Getting Started With Oracle Week: Joins

Oh, THAT relational data
Thankfully, most major platforms (mostly) follow the ANSI Standard when it comes to joins. However, not all things are created equal. Oracle didn't have CROSS and OUTER APPLY until 12c, and I'd reckon they're only implemented to make porting over from MS easier. It also introduced the LATERAL join at the same time, which does round about the same thing.

Read more about Getting Started With Oracle Week: Joins 4 comments — Join the discussion

Getting Started With Oracle Week: Generating Test Data

Bake your own cake
Pre-cooked example databases are cool for a lot of things. The first being that everyone can have access to them, so they can follow along with your demos without building tables or inserting a bunch of data. If you mess something up, it's easy to restore a copy. The main problem is that they were usually designed by someone who didn't have your issues.

Read more about Getting Started With Oracle Week: Generating Test Data 10 comments — Join the discussion
Performance Tuning

Is your SAN’s cache killing tempdb?

Let's start with definitions
Many SANs have caching built in. What kind of cache is important, because if you're dealing with non-SSD storage underneath, you could be waiting for a really long time for it to respond.

Let's start with some definitions of the most popular caching mechanisms available for SANs. I'm not going to say 'only', because some vendor out there might have some proprietary stuff going on that I haven't heard of.

Read more about Is your SAN’s cache killing tempdb? 3 comments — Join the discussion