100 Things I Hate About Views: Undeclared Data Types in Columns
Views let you do dumb things by accident in SQL Server. Then they make you have to think way too hard to fix them.
Read Moreon • 9 min read
You’re setting up SQL Server log shipping for disaster recovery. What else do you need to do to best prepare for a failure?
This is a “listen-able” 30 minute video. Prefer a podcast instead? Find it at kendralittle.com/dear-sql-dba-podcast.__
We are going to start log shipping to reduce our time to recover from an outage. What can I do proactively to make things easier on myself when I want to switch over to the disaster recovery site (especially if the original system is unavailable)? I’m particularly worried about syncing user accounts, and dealing with SQL Agent jobs.
One of my favorite quotes is from Samuel Beckett. “Ever tried. Ever failed. No matter. Try again. Fail again. Fail better.”
When things go terribly wrong, our job as DBAs is to make it the best failure possible.
The fact that you’re thinking about this is great!
You’re right, there are two major types of fail-overs that you have to think about:
Even when you’re doing a planned failover, you don’t have time to go in and script out settings and jobs and logins and all that stuff.
Timing is of the essence, so you need minimal manual actions.
And you really should have documentation so that whomever is on call can perform the failover, even if they aren’t you.
One of the biggest risks in solving this problem is “whoops, I was was trying to plan for disaster, and accidentally messed up production.”
You need an environment where you can restore all the databases, set up tools, and test things out. I usually call this “prod test”, but it goes by “staging” sometimes as well.
You want it to be as similar as possible…
Don’t cut corners with security to make things easier for disaster failover.
Use color coding on registering the instance names in SSMS so you know what domain you’re connected to.
I like using ye olde BGINFO.exe (free tool from Microsoft’s Sysinternals team) to color code desktops for when you remote desktop, too.
If you just have a few SQL Server instances to manage for disaster recovery, you may prefer a manual process where:
This can be easier for things like creating a new domain security group in the environments, particularly if you don’t have the permissions to automate something like that yourself.
It can also be simpler for things like adding a linked server, where the linked server name is going to be different in the environments.
But if you’re managing more than a couple of instances, and if you have a lot of people who can deploy changes to the SQL Servers, doing it 100% manually just isn’t going to work. In that case you may want to have more automation:
“Staging changes” in this case means generating and saving a script for you when you aren’t sure that it’s safe to just set something loose.
Good news: you don’t have to write everything from scratch. Check out free tools that others have created.
One example is dbatools.io: https://dbatools.io/getting-started/
Disclaimer: I didn’t write this, and I only know enough PowerShell to be dangerous. VERY dangerous. But you’ve got a test environment, right?
Consider testing this (or other tools) out and adapting them to your needs instead of writing all your code from scratch.
For SQL Server login setup, Microsoft has a KB with a script to transfer logins. I believe this is handled by dbatools.io if you use it (but test for your setup, because I don’t know my PowerShell from my Power Rangers)
You are totally right to worry more about unplanned failovers
But test planned failovers first, because it’s still hard!
After failover, test that the application tier can access the database. Even a basic minimal test will help, because it’ll help you find things that need to be reset or modified after databases fail over. Things like:
Tip: Build a checklist for your planned failover. This will also work as a draft for your checklist for unplanned failovers.
Evaluating your risks in the DR environment…
Usually practicing DR failures end up with you realizing you need more space and resources than you originally planned
That’s totally normal - just make sure you ask for it before the disaster.
Companies that are serious about planning for failure practice failovers in production. They do it often.
The more often you fail over, the better you get at it. And if you don’t keep up at it, things sneak in that break your processes and automation.
You can’t do this by yourself. Failing over is about a lot more than the databases.
But once you’re practicing regularly outside of production and also getting your processes and production environment ready, too, it’s time to start suggesting planned production failovers
Even if the answer is “no”, keep bringing it up on a regular basis in a friendly, positive way.
Got an annual review? An annual review is a great time to bring this up as a place you think your team can improve, and a way you’d like to contribute with the entire IT team.
Here’s the five steps toward disaster preparedness…
Even if you can’t complete step 5 (because you can’t do that alone), don’t forget to brag on yourself.
Write up a summary of the work you’ve done for your manager. If you’re blocked due to time or outside resources, summarize what you’d like to do further and what can help you make that happen.
This is the kind of project that people outside your team might not think to ask about. But it’s fantastic work for your team to do, and it’s something you should make sure to talk about!
Copyright (c) 2025, Catalyze SQL, LLC; all rights reserved. Opinions expressed on this site are solely those of Kendra Little of Catalyze SQL, LLC. Content policy: Short excerpts of blog posts (3 sentences) may be republished, but longer excerpts and artwork cannot be shared without explicit permission.