Quiz: Are You the Next Brent Ozar Unlimited Consultant?
Hey SQL Server DBAs -- we're hiring!
Here's a quick five question quiz. Give yourself one point for every 'yes':
Hey SQL Server DBAs -- we're hiring!
Here's a quick five question quiz. Give yourself one point for every 'yes':
For the past two years, Red Gate's Tribal Awards have let you, the SQL Server community, nominate and vote on their favorite community voices. Here's the 2014 winners: Best New Community Voice: Cathrine Wilhelmsen (@CathrineW) Best Presentation at a Technical Conference: Dr. Rimma Nehme (@RimmaNehme) Best New SQL Book: SQL Server Query Performance Tuning by Grant Fritchey…
Every time someone tells me, "This database is mission critical - we can't have data loss or downtime," I just smile and shake my head. Technology is seriously difficult.
To illustrate, here's a collection of client stories from the last few years:
Both Oracle and SQL Server offer several ways to support disaster recovery scenarios. One of the simplest ways to handle DR in the SQL Server world is to use SQL Server log shipping. Oracle doesn't offer log shipping as a part of the core product, but it's possible to set up log shipping in Oracle.
Recently, I wanted to play around with the auto_stats event against a test system running SQL Server 2014. I ran through the session setup GUI and added the auto_stats event. I configured it with a filter (predicate) to only show me auto_stats event in a database named AutoStatsTest. There's a cost to events that may fire frequently and a cost to filters, but this is my test box and I was just using this to learn-- so no biggie, right?
You can't do everything with filtered indexes in SQL Server. For instance, you can't create the following index:
[crayon-6a3643e66370e500776434/]
If you try, you'll get the error message:
[crayon-6a3643e66371b977288351/]
Instead, you can use 'IN' and create the index this way:
[crayon-6a3643e66371f332182134/]
That works-- and good news, even queries written with 'OR' can use that filtered index, because SQL Server is clever like that. Here's an execution plan that shows it in action.
I've written a terrible query. It might be the worst query in the world. Sure, there are other queries that may be slower, but this query is terrible and elegantly short.
The query is gloriously bad for a two reasons:
When you drop a database in SQL Server, the files are normally removed from the file system right away. POOF! Hope you had a backup if you ran DROP DATABASE against the wrong instance.
However, things are a little different if you take the database offline before you drop it. Consider the following code:
[crayon-6a3643e665117564273013/]
Here's what S:\MSSQL\Data looks like after I run the whole script, including DROP DATABASE...
I've seen servers with thousands of databases on a single SQL Server, and it works. Sure, opening the databases list in SQL Server Management Studio is painful, and a lot of third party monitoring tools fall over, but it's not so bad once you know how to work around these issues.
But there's two issues you can't work around: our old archenemies, RPO and RTO. A quick reminder:
Your users probably shouldn't be able to view all of the data.
You might have regional sales managers who should only see sales for their region, or human resource staff who should be able to see employee details but not salaries.
I have a new mission: to convince you, the long-time Profiler user, to switch to Extended Events. I realize I have a long, difficult task ahead of me. Profiler has been around for a long time. You're comfortable with it. You know it's not perfect, but you have learned to live with its imperfections. Now I want you to step outside your comfort zone and learn a new tool, with new terminology, a new interface and new capabilities.
I'm a fan of SQL Server's transaction log shipping. It works in Standard Edition, it's relatively simple to set up, and you can even make your log shipping secondary readable using STANDBY mode.
I've worked with some pretty cool, complex log shipping environments over the years. In one case, we had multiple log shipping secondaries and a load balancer involved to support a full fledged reporting application. It worked pretty well-- with a lot of careful scripting and support.
Here's some of the reasons companies usually virtualize their SQL Servers:
Cost savings on hardware
Cost savings on Windows OS licensing
Cost savings on SQL Server licensing
Protect against the failure of a single hardware element
Leverage extended features for Disaster Recovery
Automatic load balancing across multiple hosts
Easier hardware replacement/migration
If you're using AGs, don't apply these patches:
SQL 2012 SP2 CU3
SQL 2012 SP2 CU4
SQL 2014 CU5
When Extended Events (XE) were released with SQL Server 2008, I was excited - something new to learn! I read Microsoft articles about them, read blog posts about them, and tried to use them. At that time, there was no GUI for XE. I had to create the sessions with T-SQL. That wasn't awful - I…
This year's Simple Talk Tribal Awards are out, and the video announcements are pretty funny:
https://www.youtube.com/watch?v=KIiTV-i7QPI
You may have heard that there's a secret back door into your SQL Server-- but have you enabled access to it properly? Do you know when you might need to use it, and how you can connect? Kendra Little explains why the Dedicated Admin Connection (or "DAC") is so important and how to configure remote access.
One of the blocking scenarios I find most interesting is related to online index rebuilds. Index rebuilds are only mostly online. In order to complete they need a very high level of lock: a schema modification lock (SCH-M).
Here's one way this can become a big problem:
When we first started our company, we laid out our goals in a shared Google Doc. We wrote about what we wanted to do, how we wanted to treat our employees and customers, and the growth numbers we wanted to achieve. One of our original goals was to hire one consultant per year. In 2012, it…
I started tweeting various single-words you could start an argument with the other day. I really liked this suggestion from @SQL_Kiwi:
https://twitter.com/SQL_Kiwi/status/550126918503108609